Teaching Aid

 
Left context
 

Left context

 

 
Copy/Paste the following code to your GroIMP project:
//**********************************************************
/*
You will learn with this example:
– the use of a context on the left-hand side of a rule
(in this case, a left context).
– Notice the context search pattern!
*/

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

// The modules A and S extend F, i.e., they will be drawn.
module A extends F(10, 0.1, 14);
module S extends F(5, 0.1, 4);

protected void init()
[
Axiom ==> A [ RU(30) S B ] A B;
]

public void runApikal()
[

// context: all B with a predecessor of type S
(* S *) B ==> S B;

// context: all B with a predecessor of type A
(* A *) B ==> [ RU(30) S B ] A 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.

--- not found