Natural Selection Simulation


This simulation uses cells that can search for food in order to gain enough energy to reproduce. Upon reproduction there is a chance of mutation which allows the cells traits to change. Currently only speed and sense distance are featured, but I hope to add more characteristics like agression, strength and size. The results so far have been interesting. So far I have observed:

  • Extinction and population explosion events
  • The emergence of dominant cell families that cause the extinction of other families
  • Increase in average sense distance over generations
  • Stabilising of population over many generations
  • Massive instability caused by changing available food
  • Loss of genetic diversity during extinction events
  • Decreasing of average population as sense distance and speed increase

Card image cap
Cells with Traits

A number of cells are generated with a starting energy level, and a random sense distance and speed. From here, the simulation is left to run.

Card image cap
Food & Energy

The squares represent cells, and the dots represent food. The sense distance of the cells determines how far away they can sense food. Upon entering a square with food the cells gain energy

Card image cap
Reproduction & Mutation

Upon reaching high enough energy levels the cells are able to reproduce, at a cost. The cells information is passed on with a chance of mutation.

Project Goal

The goal of the project is to simulate divergence within species - for example a sub-species that prioritises speed but uses a lot of energy, and a sub-species that evolves to prioritise huge size and slow movement to fend off attacks.
So far this has not been observed because the number of traits is too small to create any specialised sub-species.

In pursuit of this goal, I'm going to add the following traits:

  • Defence - chance of defending and attack, based on opponents size and aggression
  • Aggression - chance of attacking
  • Size - larger cells would require more energy to maintain size but would be slower
  • Family Loyalty - cells can recognise other cells of their family and share food, inmproving chances of genetics being passed on
I will also add features to the program to allow for better understanding of the results:
  • Poplation over time graph to show how population levels change
  • Graphs of trait levels over time to show how cells become more dominant / weaker
  • System for recognising and grouping families
  • A more intelligent system of food that varies over time to put strain on populations