GroIMP Module XL English
Spoken text
The geometric structures generated by means of simple L-systems show a high regularity, which often does not match the real structures. Real plants often show a certain variability and sometimes strong irregularities.
One can try to model the variability with the help of randomness based on pseudo-random numbers. For example these can directly be used to generate object parameters or for random-controlled queries for rule application.
XL provides three ways to generate pseudo-random numbers, which will be presented here briefly with a small imperative program. The results are displayed in the XL console after executing through the "run" button because of the "println" command.
The first function returns pseudo-random numbers between 0 and 1. The second function generates pseudo-random numbers between two defined boundary values. In this case these are a and b. The last function returns a Boolean variable with the values “true” or “false”, or 1 or 0. With probability x the value is 1 and with the probability of 1-x it is 0. The variability of the generated numbers is visible after repeated executions via the "run" button. As an example for the use of randomness in an L-system, the following example will be explained: The model has a strong regularity without stochastics, making the simulated structure looking rather unnatural. If a random variation is added for the branch angle, here based on the probability function and an if-else condition, the modeled structure is much more natural and realistic.
To enlarge upon and to illustrate the possibilities of GroIMP using stochastic L-systems, the examples 23 and 24 should be explored more closely. These show very well the possibilities of using L-systems outside the modeling of structures of individual plants. They are simple seed dispersal models.