Teaching Aid

Sequential and parallel mode

 

 
Copy/Paste the following code to your GroIMP project:
//**********************************************************
/*
You will learn:
– to switch between sequential and
parallel derivation mode
(SEQUENTIAL_MODE and PARALLEL_MODE).
– the default setting in GroIMP is PARALLEL_MODE.
*/

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

module S(super.diameter) extends F(10, diameter, 2);

float D0 = 1.0;

protected void init()
[ Axiom ==> S(D0) B; ]

public void grow_par()

{
setDerivationMode(PARALLEL_MODE);
[
B ==> [ RU(35) S(D0) B ] [ RU(-35) S(D0) B ];
]
}

public void grow_seq()
{
setDerivationMode(SEQUENTIAL_MODE);
[
B ==> [ RU(35) S(D0) B ] [ RU(-35) S(D0) 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.