This class provides a growth cycle for the plant genome. This class runs the "program" embedded in the plant's genome. A plant genome is an array of four vectors. Each vector is of length 4, so the entire genome is 4*4 = 16 double values.
Each of the four vectors corresponds to a cell's info vector. A cell info vector provides information about the state of a cell. By cell, I mean a grid cell. The grid cell can be either living (filled) or dead (empty). The info vector for a cell is calculated as follows.
Element 0: The height of the cell. 1.0 for the last row and 0.0 for the first row. Element 1: The amount of sunlight (for surface cells) or water (for underground cells) exposure for this cell. Element 2: Crowding by neighbors. Element 3: Nourishment for this cell.
The genome's vectors are as follows:
Vector 0: Stem desired Vector 1: Leaf desired Vector 2: Growth Option #1 Vector 3: Growth Option #2
Vectors 0 and 1 go together. For each living cell we see if its info vector is closer to vector 0 or vector 1. If it is closer to stem (0), then the leafyness attribute of the cell is decreased. Leaf's can only move towards stem. A stem cannot change back into a leaf.
Vectors 2 and 3 also go together. When a plant cell is eligible for growth, it evaluates all neighbor cells to see which it wants to grow into. What ever neighbor cell is closest to ether vector 2 or 3 is chosen. If the candidate cell is not lower than a specific threshold to either, then no growth occurs.
A ratio between how leafy the surface is, and roots must also be maintained for growth to occur.