MIMICRY is a page that shows how evolution works.
It creates a population in a world of random color, where each individual has a random position and color. Then it iteratively processes epochs, and every epoch all individuals are processed in random order. Each individual may die for one or more of the following reasons:
  1. At each age, it has some probability to die, which above a given age asymptotically grows to 100%.
  2. There can be overpopulation (cf. famine) and the larger that is the greater the probability to die. The target population size varies sinusoidally around a given value with Gaussian noise superimposed thereon.
  3. The more an individual's color differs from the color of the world, the greater the probability to die (cf. be seen and eaten by a predator).
If it survives the epoch it has an age-dependant probability to spawn new individuals that inherit its position and color. Both are mutated with Gaussian noise.
At regular intervals, the color of the world changes by applying Gaussian noise with a not too large standard deviation, but at a lower frequency a far larger sigma value is used. So the world more or less gradually changes and sometimes it may abruptly change significantly. This changing world color has its effect on the population, since individuals that were well camouflaged by there color being more or less equal to that of the world, suddenly are no longer the fittest to survive and subsequently die.
Consider these colors metaphorically. The color of the world represents the entirety of all circumstances, and each individual's color represents the total of all its properties. If they do not match, the individual has a greater probability to die. The Mimicry page can be seen as a simulation of for example climate changes and meteor impacts.
It is very well possible that a florishing population gets extinct in a short time, but if it survives a change of the world color, its average color will be adapted in not too many epochs. The color variation will become not too large.
This is how evolution works. Most of the unfit individuals die, which may cause a significant decline of the population size, and the fitter ones survive and procreate, passing on their fit properties by heredity, but mutated. The individuals do not adapt, but the population does. Or it dies out.
The Mimicry page displays the world with all its inhabitants, and below it are two bars showing the history. The upper bar shows the average population color and the variation around that average, the lower one shows the world's color and, in its complementary color, the populations size. When a population (nearly) dies out, the graph will be very similar to e-x, which I did not program into it; the most invoked function is Math.random.