From d5ae52e558bd9910e9c97d58ae5f84a4a32e7853 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Sun, 31 Dec 2017 21:05:15 +0100 Subject: [PATCH] UI-Coordinates: design implementation of the patch matching algorithm ...which indicates that we need some additional functionality from TreeExplorer --- src/lib/iter-tree-explorer.hpp | 15 + tests/library/iter-tree-explorer-test.cpp | 18 + wiki/thinkPad.ichthyo.mm | 421 +++++++++++++++++++--- 3 files changed, 405 insertions(+), 49 deletions(-) diff --git a/src/lib/iter-tree-explorer.hpp b/src/lib/iter-tree-explorer.hpp index e79ebc928..e946cf7d9 100644 --- a/src/lib/iter-tree-explorer.hpp +++ b/src/lib/iter-tree-explorer.hpp @@ -1135,6 +1135,21 @@ namespace lib { } + /** extension functionality to be used on top of expand(), to perform expansion on next iteration. + * When configured, an expandChildren() call will not happen immediately, but rather in place of + * the next iteration step. Basically child expansion _is kind of a special iteration step,_ and + * thus all we need to do is add another layer with a boolean state flag, which catches the + * expandChildren() and iterNext() calls and redirects appropriately. + * @warning expandAll and expandOnIteration are not meant to be used at the same time. + */ + auto + expandOnIteration() + { + UNIMPLEMENTED ("expansion scheduler flag"); + return *this; + } + + /** adapt this TreeExplorer to pipe each result value through a transformation function. * Several "layers" of mapping can be piled on top of each other, possibly mixed with the * other types of adaptation, like the child-expanding operation, or a filter. Obviously, diff --git a/tests/library/iter-tree-explorer-test.cpp b/tests/library/iter-tree-explorer-test.cpp index 8875adc31..5aa9eabcf 100644 --- a/tests/library/iter-tree-explorer-test.cpp +++ b/tests/library/iter-tree-explorer-test.cpp @@ -270,6 +270,7 @@ namespace test{ verify_expandOperation(); verify_transformOperation(); verify_combinedExpandTransform(); + verify_scheduledExpansion(); verify_FilterIterator(); verify_asIterSource(); verify_IterSource(); @@ -669,6 +670,23 @@ namespace test{ + /** @test child expansion can be scheduled to happen on next iteration. + * As such, _"child expansion"_ happens right away, thereby consuming a node + * and replacing it with its child sequence. Sometimes, when building search and matching + * algorithms, we rather just want to _plan_ a child expansion to happen on next increment. + * Such is especially relevant when searching for a locally or global maximal solution, which + * is rather simple to implement with an additional filtering layer -- and this approach requires + * us to deliver all partial solutions for the filter layer to act on. Obviously this functionality + * leads to additional state and thus is provided as optional layer in the TreeExplorer builder. + */ + void + verify_scheduledExpansion() + { + UNIMPLEMENTED ("schedule child expansion to be performed on next iteration"); + } + + + /** @test add a filtering predicate into the pipeline. * As in all the previously demonstrated cases, also the _filtering_ is added as decorator, * wrapping the source and all previously attached decoration layers. And in a similar way, diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index aea52fd93..2efb7e6a2 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -977,7 +977,7 @@ - + @@ -4096,7 +4096,7 @@ - + @@ -4244,11 +4244,18 @@ - + + + - + + + + + + @@ -4311,10 +4318,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+ wo der Spot ist +

+ +
+
+
+ + + + + + @@ -4482,16 +4533,20 @@
- + - + + + + - + - + + @@ -4504,8 +4559,8 @@ - - + + @@ -4530,7 +4585,7 @@ - + @@ -4541,8 +4596,10 @@

+
- + + @@ -4560,6 +4617,13 @@ + + + + + + + @@ -4632,27 +4696,32 @@ - - + + + + + - + + - + - + + - - + + @@ -5149,10 +5218,11 @@ - + + + - @@ -5773,6 +5843,22 @@ + + + + + + + + + + + + + + + + @@ -6749,7 +6835,7 @@ - + @@ -7077,6 +7163,15 @@ + + + + + + + + + @@ -7279,8 +7374,7 @@ wenn man konsumieren möchte

- - +
@@ -7596,8 +7690,8 @@
- + @@ -7939,8 +8033,7 @@ es werden jetzt keine weiteren Features für TreeExplorer gebaut....

- - +
@@ -7954,8 +8047,7 @@ ...mal sehen, ob wir jemals daran anstoßen...

- - +
@@ -7976,8 +8068,7 @@ der ohnehin selbst Heap-alloziert ist

- - + @@ -8009,8 +8100,7 @@ Was sind die Kosten dafür?

- - +
@@ -8053,8 +8143,7 @@ IterSource muß insgesamt besser erweiterbar werden....

- - +
@@ -8097,8 +8186,7 @@ das Ergebnis ist der konkrete Iterator-Typ

- - +
@@ -8186,8 +8274,7 @@ Wire-Tap-Implementierung

- - +
@@ -8212,8 +8299,7 @@ das heißt, depth ist aktuelle Tiefe!

- - +
@@ -8222,9 +8308,9 @@
- + - + @@ -8268,9 +8354,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
  • + nur für internen Gebrauch +
  • +
  • + protected im Builder +
  • +
+ +
+ +
+ + + + + + + + + + + + + + + +

+ Lösungen müssen +

+

+ am Ende des Patterns liegen +

+ + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -8284,7 +8485,7 @@ - + @@ -8297,15 +8498,136 @@ oder verfangen wir uns da sofort zu sehr in der Implementierungs-Technik?

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

+ neue Einsicht 31.12.17 +

+

+ totale Coverage ist das, was man naiverweise erwartet. +

+

+ Also sollte das auf dem API der default sein +

+
- +
- -
@@ -8349,6 +8671,7 @@ + @@ -17122,7 +17445,7 @@ - + @@ -23845,7 +24168,7 @@ - +