51 if (str ==
"single_ffd") {
54 if (str ==
"noisy_ffd") {
57 if (str ==
"random") {
62 std::string lower_str = str;
63 std::ranges::transform(
64 lower_str, lower_str.begin(), [](
unsigned char c) { return static_cast<char>(std::tolower(c)); });
67 if (lower_str ==
"single-ffd") {
70 if (lower_str ==
"single_ffd") {
73 if (lower_str ==
"singleffd") {
77 if (lower_str ==
"noisy-ffd") {
80 if (lower_str ==
"noisy_ffd") {
83 if (lower_str ==
"noisyffd") {
87 if (lower_str ==
"random") {
112 panic(
"unhandled ShuffleStrategy value");
129 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.