To simulate the energy of the sun there is a certain amount of sun energy in every patch of sky. This energy is mapped to color (light = high energy, dark = low energy). Every iteration there is a burst of energy added to a random patch of sky to simulate the constant addition of energy by the sun. Each strand of grass uses up sun energy to survive. It takes that energy from the patch of sky at its tip. If the energy in that patch is below a certain level, then the strand of grass dies. If the energy in that patch is a above a certain level the stand will begin hatching seeds. This process will continue until the energy in the patch again falls below the energy ceiling. Each time a seed is hatched energy is used up. Energy is also used up by grass strands in every iteration simply for survival. If a seed lands on an empty space of dirt (i.e. no other strands are there), it will spring up into a strand. The height of this newly hatched strand depends on certain "genetic" information carried by the seed. This information is the amount of sun energy present at the strand from which the seed was hatched at the time of the seed hatching. Thus the height of the hatching strand depends on the amount of energy present around its parent at the time of hatching. For example if there is very little energy around a strand hatching a seed, its seed will yeild a very short strand. If on the other hand there is a lot of energy around the parent strand, then the offspring strand will be very tall. There is a limit to how tall a strand of grass can grow.
The simulation starts out with three strands growing to a specified height. As soon as these strands are full grown they each drop a yellow seed. From here the simulation takes off on its own using the simple rules outlined above.
The BURST slider controls the amount of energy added to the sky at every random burst. The simulation runs best with BURST around 100. The MAP slider controls the color mapping of the sun energy in the sky. The greater MAP is, the greater the amount of energy white represents. In other words, the greater MAP is, the wider is the range of energy represented by the different shades of blue.
Very different behaviors take place depending on what value BURST is set to. If it is too low the situation is very static and all the strands may eventually die off. If BURST is too high the population will constantly be full and excessively tall strands will be widespread. If BURST is just right, the cycle described above will take place (just right is somewhere between 80 and 150).
* How could you simulate the sun's energy and its distribution more realistically?
* How could you change the simulation so that the grass strands require water aswell as the sun's energy?