Waggle dance
A forager that found a good patch dances on the dark comb. The dance is a figure of eight with a straight waggle run in the middle. The run's angle from vertical is the angle between the sun and the food, seen from the hive: alpha = bearing(food) - azimuth(sun). The run's duration encodes distance, about 1 s per km (it varies by honey bee race and landscape). Bees waggle at roughly 13 Hz, and the number of circuits tracks how profitable the trip was.
Followers decode this imprecisely, with an error of roughly 10-15 degrees, so recruits scatter around the patch. Here the angle error is about 12 degrees and the distance error about 10 %. Change the time of day: the sun moves and the dance angle changes with it, but the bearing of the patch on the map does not.
Foraging economics
Profitability is the sugar delivered per second of trip: q = (volume x sugar fraction x density) / trip time. Dances are only produced above a threshold and the circuit count is proportional to q. Patches whose flowers are drained, or that offer little nectar (daisy, poppy), recruit few bees; this positive feedback shifts foragers to the best patch without any central control. A honey stomach holds about 40 uL (up to ~70 uL). To keep trips short on screen, a flower gives 5 uL per visit instead of a fraction of a microlitre, so a trip is ~8 visits instead of hundreds.
Pollination and seed set
A visit deposits some of the pollen on the bee's body onto the flower. Conspecific grains add up: seed set = 1 - exp(-0.22 x grains); foreign pollen clogs the stigma and lowers it. Bees that keep to one species per trip (flower constancy) therefore pollinate more effectively, which you can test with the slider. Poppies offer pollen only and no nectar. Fertilised flowers set seed, wilt and are replaced by seedlings nearby; unvisited flowers wither with no offspring, so removing the bees shrinks the meadow.
Ant colony optimisation
Ants searching for food lay a home pheromone; ants carrying food lay a food pheromone, both weaker the longer ago they left their source (deposit ~ exp(-t/16 s)). Both evaporate (half-life slider). Ants steer toward stronger pheromone with probability roughly proportional to concentration cubed. A shorter route is completed faster, so it is reinforced more per unit time, and the colony usually converges on it. Occasionally it locks onto the longer one, a known failure of the method (restart to see this). Block the short gap and the old trail evaporates while a new one forms.
Wing-beat frequencies
Smaller insects beat faster: butterfly about 10 Hz, honey bee about 230 Hz, male mosquito up to about 600 Hz. A 60 Hz screen cannot show a 230 Hz stroke, so bees are drawn at ~26 Hz and the mosquito as a blur; butterflies are shown at their real rate. The Hear button plays the real tone (butterflies are below human hearing, so you hear a 10 Hz flutter on a carrier).
What is simplified
One world unit is 7.5 mm for bodies and flowers, but the map is compressed: the patch distances (about 70-150 units) are treated as 12 m per unit for dance timing, and flight speed is slowed accordingly. Nectar volumes, colony consumption and seed numbers are illustrative. Ladybird and beetle only patrol; aphids, predation, brood and queen are not simulated.