Commit 2daf4c3e authored by Adam P. Goucher's avatar Adam P. Goucher

Slightly improved spaceship separation

parent 0a84dcf0
Pipeline #47210978 passed with stages
in 7 minutes and 25 seconds
......@@ -150,7 +150,7 @@ namespace apg {
}
}
std::vector<std::string> pseudoBangBang(pattern pat, std::vector<bitworld> *clvec) {
std::vector<std::string> pseudoBangBang(pattern pat, std::vector<bitworld> *clvec, bool recurse) {
/*
* Borrowed from apgmera, and upgraded.
*/
......@@ -260,6 +260,13 @@ namespace apg {
components.push_back(tx[j]);
}
// std::cerr << "done!" << std::endl;
} else if (recurse) {
auto cmap = census(ppart, ppart.ascertain_period(), 0, false);
for (auto it = cmap.begin(); it != cmap.end(); ++it) {
for (int i = 0; i < it->second; i++) {
components.push_back(it->first);
}
}
} else {
components.push_back(ppart.apgcode());
}
......@@ -385,7 +392,7 @@ namespace apg {
lrem -= cluster;
if (rigorous) {
pattern ppart(lab, lab->demorton(cluster, 1), rule);
pseudoBangBang(ppart, &clusters);
pseudoBangBang(ppart, &clusters, false);
} else {
clusters.push_back(cluster);
}
......@@ -437,7 +444,7 @@ namespace apg {
// back on pbb if this fails:
elements = sss(cl2);
}
if (elements.size() == 0) { elements = pseudoBangBang(cl2, 0); }
if (elements.size() == 0) { elements = pseudoBangBang(cl2, 0, recurse); }
} else if (recurse && (!b0)) {
// We may have a constellation since we've bypassed PseudoBangBang.
// This tends to be problematic in B0 and Generations rules with
......
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