From 0686c534cf37692d786c2914f9d1d95fbe8944e0 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Fri, 17 Nov 2023 18:54:51 +0100 Subject: [PATCH] Chain-Load: verify topology building -- and fix a Bug ...start with putting the topology generator to work - turns out it is still challenging to write the ctrl-rules - and one example tree looked odd in the visualisation - which (on investigation) indicated unsound behaviour ...this is basically harmless, but involves an integer wrap-around in a variable not used under this conditions (toReduce), but also a rather accidental and no very logical round-up of the topology. With this fix, the code branch here is no longer overloaded with two distinct concerns, which I consider an improvement --- tests/vault/gear/test-chain-load-test.cpp | 8 +- tests/vault/gear/test-chain-load.hpp | 6 +- wiki/thinkPad.ichthyo.mm | 202 +++++++++++++++++++++- 3 files changed, 210 insertions(+), 6 deletions(-) diff --git a/tests/vault/gear/test-chain-load-test.cpp b/tests/vault/gear/test-chain-load-test.cpp index 1b6a34c90..c990754c4 100644 --- a/tests/vault/gear/test-chain-load-test.cpp +++ b/tests/vault/gear/test-chain-load-test.cpp @@ -214,13 +214,17 @@ namespace test { - /** @test TODO diagnostic blah + /** @test flexible control of generated topology * @todo WIP 11/23 🔁 define ⟶ implement */ void control_Topology() { - UNIMPLEMENTED ("witch topology"); + auto graph = TestChainLoad<32>{}; + + graph.expansionRule([](size_t h,double){ return Cap{8, h%16, 63}; }) + .buildToplolgy() + .printTopologyDOT(); } diff --git a/tests/vault/gear/test-chain-load.hpp b/tests/vault/gear/test-chain-load.hpp index 256baeaac..a5191fbb8 100644 --- a/tests/vault/gear/test-chain-load.hpp +++ b/tests/vault/gear/test-chain-load.hpp @@ -380,9 +380,9 @@ namespace test { o->addSucc(n); --toExpand; } - if (not toReduce and spaceLeft()) - { // carry-on the chain from o - r = addNode(); + if (not toReduce) + { // carry-on chain from o + r = spaceLeft()? addNode():nullptr; toReduce = apply (reductionRule_, o); } else diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index aee647d75..6d41cb14f 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -95869,6 +95869,192 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+ hatte den Basis-Offset von 8 übersehen, der ja sofort abgezogen wird, bevor das Fenster überhaupt zum Tragen kommt +

+ + +
+
+ + + + + + + + + + +

+ aber nur N21,N23 und N24 können die realisieren, +

+

+ denn dann haben wir alle bis zur vorletzen N30 verbraucht +

+ + +
+
+ + + + + + + + +

+ das war der Fix von gestern +

+ + +
+ +
+ + + + + + +

+ die letze vorhandene Node +

+ + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + +

+ ist das „gut so“ ? +

+ + +
+ + + + + + + + + + + + +

+ der resultierende Baum ist grundlos unregelmäßig +

+ + +
+
+
+ + + + + + +

+ und (bei meinem aktuellen Kentnissstand): ich kann es leicht fixen... +

+ + +
+ +
+ + + + + + + + +

+ Der Baum sieht nun sinnig aus — für das Auge des Mathematikers (nota bene: nicht für mein subjektives Auge). Und der Code ist tatsächlich klarer geworden, weil in der Behandlung nicht mehr zwei getrennte Belange überlagert sind. +

+ + +
+ +
+
+
+ + + + + + +

+ ich hab jetzt dreimal „draufgedroschen“, bis ich das Wahrscheinlichkeitsverhalten hatte, das ich wollte (wenngleich ich auch dabei einen Bug entdeckt habe...) +

+ + +
+ + + +
+
+ +
@@ -95909,6 +96095,13 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
+ + + + + + +
@@ -96120,7 +96313,8 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
- + + @@ -96128,6 +96322,12 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
+ + + + + +