63 if (str ==
"single_ffd") {
66 if (str ==
"noisy_ffd") {
69 if (str ==
"random") {
74 std::string lower_str = str;
75 std::ranges::transform(
76 lower_str, lower_str.begin(), [](
unsigned char c) { return static_cast<char>(std::tolower(c)); });
79 if (lower_str ==
"single-ffd") {
82 if (lower_str ==
"single_ffd") {
85 if (lower_str ==
"singleffd") {
89 if (lower_str ==
"noisy-ffd") {
92 if (lower_str ==
"noisy_ffd") {
95 if (lower_str ==
"noisyffd") {
99 if (lower_str ==
"random") {
126 panic(
"unhandled ShuffleStrategy value");
145 constexpr auto parse(std::format_parse_context &ctx)
void panic(const StringViewSourceLoc &s)
Unconditionally terminates the program with a panic message.
ShuffleStrategy
Controls how tile orderings are generated during multi-start packing.
@ single_ffd
One FFD attempt only, no multi-start retries.
@ random
FFD first, then fully random shuffles (original behavior).
@ noisy_ffd
FFD first, then perturbed FFD orderings that preserve the large-first property.
std::optional< ShuffleStrategy > shuffle_strategy_from_str(const std::string &str)
Parses a string into a ShuffleStrategy with fuzzy matching.
std::ostream & operator<<(std::ostream &os, const PrimaryPairingMode m)
Stream insertion operator for PrimaryPairingMode.
std::string to_string(const PrimaryPairingMode m)
Converts a PrimaryPairingMode to its canonical string representation.