Commit 8113ea88 authored by Adam P. Goucher's avatar Adam P. Goucher
Browse files

Address issue mentioned in Dave's comment

parent dafdd533
Pipeline #180336646 passed with stages
in 10 minutes and 15 seconds
......@@ -531,14 +531,17 @@ namespace apg {
pattern altstell = remainder + xlt.shift(bbox[0], bbox[1]);
double altstelllength = stelllength;
uint64_t altbdiff = 0;
bool oneblock_improvement = false;
if (oneblock) {
int64_t bbox2[4] = {0};
xlt.shift(bbox[0], bbox[1]).getrect(bbox2);
bbox2[0] -= ideal[0];
bbox2[1] -= ideal[1];
altbdiff = (bbox2[0] * bbox2[0]) + (bbox2[1] * bbox2[1]);
trythis = (altbdiff == 0);
trythis = trythis || (std::sqrt((double) altbdiff) <= std::sqrt((double) bdiff) - 25.0);
oneblock_improvement = (std::sqrt((double) altbdiff) <= std::sqrt((double) bdiff) - 25.0 + 0.1 * initbail);
trythis = (altbdiff == 0) || oneblock_improvement;
} else if (lexrepr == "xs4_33") {
if (trycount == deep_bailout) {
std::cout << "Reached bailout for strategy 'deep'" << std::endl;
......@@ -588,7 +591,7 @@ namespace apg {
if (altbdiff == 0) {
std::cout << "\033[32;1mInitial block correctly emplaced\033[0m" << std::endl;
return newpat;
} else if (std::sqrt((double) altbdiff) <= std::sqrt((double) bdiff) - 25.0) {
} else if (oneblock_improvement) {
std::cout << "\033[32;1mInitial block moved towards target\033[0m" << std::endl;
return newpat;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment