GroIMP Module XL English
Spoken text
In the units of the first learning module for the use and handling of GroIMP the graph grammar contained in the RGG-file was already run via the control instruments for the simulation but not yet explained. In the following lessons 1-13 this will be achieved by explaining from scratch each command and the used rewriting rules. This will make it possible to understand and comprehend the code contained in the RGG file and finally to develop models independently.
Therefore, it is essential to consider the turtle geometry more precisely, which interprets the turtle commands in the RGG file and transforms them into geometric shapes in GroIMP. These turtle commands are part of the language XL contained in GroIMP, which connects the object-oriented and imperative approach of the programming language JAVA and the turtle geometry with the rule-based rewriting rules approach – the Lindenmayer systems and graph grammars. These relationships and rules are explained in the further course of this module in more detail.
The turtle is a virtual drawing machine converting the character sequence, which consist of simple geometric commands, one by one into geometric shapes to visualize them. Such a very simple string is highlighted here. By compilation the geometric information is converted by the turtle and visually displayed in the 3D window.
One can realize the function of this moving turtle, which one after the other executes the commands and draws them, a little better by the shown brief example by executing the commands only sequentially.
The turtle has a state memory, which stores the location and the moving direction of the turtle. In addition, the length, thickness and color of the following line is saved in this memory.
As you have just seen, the axiom, which has also been addressed in the Unit 1 and 23 of the first learning module, is needed to use the turtle geometry within GroIMP. It is the initiator, which is within the init() method and thus is generated instantly with the model compilation.
An arrow is written after the keyword "Axiom” followed by the turtle instruction sequence. Thereby GroIMP is instructed to convert the initiator in the command sequence and execute the same. By the "save" command the code is saved, compiled and executed.
In the following units 2-5 the main turtle commands are explained in detail and illustrated. A list of turtle commands contained in XL can be found on the website of the learning module.