Teaching Aid

Query (3) / reversed edges

 

 
Copy/Paste the following code to your GroIMP project:
//**********************************************************
/*
You will learn:
– the reversal of edge direction in a query.
*/

module B extends Sphere(0.1)
{{setShader(GREEN);}};

// nodes of types A and S are not drawn:
module A;
module S;

protected void init()
[
Axiom ==> A P(1) D(0.5) F(10) [ S RU(30) B ] B;
]

public void runA()
[

// rule 1: applicable to all B which have an A node as predecessor
// (possibly with skipping intermediate nodes).
// Arbitrarily many < and <+ edges can be skipped.
// In contrast to the preceding example, the query is here
// read bottom-up.

(* A <-ancestor- *) B ==> F(10) [ S RU(30) B ] B;
]

public void runS()
[

// rule 2: applicable to all B which have an S node als predecessor
// (possibly with skipping intermediate nodes).
// Arbitrarily many < edges can be skipped.
// In contrast to the preceding example, the query is here
// read bottom-up.

(* S (>)* *) B ==> F(10) B;
]

//**********************************************************
 

DATE: 2009

 

AUTHOR: W. Kurth

 

DESCRIPTION:  see model

 

Welcome to the website grogra.de. This site is the web centre of growth grammars of the Department Ecoinformatics, Biometrics and Forest Growth at the Georg-August University of Göttingen and its cooperation partners.