This projects aims to model animal evolution through natural selection. It does this by simulating an environment in which animal like entities grow and reproduce, while competing for food.
In many genetic algorithms there are distinct stages or generations:
- Generate a random population.
- Test them all using a fitness function.
- Select a fit portion of the population, based on the fitness function.
- Create the next generation from the fit individuals, usually by copying them and adding small mutations to some.
In this program however there is no defined fitness function and there are no set generations. Instead the fitness of an individual can be considered to be how many offspring it manages to have. Therefore there are no distinct generations, as in real life, some creatures will outlive others and successfully have offspring before or after each other.
In any situation where you have variation in a population, inheritable traits, mutation and non-guaranteed survival you will get evolution, it is unavoidable and can be applied in any situation in which those factors coexist.
Source code: Github
Try it yourself: Trilobytes-Alpha-Release-003.7z
- Download and unzip the folder,
- Double click on "Trilobytes.exe".