Natural Selection Simulator
I studied Darwin's theory of natural selection in chemistry class, learning about examples of species that had adapted over many generations to better suit their environment, such as the Galapagos finch. I was tasked with designing my own model as part of our final assessment project that showcased the five main aspects of natural selection: variation, overproduction of offspring, reproduction, struggle for survival, and survival of the fittest.
In my model, a large population of automated creatures is spawned at random locations across a 2D plane. Food and poison is also spawned on this plane, but not enough for the entire initial population to survive. However, not all ‘creatures’ seek food; their attraction to food or poison is determined by their randomly generated genetic traits. These traits consist of a specific food and poison radius, and a level of attraction to food or poison. These randomly assigned detection distances determine the chance of a creature surviving or not. For example, if a creature can detect food from a large distance away in a world with spaced out food placement, and is attracted to food, they are more likely to survive than a creature who can't see food from far away or isn't as attracted to it. These creatures reproduce at a rapid rate, and pass their genetic information onto their children (with a chance of their genes mutating slightly).
The player has complete control over their own character within the world using their mouse and keyboard. Just like the other AI-controlled creatures, it is necessary that they maintain a constant supply of food or they will die. Poison will also harm their creature. If the player consumes enough food, they can breed with another creature. It is recommended that they breed with a creature with desirable traits, as their offspring has a chance to inherit them.
Lastly, there is a ‘predator’ that exists within the world; a creature much larger than the others that follows and consumes fleeing creatures. This model represents the process of natural selection through genetic variation in creatures, the overproduction of creature offspring, the player reproduction system, the limit resources that cause a struggle for survival and the survival of the creatures with the most suitable genetic traits.

