Optionally, feed back the result of the motion to the neural net and adjust weights. Compute energy budget. Movement during this cycle may have cost energy, chemical reactions may have either released or consumed energy. If the energy remaining is 0, the organism dies and is removed from the population, if it is high enough, the organism reproduces asexually, if it is intermediate, the organism simply continues to the next cycle. Conceptually, these actions are executed in parallel for all organisms in the environment.
Reproduction is governed by parameters in the genetic algorithm.
Fitness is measured either according to the rate of energy uptake, or the rate of offspring production. As an energy threshold must be achieved in order to produce offspring, these measures are obviously related. Upon reproduction, offspring are subject to mutation. The genome specifies parameters of the sensors, motors, and neural nets. The code LEE consists of about 7000 lines of C code.