Acropetal pattern
The acropetal pattern is specifically designed for acropetal transport in plants following this structure:
in -acropetal(Child.class,child,Leaf.class,leaf)-> out
I queries the graph in a way that starts at the in node and travels forward to all possible out node. It additionally provides for each match two VoidToObjectGenerators (here named child and leaf) as query variables. These two generators provide the first instance of the given classes on all possible paths from the node forward, hereby describes the first argument (Child.class) the class for the first VoidToObjectGenerator (child) and the third argument (Leaf.class) the class for the second VoidToObjectGenerator (leaf).
Example
In the following example the count of F's and A's is displayed for each F. The [:] operator is used to loop overall nodes provieded by the VoidToObjectGenerators.
module A(float len) extends Sphere(0.1); module Root; protected void init ()[ Axiom ==>Root F F[RL(30)F A(1) RL [F] A(1) F ] F A(1); ] public void test()[ Root -acropetal(F.class,child,A.class,leaf)-> f:F ::> {print(f+"::");print(count(child[:])); print("::"); println(count(leaf[:]));} ]
