Play n Tools

Free tools & games for everyone

Free · No sign-up · No accounts

No Leader Needed: Flocks, Ant Trails and Falling Sand

· in Learning

Cover picture: No Leader Needed: Flocks, Ant Trails and Falling Sand

Three new simulators show how simple local rules make big patterns: birds that flock, ants that find the shortest path and sand that piles into perfect slopes.

A starling flock turns as one, ants lay a neat highway to a crumb, and a heap of sand always forms the same slope. Nobody is in charge in any of these. Each one comes from many small parts following simple local rules. Three new simulators let you watch it happen and change the rules yourself.

Flocking & swarm lab: three rules make a flock

In 1987 the computer graphics researcher Craig Reynolds made "boids": virtual birds that follow just three rules about the neighbours they can see.

  1. Separation: do not crowd your neighbours.
  2. Alignment: fly the same way they do.
  3. Cohesion: move towards the middle of the group.

Open the Flocking & swarm lab and the birds start in random directions. Within seconds they form flocks. Turn alignment down to zero and you get a buzzing insect swarm instead: the birds stay together but stop agreeing on a direction.

The second tab runs the Vicsek model, a physicist's version. Add more noise and the order suddenly breaks down, much like ice melting into water.

Ant colony simulator: trails from scent

An ant cannot see a map. It follows scent. Ants carrying food lay a trail home, and other ants follow the strongest smell. In the Ant colony simulator you can watch green trails grow between the nest and the food, and drop new food anywhere with a click.

The double-bridge tab repeats a famous experiment with Argentine ants. Give a colony two bridges to the food, one twice as long as the other. Ants on the short bridge come back first, so its scent builds up sooner. In our model the short bridge wins in about three colonies out of four.

Make both bridges the same length and the colony still picks one of them. Following the crowd is enough to make a choice.

Falling sand sandbox: rules for every grain

The Falling sand sandbox is a cellular automaton. Every cell holds sand, water, oil, wood, fire or something else, and each step it follows a short rule. Sand falls, and if it cannot fall straight down it slides one way or the other. That rule alone builds piles with sloping sides. Water spreads sideways, oil floats on water, and fire creeps from tree to tree in the forest-fire scene.

Try it yourself

Pick one rule and change it, then watch the whole pattern change. That is the big idea behind all three tools, and behind Conway's Game of Life too.

Tags:

All blog posts

See you tomorrow!

A fresh daily puzzle every morning, and new tools added every month.

Browse every product