A grid world of plants, herbivores and predators, from the Python ABM lab. Plants regrow on free cells, herbivores graze, predators hunt, every move costs energy, and creatures that store enough energy reproduce with mutated speed and vision, so those traits evolve under selection. Optuna searched for lasting coexistence: all three species survive, stay clear of extinction and keep bounded, balanced numbers. The browser Predator – Prey sheet shows the same cycle as two differential equations.


Plants, herbivores and predators on a grid, with speed and vision evolving under selection — tuned for lasting coexistence. A recorded run.