diff --git a/devmods/honeycomb-generator.cpp b/devmods/honeycomb-rule-generator.cpp similarity index 87% rename from devmods/honeycomb-generator.cpp rename to devmods/honeycomb-rule-generator.cpp index 2666e390..e95da3ed 100644 --- a/devmods/honeycomb-generator.cpp +++ b/devmods/honeycomb-rule-generator.cpp @@ -4,12 +4,14 @@ Honeycomb data generator. Usage: -./hyper -geo 534h -tcano honeycomb-534.dat -quit -./hyper -geo 535h -tcano honeycomb-535.dat -quit -./hyper -geo 435h -tcano honeycomb-435.dat -quit +./hyper -geo 534h -gen-rule honeycomb-rules-534.dat -quit +./hyper -geo 535h -gen-rule honeycomb-rules-535.dat -quit +./hyper -geo 435h -gen-rule honeycomb-rules-435.dat -quit You need to change the value of XS7 to 6 (for 435) or 12 (for others) +You also need to select 'fp used for rules' + */ #include "zlib.h" @@ -145,9 +147,27 @@ void add_candidate(cell *c) { void test_canonical(string fname) { if(S7 != XS7) { println(hlog, "fix XS7=", S7); exit(4); } + stop_game(); + reg3::reg3_rule_available = false; start_game(); - cell *c0 = cwt.at; - add_candidate(c0); + + int qc = reg3::quotient_count(); + + vector c0; + + if(geometry == gSpace535) { + c0.resize(qc, cwt.at); + } + else { + for(int fv=0; fvmaster->fieldval != fv; i++) c = c->cmove(hrand(S7)); + c->FV = 0; + c0.push_back(c); + } + } + + for(cell* c: c0) add_candidate(c); array empty; for(auto& e: empty) e = -1; @@ -186,8 +206,6 @@ void test_canonical(string fname) { } } - int root = 0; - if(true) { println(hlog, "original rules: ", child_rules); @@ -230,8 +248,6 @@ void test_canonical(string fname) { number_states = lqids; for(auto& p: id_of) p.second = ih[p.second]; println(hlog, "rehashed"); - println(hlog, "origin = ", ih[0]); - root = ih[0]; fflush(stdout); } @@ -334,6 +350,10 @@ void test_canonical(string fname) { auto& fp = currfp; hwrite_fpattern(ss, fp); + vector root(qc, 0); + for(int i=0; i root; string other; vector children; @@ -916,8 +916,9 @@ EX namespace reg3 { void find_mappings() { auto &nles = nonlooping_earlier_states; nles.clear(); - address init = {0, root}; - vector
bfs = {init}; + vector
bfs; + for(int i=0; iallh); i++) + bfs.emplace_back(i, root[i]); auto mov = [&] (int fv, int d) { return quotient_map->allh[fv]->move(d)->fieldval; }; @@ -943,7 +944,9 @@ EX namespace reg3 { for(auto p: q) q2[p]++; DEBB(DF_GEOM, ("q2 = ", q2)); - bfs = {init}; + bfs = {}; + for(int i=0; iallh); i++) + bfs.emplace_back(i, root[i]); for(int i=0; i (S7); @@ -981,7 +984,7 @@ EX namespace reg3 { h.distance = 0; h.zebraval = 0; h.fieldval = 0; - h.fiftyval = root; + h.fiftyval = root[0]; h.c7 = NULL; h.c7 = newCell(S7, origin); @@ -1168,7 +1171,7 @@ EX hrmap* new_map() { if(geometry == gSeifertWeber) return new seifert_weber::hrmap_singlecell(108*degree); if(geometry == gHomologySphere) return new seifert_weber::hrmap_singlecell(36*degree); if(quotient && !sphere) return new hrmap_field3(&currfp); - if(among(geometry, gSpace534, gSpace435, gSpace535)) return new hrmap_reg3_rule; + if(in_rule()) return new hrmap_reg3_rule; return new hrmap_reg3; } @@ -1176,6 +1179,10 @@ hrmap_reg3* regmap() { return ((hrmap_reg3*) currentmap); } +EX int quotient_count() { + return isize(regmap()->quotient_map->allh); + } + EX int celldistance(cell *c1, cell *c2) { if(c1 == c2) return 0; if(c1 == currentmap->gamestart()) return c2->master->distance;