new system for honeycombs in action
This commit is contained in:
parent
31b2bd9690
commit
841108726c
10
bigstuff.cpp
10
bigstuff.cpp
|
@ -153,7 +153,7 @@ EX int default_levs() {
|
|||
if(S3 >= OINF)
|
||||
return 1;
|
||||
#if MAXMDIM >= 4
|
||||
if(reg3::in_rule()) return 0;
|
||||
if(reg3::in_hrmap_rule_or_subrule()) return 0;
|
||||
#endif
|
||||
return S3-3;
|
||||
}
|
||||
|
@ -240,7 +240,7 @@ EX heptagon *create_altmap(cell *c, int rad, hstate firststate, int special IS(0
|
|||
int gdir = -1;
|
||||
for(int i=0; i<c->type; i++) {
|
||||
#if MAXMDIM >= 4
|
||||
if(!reg3::in_rule()) {
|
||||
if(!reg3::in_hrmap_rule_or_subrule()) {
|
||||
#else
|
||||
if(true) {
|
||||
#endif
|
||||
|
@ -252,7 +252,7 @@ EX heptagon *create_altmap(cell *c, int rad, hstate firststate, int special IS(0
|
|||
}
|
||||
}
|
||||
#if MAXMDIM >= 4
|
||||
if(reg3::in_rule() && c->master->distance == 0) gdir = 0;
|
||||
if(reg3::in_hrmap_rule_or_subrule() && c->master->distance == 0) gdir = 0;
|
||||
#endif
|
||||
if(gdir < 0) return NULL;
|
||||
|
||||
|
@ -1670,7 +1670,7 @@ EX void build_horocycles(cell *c, cell *from) {
|
|||
|
||||
if(ls::any_order() && bearsCamelot(c->land) && can_start_horo(c) && !bt::in() &&
|
||||
#if MAXMDIM >= 4
|
||||
!(hyperbolic && WDIM == 3 && !reg3::in_rule()) &&
|
||||
!(hyperbolic && WDIM == 3 && !reg3::in_hrmap_rule_or_subrule()) &&
|
||||
#endif
|
||||
(quickfind(laCamelot) || peace::on || (hrand(I2000) < (c->land == laCrossroads4 || ls::no_walls() ? 800 : 200) && horo_ok() &&
|
||||
items[itEmerald] >= U5)))
|
||||
|
@ -1860,7 +1860,7 @@ EX void buildCamelot(cell *c) {
|
|||
EX int masterAlt(cell *c) {
|
||||
if(eubinary) return celldistAlt(c);
|
||||
#if MAXMDIM >= 4
|
||||
if(WDIM == 3 && hyperbolic && !reg3::in_rule()) return reg3::altdist(c->master);
|
||||
if(WDIM == 3 && hyperbolic && !reg3::in_hrmap_rule_or_subrule()) return reg3::altdist(c->master);
|
||||
#endif
|
||||
return c->master->alt->distance;
|
||||
}
|
||||
|
|
8
cell.cpp
8
cell.cpp
|
@ -232,7 +232,7 @@ EX vector<hrmap*> allmaps;
|
|||
|
||||
EX hrmap *newAltMap(heptagon *o) {
|
||||
#if MAXMDIM >= 4
|
||||
if(reg3::in_rule())
|
||||
if(reg3::in_hrmap_rule_or_subrule())
|
||||
return reg3::new_alt_map(o);
|
||||
#endif
|
||||
if(currentmap->strict_tree_rules())
|
||||
|
@ -638,7 +638,7 @@ EX int celldistAlt(cell *c) {
|
|||
}
|
||||
#if MAXMDIM >= 4
|
||||
if(euc::in()) return euc::dist_alt(c);
|
||||
if(hyperbolic && WDIM == 3 && !reg3::in_rule())
|
||||
if(hyperbolic && WDIM == 3 && !reg3::in_hrmap_rule_or_subrule())
|
||||
return reg3::altdist(c->master);
|
||||
#endif
|
||||
if(!c->master->alt) return 0;
|
||||
|
@ -676,7 +676,7 @@ EX int updir(heptagon *h) {
|
|||
if(bt::in()) return bt::updir();
|
||||
#endif
|
||||
#if MAXMDIM >= 4
|
||||
if(WDIM == 3 && reg3::in_rule()) {
|
||||
if(WDIM == 3 && reg3::in_hrmap_rule_or_subrule()) {
|
||||
for(int i=0; i<h->type; i++) if(h->move(i) && h->move(i)->distance < h->distance)
|
||||
return i;
|
||||
return -1;
|
||||
|
@ -690,7 +690,7 @@ EX int updir(heptagon *h) {
|
|||
EX int updir_alt(heptagon *h) {
|
||||
if(euclid || !h->alt) return -1;
|
||||
#if MAXMDIM >= 4
|
||||
if(WDIM == 3 && reg3::in_rule()) {
|
||||
if(WDIM == 3 && reg3::in_hrmap_rule_or_subrule()) {
|
||||
for(int i=0; i<S7; i++) if(h->move(i) && h->move(i)->alt && h->move(i)->alt->distance < h->alt->distance)
|
||||
return i;
|
||||
return -1;
|
||||
|
|
|
@ -113,7 +113,7 @@ void expansion_analyzer::preliminary_grouping() {
|
|||
for(int v: rulegen::treestates[i].rules)
|
||||
if(v >= 0) children[i].push_back(v);
|
||||
}
|
||||
else if(reg3::in_rule()) {
|
||||
else if(reg3::exact_rules()) {
|
||||
#if MAXMDIM >= 4
|
||||
rootid = reg3::rule_get_root(0);
|
||||
auto& chi = reg3::rule_get_children();
|
||||
|
@ -145,7 +145,7 @@ void expansion_analyzer::preliminary_grouping() {
|
|||
}
|
||||
|
||||
void expansion_analyzer::reduce_grouping() {
|
||||
if(reg3::in_rule()) return;
|
||||
if(reg3::exact_rules()) return;
|
||||
if(currentmap->strict_tree_rules()) return;
|
||||
int old_N = N;
|
||||
vector<int> grouping;
|
||||
|
@ -239,7 +239,7 @@ bool expansion_analyzer::verify(int id) {
|
|||
|
||||
int expansion_analyzer::valid(int v, int step) {
|
||||
if(step < 0) return 0;
|
||||
int more = reg3::in_rule() ? 1 : 5;
|
||||
int more = reg3::exact_rules() ? 1 : 5;
|
||||
#if CAP_GMP == 0
|
||||
if(get_descendants(step+v+v+more).approx_int() >= bignum::BASE) return 0;
|
||||
typedef ld val;
|
||||
|
@ -392,7 +392,7 @@ int type_in_quick(expansion_analyzer& ea, cell *c, const cellfunction& f) {
|
|||
}
|
||||
|
||||
EX bool sizes_known() {
|
||||
if(reg3::in_rule()) return true;
|
||||
if(reg3::exact_rules()) return true;
|
||||
if(closed_manifold) return false;
|
||||
// Castle Anthrax is infinite
|
||||
if(bt::in()) return false;
|
||||
|
@ -583,7 +583,7 @@ void celldrawer::do_viewdist() {
|
|||
}
|
||||
case ncType: {
|
||||
int t = -1;
|
||||
if(reg3::in_rule()) switch(distance_from) {
|
||||
if(reg3::exact_rules()) switch(distance_from) {
|
||||
case dfPlayer:
|
||||
t = -1;
|
||||
break;
|
||||
|
@ -740,7 +740,7 @@ void expansion_analyzer::view_distances_dialog() {
|
|||
|
||||
if(really_use_analyzer) {
|
||||
int t;
|
||||
if(reg3::in_rule() || currentmap->strict_tree_rules()) {
|
||||
if(reg3::exact_rules() || currentmap->strict_tree_rules()) {
|
||||
if(!N) preliminary_grouping();
|
||||
t = rootid;
|
||||
}
|
||||
|
|
|
@ -1129,7 +1129,7 @@ EX void showEuclideanMenu() {
|
|||
|
||||
dialog::addSelItem(XLAT("size of the world"), gd.size_str, '3');
|
||||
|
||||
if(WDIM == 2 || reg3::in_rule()) dialog::add_action([] {
|
||||
if(WDIM == 2 || reg3::exact_rules()) dialog::add_action([] {
|
||||
if(!viewdists) { enable_viewdists(); pushScreen(viewdist_configure_dialog); }
|
||||
else if(viewdists) viewdists = false;
|
||||
});
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
xзМ■Иmц0┘╘:n▌╕q t.А╚М:|▄жя╡┘C┼┼" :@M─фШ(И▐s░R║╧V┴V│сл*яэY2┤dгёRxоv(x^*|>aИ╔≈Ч╞ЩK=┘zВЙ4Цs$Ф▐└└оp┌rw╟├ш\xг└В4/С_j 8/Ш┘7p┬°ШyXя|ВШ1©▒>D~УСcЮлГвЯ╝≥оoФЭ6АЖРrч'yyЁДЪ~иъчоЫK┴зhтNci5╨ч║┼[▓╚и╣╫E;Xrк░eв▄м`П╬│щ*ЗVQ╠W▒╙Ц╝К╗ь╚I5ЯЭ⌡╗ьkH╣ьУv#Уп╣3БY;#·╣D_Ь█?xhLХН
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,3 +0,0 @@
|
|||
xΪ<EFBFBD>•ωRΤ@Ζ›K`ρDΕ[ΔµEEAE±*{°ψI6wΟGσ<47>µ{<7B>LΟ&T±UI6Ώώ<CE8F>έσMgwόΟΒ%ΎCΗ3Λt,™ƒ?+ζΊf®‹†^π|Wώή%Ω‚Ι<E2809A>έ<1C>θf&>ίΰ+Βk<CE92>2?4dζωΌ›SKή¥·ω7`,ΧΧ]`½δΊ®ζWα…§GΨ…»s\χoωNKΏ5Η<0F>~‹Όaς~Συ³βZ#Ή\οΆ:o«σ<C2AB>πGrιΫ’α<E28099>ηΰώ±α³™δ²Ι¥ΟΛp<13>ƒ®ϋ¥ΙβsYwn5ό‡π_rι?(®uR/ΉάΗσύ>μΓϊΞ>σ½δrήΦa@[oω=βoΝ>ςy•ψK“λ}³Ώ·Ar9'λ†ΛΊ’s~™ηJ³οϋ ύ—\Ξ³ζO¥ϊ—zΝεΊzp<7A>®Οηϋ=£—\ζΡ|Ϋθ?Α^—}φΰΨ9a½<61>ΙεΌυΰ†Ϊχ¶ήq9?–Ο½ύ’Λ9μ‘Οα1ό4λuzΗεώjήε<CEAE>γΎ<CEB3>›Tχόjυγψ‡f>ο€ε]ύXξζΑκ»όw\ώ<>X~άΩ<CEAC>ζς=ZSΌύ~I.ϋ—\φ)Ήχ»χ—ώy<02>£ƒ΄Β 1<><31>WO0<>b<EFBFBD>ΒC (’NsLσ£43
|
||||
~Φ*ΆJGΊ<47>·QW3lΥd<12>ZI‘`’'<27>^ΠΩE Ίf}2<>}ΰΕετ5²vϋΤ'χW•φ©Η*µkκ«υ¤ρϋDΛ"Γ~Y©¨‘.ιHΤ<48>WuθQWΥFό^"ΡΧ9Α"¥3U:΅JeTΚω|buά‘&¶Ώ$<24>q„#ς…5#γµ£rxΟ8¨¬Λλ0Ζ9β(ϋ3lbΓΌ »a]`>%‰kµαΜ<CEB1>ΨZCρ<43>ΞΞ>ΒTω IάTζz6>π¨ν<C2A8>έ7ΊqMG)jΩ9<CEA9>Sf³<C2AD>Κ·we–“†ηµ§γσ3<#ί™ϊΪ<CF8A>΄Υu:ή<>"<22>’†½¥§γσS<Ν
|
||||
¥γΈL•+™Ρρ:&<26>Ώ“¬4λ”qλΔS‹spl®Φ'”§ Zν:YSgάzΞu<CE9E>uvΟυ<%bΚ|:Ά<>ο¦<<0F>Ψ ω23WΚ
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,2 @@
|
|||
xз∙∙=t
A├©╫!"!┌$"n┬ ┤ёп┬÷ёJ╔Rы≥²╜T*∙J╔R╔R╘hT*∙J╔R╘T*∙JЕ°xФчмэoЪНIЖ°gФЩч}Г⌡ы{▀≥Ш ╡ "┴└!I:L²╒ч╝<╫▄РeHN©╞ФvzЛ╪╚>:╚В╛ЖуЩ╙К7Юv╒о7пШHТуs╖пгe©▄длhT'Е─ЙрФ▐)=У╛▄zN∙~╜╫²g╪q/щSОuZ╔■>я╒Г∙>╣_Вт{-*}FИ╝рK-╨ш╡╤ъsE9╒·░▀┘>б|╘пGЕ╟Л5©*W╘нЖ°кr█ЫL╤ЗFжd]√e Й┼\G÷≈c2%ш[#"н╔yn°Ё▄В▄кп>т5╥Лт2√й⌡
folT%/т6У╔fе-;X█и│÷вэ╕$)▌бwь╢Т∙U/т6~_╛hze.U╩╤{╝╘╨kR e▄ЮщБыба
|
||||
c·∙э░ёaТь`╗;ХиРф╝зО╖╠о0П}мmЙ^⌠вЭ╤NЕЁ{gwЕ╧aNф²2:фШ&СХ<mrкN=cяЛ^ЙRУBМБЗXy2ж<0>╥М╒сSммБ┼┘ ≤├YX└eX┘5╦w`а&<├'ПrxоА╪└WПчю╪┘wП>б'Ь_Ю+|┐ОП~б/Ь
Ю/ЭW1ввLблCVююzр©БЧ÷⌠Tq
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,5 @@
|
|||
xÚÕÙ\œuÇñß³ÝÛ˜âDeŠÊõTTÔÛÄ<C39B>m·‰*&M2*þ<)&64J*J,R,*TTJ,*4T4T**ZT”L±°H±¨¨¨ÈШP©õ¹ßóå<C3B3>ËÛ^ë¹×›Ïóû=Ï=ÏwÇÝv+ï3f•1fÉb3µ8Ž³ÌL_œy¬›®ãÃB -‹Ôu<>æÏrý™Ž¿tžsŽŽ +#ƒíŠÂr€ãõ$õdõÕ¯žªž¦ž®¦ªg8»¢¸Äë¾®®R<C2AE>U<EFBFBD>WOPUSËÕ¨ToP?¤®T?ª~Lý”úiµVÍRQ׫Ô<>jP½@Ý¢^¤nR7«™ê…êÖˆó£žæ©oSWDüŽTÕ£Ô£ÕÓÕTõõ-êê[Õ·«ïPó#nW’z¦z–š6Çí>qŽÇù85YMQOROVOQýê©ÇŸ|^T¨Žxü+ÕÕ*õ&µZý¤z³z‹úõ³êçÔ:õ6õvõ#j‚9Âñz¤š¨¥mûN§l{¥9Ôö³P=L=\MPWÚ^cþiÏxú>óªm1C½Ú,°}—z<E28094>únõZµØ,U—©±êrõ@õ g…zˆo»]óÛ5¿]óWÙûµD¿<44>¥ê úõ·êrõ@5N=X}IuÔ/ª_R›ÔÉ¿¤w«
êçÕ/¨÷D¯Q½7âx_Q[Õ‡ÕgÕûÔûÕ¯©Ô…êbõËêCjÄy¾:Ëù~qÞçÔu™«þZý<5A>:¤þ^Vÿ¤Ž¨U_PRÿ®Ž©ßQW}ê7Õo©ê·#®÷]u]äx]¥«§&«Ç«'Ð'è¿Ð:~„ÅÌw«?QŸPLÏTÏRÓèNÍïÔüNÍ@OTSèÏèÙ´Om3§Ù{ðs³Î¶Å\bû€ú Únαý†)PÕ"Û_˜‹m›M†í×uÜÉã?¦>jru¾óÕµÓÎÿˆ¹œžçxÍp¾gt£T7;<3B>&ÝÎ{
ª›µ}«Æ[<5B>Úo‡öÛ¡ývh{—9—nr~îytƒºIÛ·hûÆkè…ÎÍjš©ý¶8ß7.½@ÍrÌ¥ô\5 ®qž7ÙvÞk@]£íë4^Çø2ºš¾ÙöyÛsÔÕÚ¾VÛ×j~ó+ó&z>Í¡éÌoÓù¶é|Ût;¶Ùó<e>nÆY{:ÜO˜—éSæVóŠO¶ÞöISÿÐöÉÞjÛî¶?5wšúSb&L¨×Ùþ‘þ›þÅ”šÿØ^g;ªþÙ¼ÇøœPßkÚÏk™íßÔÍõæúŒ¹Ë,q.rþaÞo’œõήË<>)œ\üü……E\
|
||||
ý….fšgCÄ–¢ÂÙ·Í2?Û¬;Ï=gžw£<~ýÞÀÌzA—‚"¯þ-ám¡iÿ[&<>Ýiò¸³ïå-Þã5×^ì¶Ûóìæö¼þ¶º¬y?CÇu¦æBûzc{OC×dÃÞ‡oõ>»QyÏ<79>"×^^33uŸ÷ÖÈ<C396>òzä½ØóñÔíÛ?ÖÝ}¸¶7ŸÑ¤÷·ßÞž®…_ÑÿcÝýûçôw÷(ŒìûZÆÓ>AÌkzÿ×ëâ53n”Ö§Ÿgw#7ü)eúÙó±»Ûµ©³¾±u÷ÿzm®{5÷³bþ<62>ìÌ<C3AC>óÌëûþgø•Q¶nô{o.Ÿ&µÎtxÝÝ×öÞ%¸‡—Kõÿü>}5‹8Ä#‰HB2RàG*Ò@:2D&²<><C2B2>ä"ùpQŒ”¢å¨@%ªP
þñhjQ‡z4 MhFZцvt ]èFzч~`CÆF1†qLèû
|
||||
b‹8Ä#‰HB2RàG*Ò@zèë
‘‰,d#¹ÈC>\£¥(C9*P‰*T£µ¨C=Ј&4£hC;:Љ.t£½èC?0ˆ!c£Ã8&ô]<5D>1ˆEâ‘€D$!)ð#i "YÈFr‘‡|¸(F JQ†rT U¨F
jQ‡z4 MhFZцvt ]èFzч~`CÆF1†qL,ð¾#ó!±ˆC<<12>ˆ$$#~¤"
¤#Ad"ÙÈA.ò<>Å(A)ÊPŽ
|
||||
T¢
|
||||
Õ¨A-êP<C3AA>4¢ ÍhA+ÚÐŽt¢ÝèA/úÐ<C3BA>bÃÁ(Æ0Ž‰…ދ߇Ä"ñH@"’<>Œø‘Š4<04>Ž‘‰,d#¹ÈC>\£¥(C9*P‰*T£µ¨C=Ј&4£hC;:Љ.t£½èC?0ˆ!c£Ã8&|Þ÷ >Ä qˆG‘„d¤À<C2A4>T¤!€ôEÞ×›ÿyú€
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -192,7 +192,7 @@ EX bool is_zebra_trapdoor(cell *c) {
|
|||
else if(arb::in() && arb::current.have_line)
|
||||
return arb::linespattern(c);
|
||||
#if MAXMDIM >= 4
|
||||
else if(reg3::in_rule()) switch(geometry) {
|
||||
else if(PURE && reg3::exact_rules()) switch(geometry) {
|
||||
case gSpace534: {
|
||||
if(c->master->fieldval == 0) return true;
|
||||
forCellCM(c1, c) if(c1->master->fieldval == 0) return true;
|
||||
|
|
103
reg3.cpp
103
reg3.cpp
|
@ -1304,18 +1304,11 @@ EX namespace reg3 {
|
|||
}
|
||||
|
||||
EX bool minimize_quotient_maps = false;
|
||||
EX bool subrule = false;
|
||||
|
||||
EX bool strafe_test = false;
|
||||
|
||||
hrmap_quotient3 *gen_quotient_map(bool minimized, fieldpattern::fpattern &fp) {
|
||||
#if CAP_FIELD
|
||||
#if CAP_CRYSTAL
|
||||
if(geometry == gSpace344) {
|
||||
return new hrmap_from_crystal(minimized ? 1 : 2);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if(geometry == gSpace535 && minimized) {
|
||||
return new seifert_weber::hrmap_singlecell(108*degree);
|
||||
}
|
||||
|
@ -1454,6 +1447,7 @@ EX namespace reg3 {
|
|||
}
|
||||
|
||||
hrmap_h3() {
|
||||
println(hlog, "generating hrmap_h3");
|
||||
origin = init_heptagon(S7);
|
||||
heptagon& h = *origin;
|
||||
h.s = hsOrigin;
|
||||
|
@ -1856,22 +1850,6 @@ EX namespace reg3 {
|
|||
|
||||
ruleset() : fp(0) {}
|
||||
|
||||
void load_ruleset(string fname) {
|
||||
|
||||
shstream ins(decompress_string(read_file_as_string(fname)));
|
||||
dynamicval<bool> q(fieldpattern::use_quotient_fp, true);
|
||||
hread_fpattern(ins, fp);
|
||||
|
||||
hread(ins, root);
|
||||
hread(ins, children);
|
||||
hread(ins, other);
|
||||
// hread(ins, childpos);
|
||||
|
||||
int t = S7;
|
||||
int qty = isize(children) / t;
|
||||
for(int i=0; i<=qty; i++) childpos.push_back(i * t);
|
||||
}
|
||||
|
||||
void load_ruleset_new(string fname) {
|
||||
|
||||
shstream ins(decompress_string(read_file_as_string(fname)));
|
||||
|
@ -1887,6 +1865,8 @@ EX namespace reg3 {
|
|||
hread(ins, children);
|
||||
hread(ins, other);
|
||||
hread(ins, childpos);
|
||||
|
||||
println(hlog, "roots = ", isize(root), " states = ", isize(childpos)-1, " hashv = ", fp.hashv);
|
||||
}
|
||||
|
||||
/** \brief address = (fieldvalue, state) */
|
||||
|
@ -2045,8 +2025,10 @@ EX namespace reg3 {
|
|||
|
||||
hrmap_h3_rule() {
|
||||
|
||||
load_ruleset(get_rule_filename());
|
||||
quotient_map = gen_quotient_map(is_minimized(), fp);
|
||||
println(hlog, "generating hrmap_h3_rule");
|
||||
|
||||
load_ruleset_new(get_rule_filename(false));
|
||||
quotient_map = gen_quotient_map(minimize_quotient_maps, fp);
|
||||
find_mappings();
|
||||
|
||||
origin = init_heptagon(S7);
|
||||
|
@ -2263,7 +2245,7 @@ EX namespace reg3 {
|
|||
|
||||
println(hlog, "loading a subrule ruleset");
|
||||
|
||||
load_ruleset_new(get_rule_filename());
|
||||
load_ruleset_new(get_rule_filename(true));
|
||||
quotient_map = gen_quotient_map(minimize_quotient_maps, fp);
|
||||
int t = quotient_map->acells[0]->type;
|
||||
find_mappings();
|
||||
|
@ -2422,39 +2404,43 @@ EX hrmap *new_alt_map(heptagon *o) {
|
|||
return new hrmap_h3_rule_alt(o);
|
||||
}
|
||||
|
||||
EX bool reg3_rule_available = true;
|
||||
EX string other_rule = "";
|
||||
/** 1 -- consider pure rules, 2 -- consider variation rules, 3 -- consider both */
|
||||
EX int consider_rules = 3;
|
||||
|
||||
EX bool is_minimized() {
|
||||
return geometry != gSpace535 && geometry != gSpace344;
|
||||
}
|
||||
EX string replace_rule_file;
|
||||
|
||||
EX string get_rule_filename() {
|
||||
if(other_rule != "") return other_rule;
|
||||
switch(geometry) {
|
||||
case gSpace336: return "honeycomb-rules-336.dat";
|
||||
case gSpace344: return "honeycomb-rules-344.dat";
|
||||
case gSpace345: return "honeycomb-rules-345.dat";
|
||||
case gSpace353: return "honeycomb-rules-353.dat";
|
||||
case gSpace354: return "honeycomb-rules-354.dat";
|
||||
case gSpace355: return "honeycomb-rules-355.dat";
|
||||
case gSpace435: return "honeycomb-rules-435.dat";
|
||||
case gSpace436: return "honeycomb-rules-436.dat";
|
||||
case gSpace534: return "honeycomb-rules-534.dat";
|
||||
case gSpace535: return "honeycomb-rules-535.dat";
|
||||
case gSpace536: return "honeycomb-rules-536.dat";
|
||||
|
||||
default: return "";
|
||||
EX string get_rule_filename(bool with_variations) {
|
||||
if(replace_rule_file != "") return replace_rule_file;
|
||||
string s;
|
||||
s += "honeycombs/";
|
||||
s += ginf[geometry].tiling_name[1];
|
||||
s += ginf[geometry].tiling_name[3];
|
||||
s += ginf[geometry].tiling_name[5];
|
||||
if(hyperbolic) s += "h";
|
||||
else s += "c";
|
||||
if(with_variations) {
|
||||
if(variation == eVariation::coxeter) s += "-c" + its(coxeter_param);
|
||||
if(variation == eVariation::subcubes) s += "-s" + its(subcube_count);
|
||||
if(variation == eVariation::dual_subcubes) s += "-d" + its(subcube_count);
|
||||
if(variation == eVariation::bch) s += "-bs" + its(subcube_count);
|
||||
}
|
||||
s += ".dat";
|
||||
return find_file(s);
|
||||
}
|
||||
|
||||
EX bool in_rule() {
|
||||
return reg3_rule_available && get_rule_filename() != "";
|
||||
EX bool variation_rule_available() {
|
||||
return (consider_rules & 2) && file_exists(get_rule_filename(true));
|
||||
}
|
||||
|
||||
EX bool pure_rule_available() {
|
||||
return (consider_rules & 1) && file_exists(get_rule_filename(false));
|
||||
}
|
||||
|
||||
ruleset& get_ruleset() {
|
||||
if(subrule) return *((hrmap_h3_subrule*)currentmap);
|
||||
if(in_rule()) return *((hrmap_h3_rule*)currentmap);
|
||||
auto h1 = dynamic_cast<hrmap_h3_subrule*> (currentmap);
|
||||
if(h1) return *h1;
|
||||
auto h2 = dynamic_cast<hrmap_h3_rule*> (currentmap);
|
||||
if(h2) return *h2;
|
||||
throw hr_exception("get_ruleset called but not in rule");
|
||||
}
|
||||
|
||||
|
@ -2475,8 +2461,8 @@ 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(subrule) return new hrmap_h3_subrule;
|
||||
if(in_rule()) return new hrmap_h3_rule;
|
||||
if(variation_rule_available()) return new hrmap_h3_subrule;
|
||||
if(pure_rule_available()) return new hrmap_h3_rule;
|
||||
if(sphere) return new hrmap_sphere3;
|
||||
return new hrmap_h3;
|
||||
}
|
||||
|
@ -2489,6 +2475,15 @@ EX bool in_hrmap_h3() {
|
|||
return dynamic_cast<hrmap_h3*> (currentmap);
|
||||
}
|
||||
|
||||
EX bool in_hrmap_rule_or_subrule() {
|
||||
return dynamic_cast<hrmap_h3_rule*> (currentmap) || dynamic_cast<hrmap_h3_subrule*> (currentmap);
|
||||
}
|
||||
|
||||
EX bool exact_rules() {
|
||||
if(PURE) return in_hrmap_rule_or_subrule();
|
||||
return dynamic_cast<hrmap_h3_subrule*> (currentmap);
|
||||
}
|
||||
|
||||
EX int quotient_count() {
|
||||
return isize(hypmap()->quotient_map->allh);
|
||||
}
|
||||
|
@ -2553,7 +2548,7 @@ EX int celldistance(cell *c1, cell *c2) {
|
|||
int b = bucketer(h);
|
||||
if(cgi.close_distances.count(b)) return cgi.close_distances[b];
|
||||
|
||||
if(in_rule())
|
||||
if(in_hrmap_rule_or_subrule())
|
||||
return clueless_celldistance(c1, c2);
|
||||
|
||||
dynamicval<eGeometry> g(geometry, gBinary3);
|
||||
|
|
|
@ -2098,11 +2098,9 @@ EX void generate_rules() {
|
|||
start_time = SDL_GetTicks();
|
||||
delete_tmap();
|
||||
|
||||
if(WDIM == 3) {
|
||||
if(WDIM == 3 && reg3::in_hrmap_rule_or_subrule()) {
|
||||
stop_game();
|
||||
reg3::reg3_rule_available = false;
|
||||
fieldpattern::use_rule_fp = true;
|
||||
fieldpattern::use_quotient_fp = true;
|
||||
reg3::consider_rules = 0;
|
||||
flags |= w_numerical;
|
||||
start_game();
|
||||
}
|
||||
|
|
11
rulegen3.cpp
11
rulegen3.cpp
|
@ -1716,19 +1716,20 @@ int readRuleArgs3() {
|
|||
// -urq 7 to prepare honeycomb generation
|
||||
stop_game();
|
||||
shift(); int i = argi();
|
||||
reg3::reg3_rule_available = (i & 8) ? 0 : 1;
|
||||
reg3::consider_rules = i >> 3;
|
||||
fieldpattern::use_rule_fp = (i & 1) ? 1 : 0;
|
||||
fieldpattern::use_quotient_fp = (i & 2) ? 1 : 0;
|
||||
reg3::minimize_quotient_maps = (i & 4) ? 1 : 0;
|
||||
}
|
||||
|
||||
else if(argis("-subrule")) {
|
||||
else if(argis("-load-honeycomb")) {
|
||||
stop_game();
|
||||
shift(); reg3::other_rule = args();
|
||||
shstream ins(decompress_string(read_file_as_string(arg::args())));
|
||||
string s = args();
|
||||
shift(); reg3::replace_rule_file = s;
|
||||
shstream ins(decompress_string(read_file_as_string(s)));
|
||||
ins.read(ins.vernum);
|
||||
mapstream::load_geometry(ins);
|
||||
reg3::subrule = true;
|
||||
reg3::consider_rules = 2;
|
||||
}
|
||||
|
||||
else if(argis("-less-states")) {
|
||||
|
|
Loading…
Reference in New Issue