Evolutionary Simulator

A small evolutionary simulator: pixel snakes hunted by eagles, with selection on coloration on both sides. See the "Snakes on Stanford Campus" journal entry for context. The simulator may take a few seconds to boot — React + Babel are loaded from CDN and the JSX is transpiled in-browser.

Snakes. Each snake has a heritable RGB color and walks a biased random walk. Reproduction is sexual within species: two same-species adults inside a mate radius produce a clutch; both parents die. Offspring color = parent-blend + uniform mutation noise. Snakes die from old age, density mortality, or bird attack.

Birds. Each bird has continuous position, an energy pool that depletes per tick, and a heritable genome with three parameters: an avoid color (RGB), an avoid sharpness (Gaussian σ), and a caution (peak avoidance probability). Birds scan within a forward FOV out to a finite range. Detection probability scales with snake-vs-background color contrast — camouflage works. Once a snake is detected,

P(avoid) = caution · exp(-cDist² / (2·sharpness²)) · colorClarity

where cDist is RGB distance from the avoid color and colorClarity factors in the snake's contrast and saturation. If avoidance fails, the bird attacks. Toxic snake → mutual kill, no energy. Non-toxic snake → snake dies, bird gains energy. Birds reproduce asexually when energy crosses a threshold (paying an energy cost), plus a one-shot bonus reproduction at advanced age. Birds die from starvation, old age, or attacking a toxic snake.

Inheritance. Snake offspring color: blended parents + per-channel uniform noise. Bird offspring genome: single parent + per-gene uniform noise.

Population floors. If a species drops below a minimum, replacements respawn with colors mutated off the species' last-known average — evolved state survives population crashes.

Pressures.

Loading simulator…