This is a video recorded from a simulation I wrote.
The agents (blue) are controlled by an artificial neural network (or ANN for short). The ANNs are generated from their agent's genome. I use the Analog Genetic Encoding (Matiussi C. & Floreano D.) and Center of Mass Encoding (Matiussi C., Dürr P. & Floreano D.) for encoding (or literally "decoding") the neural networks.
The agents' neural network have 7 fixed inputs (2 eyes with red, green and blue and 1 health value) and 6 fixed outputs (Move forward, Turn left, Turn right, Eat, Mate, Color). All other neurons and all connections are built from the genome.
At beginning 50 random agents are spawned in the environment. The environment is basically an empty torus. But in regular intervals food patches (green) are spawned. There is one big cluster of food patches that changes position from upper-left quadrant to bottom-right quadrant (each 500 time steps). Agents can eat food or other agents to gain health to compensate their constant loss of health. When two agent mate (Those two agents need to be close) offspring is created with fractions of its parent health and a genome interbreeded from its parents genomes.
Just to clarify, I didn't code the agents to behave like they do. They adapted their behaviors by evolution: Reproduction (Interbreeding in this case), Mutation (randomly applied) and Natural Selection (Agents with 0 health will die).
Have fun watching it ;)
The eyes are rays. The eye sees the color of the first object the ray collides with within a limited range.
The mating works exactly as you guessed.
schneemann1991 1 month ago