From 9c2d0dec05762e8ba78497055f4caf501a8eaa35 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Mon, 1 Nov 2021 17:26:28 +0100 Subject: [PATCH] devmods/rulegen-tests:: some extra stats --- devmods/rulegen-tests.cpp | 51 ++++++++++++++++++++++++++++++++++----- 1 file changed, 45 insertions(+), 6 deletions(-) diff --git a/devmods/rulegen-tests.cpp b/devmods/rulegen-tests.cpp index cc99eec3..71b8f763 100644 --- a/devmods/rulegen-tests.cpp +++ b/devmods/rulegen-tests.cpp @@ -517,6 +517,18 @@ int shape_edges() { return res; } +int max_edge() { + int res = 0; + for(auto& sh: arb::current.shapes) res = max(res, sh.size()); + return res; + } + +int max_valence() { + int res = 0; + for(auto& sh: arb::current.shapes) for(auto& va: sh.vertex_valence) res = max(res, va); + return res; + } + void test_current(string tesname) { disable_bigstuff = true; @@ -664,12 +676,36 @@ void test_current(string tesname) { vector areas; for(auto& sh: arb::current.shapes) { - ld s = 0; int i = 0; - for(auto a: sh.angles) { while(a > 2 * M_PI) a -= 2 * M_PI; while(a<0) a += 2 * M_PI; s += a; i++; } - areas.push_back((i-2) * M_PI - s); + if(hyperbolic) { + ld s = 0; int i = 0; + for(auto a: sh.angles) { while(a > 2 * M_PI) a -= 2 * M_PI; while(a<0) a += 2 * M_PI; s += a; i++; } + areas.push_back((i-2) * M_PI - s); + } + else { + ld s = 0; + for(int i=0; i edgelens; + for(auto& sh: arb::current.shapes) { + for(int i=0; i