Skip to content

Latest commit

 

History

History
4 lines (3 loc) · 1.74 KB

README.md

File metadata and controls

4 lines (3 loc) · 1.74 KB

selection

This is a simulation to demonstrate the principles of natural selection. Organisms are divided into three types: producers, herbivores, and carnivores. Producers consume nutrients from the soil, and send out pollen to reproduce. Herbivores need to eat producers to stay alive, and have a chance to mate with another herbivore on impact. Carnivores must eat herbivores to stay alive, and have a chance at reproduction on collision. Lifeforms will not consume other lifeforms unless they can eat all of it (full health >= health + health gained). If a producer cannot gain adequate nutrients or if herbivores/carnivores run out of health, they will die. I am currently implementing an incorrect understanding of genetics by having offspring have a blend of their parent's traits (in reality, there are chromosomes and sometimes traits can be masked), as this method is simpler and can still show the same trends. By default, the simulator will log the population sizes, which can be viewed by pressing graph in the simulator. If you want to log a different variable (such as germination period), go to the drop down menu, select your desired variable, and press log. In the future, I plan to implement more variables, but for now if you want to see the trends produced by natural selection, I recommend logging the pollen period variable (the time in between releases of pollen by plants). Mutations are currently small and hard coded, so in the near future, I plan to make them dynamic and stronger. If you like this repository, please star it, and feel free to fork it and start your own, similar project. All of my code is in /js/selection, and the project is run through gh-pages, but can be run off-line if you clone the repository and launch index.html.