Biology GCSE • A-Level • IB • AP ●●○ Intermediate ★ Free

Evolutionary Steering

Watch "Survival of the Fittest" in real-time. Agents evolve DNA to better distinguish between food and poison.

Mutation: 5%
Agents: 10
Food Rate: 50
Population: 0 | Gen: 0
Simulation running
Food (+Health) Poison (-Health) Good Agent Bad Agent

How Natural Selection Works

How Natural Selection Works

This simulation implements an agent-based model of Darwinian evolution. Agents (organisms) move through an environment containing food (green) and poison (red). Each agent has a neural-network-style genome encoding how it weights different types of food in its field of view. Agents that eat more food survive longer, reproduce, and pass on their genome — sometimes with random mutations.

Over successive generations, the population becomes adapted to its environment. You can observe the emergence of feeding strategies, avoidance behaviours, and even competitive dynamics — all from simple fitness rules and variation.

Genetics and Inheritance

Each agent carries a genome — a set of numerical parameters controlling its behaviour when it senses nearby food or poison. When an agent reproduces, its offspring inherits its genome with a small random mutation: a slight tweak to one or more parameters.

Key genetic concepts illustrated:

  • Variation — mutations create diversity within the population
  • Heritability — offspring resemble parents
  • Selection pressure — environmental conditions favour certain traits
  • Fitness landscape — not every mutation is beneficial

Evolution in Practice

Real-world applications of evolutionary computation include:

  • Genetic algorithms — optimising engineering designs, scheduling, and routing
  • Neural architecture search — evolving the structure of AI models
  • Drug discovery — evolving molecules with desired pharmaceutical properties
  • Robot locomotion — evolving walking gaits for physical robots
  • Game AI — evolving strategies for complex board games

The field of evolutionary computation (EC) spans genetic algorithms, genetic programming, and evolution strategies — all inspired directly by the biological processes modelled here.

Experiments to Try

  • Increase poison density — watch how quickly agents evolve avoidance strategies
  • Crank up the mutation rate — observe rapid environmental adaptation vs. genetic instability
  • Reduce food — create strong selection pressure and watch population fitness jump
  • Watch the fittest agents — identify the behavioural patterns that emerge over time
  • Reset and compare — run multiple experiments to see how evolution converges differently each time

Key Equations & Concepts

ConceptFormula / RuleNotes
Hardy–Weinberg equilibriump² + 2pq + q² = 1Allele frequencies stable without selection; baseline for measuring evolution
Fitness functionw = e−ΔHAgents with higher health survive longer to reproduce
Mutation probabilityPmut = μ per gene per generationμ = mutation rate; controls diversity vs. stability trade-off
Population geneticsΔp = p ⋅ (wA − ¯w) / ¯wChange in allele frequency per generation (selection equation)
Natural selection strengths = 1 − wless fitSelection coefficient; s = 0 = neutral; s = 1 = lethal
Effective population sizeNe = 4NmNf / (Nm + Nf)Determines rate of genetic drift; small Ne → faster drift

Curriculum Links

LevelTopics
GCSE BiologyNatural selection, variation, inheritance, mutation, adaptation
A-Level BiologyPopulation genetics, Hardy–Weinberg, selection pressure, speciation
A-Level ComputingNeural networks, genetic algorithms, agent-based modelling
University (Biology)Evolutionary biology, quantitative genetics, fitness landscapes
University (Computer Science)Evolutionary computation, genetic algorithms, swarm intelligence
PostgraduateComputational evolution, eco-evolutionary dynamics, digital life

🔒 Unlock All 32 Simulations

Get unlimited access to all 32 interactive simulations including Evolution, Game of Life, Lorenz attractor, quantum mechanics, and more with MySimulator Premium.

View Premium Plans

Share this simulation

Send this page to students or colleagues.

𝕏 Share 🔗 LinkedIn 📋 Copy Link

Related simulations

Continue with similar experiments.

📖 Recommended Reading

Deepen your understanding with our in-depth article.