A demo of a genetic algorithm, as it learns to find food |
Each generation starts off with 5000 creatures and ends when they all die. Here's some facts about the creatures: They mate asexually. When reproducing, the offspring can appear on any of the four spaces around the parent, top, right, bottom, or left. Offspring have a copy of their parent's DNA, with a %1 chance of a random mutation. Creatures who do not eat after 25 turns (2.5 seconds) die of starvation. Creatures have a maximum lifespan (10 seconds), can eat any other individuals (in accordance with their DNA), and have a size (0 - 5, inclusive). Creatures can only eat other creatures that are smaller than them. |