From ec3bb7a5df6c35958bfd4003a08f0f33cc25dc4f Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Fri, 26 Aug 2022 12:42:55 +0200 Subject: [PATCH] rulegen-tests:: show seq-stats for 3D --- devmods/rulegen-tests.cpp | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/devmods/rulegen-tests.cpp b/devmods/rulegen-tests.cpp index 25935b92..b138c149 100644 --- a/devmods/rulegen-tests.cpp +++ b/devmods/rulegen-tests.cpp @@ -505,12 +505,37 @@ void list_all_sequences(string tesname) { seq_stream->flush(); } -void view_actual_seq(int max) { +vector gen_actual_seq(int max) { celllister cl(cwt.at, 1000, max, nullptr); vector dlist(1000, 0); for(auto d: cl.dists) dlist[d]++; while(dlist.back() == 0) dlist.pop_back(); - println(hlog, "obtained dlist = ", dlist); + return dlist; + } + +string unspace(const string& s) { + string res; + for(char c: s) if(c != ' ') res += c; + return res; + } + +vector seq_as_stringlist() { + auto& e = cgi.expansion; + vector res; + for(int i=0; i<100; i++) res.push_back(unspace(e->get_descendants(i).get_str(1000))); + return res; + } + +void view_seq_stats() { + start_game(); + println(hlog, "SEQ rules ", seq_as_stringlist()); + println(hlog, "SEQ verify ", gen_actual_seq(100000)); + if(true) { + stop_game(); + reg3::consider_rules = 0; + start_game(); + println(hlog, "SEQ stupid ", gen_actual_seq(euclid ? 1000 : 100000)); + } } void print_rules(); @@ -1731,7 +1756,13 @@ int testargs() { else if(argis("-act-seq")) { start_game(); - shift(); view_actual_seq(argi()); + shift(); + println(hlog, "obtained dlist = ", gen_actual_seq(argi())); + } + + else if(argis("-seq-stats")) { + start_game(); + view_seq_stats(); } else if(argis("-dseek")) {