Experiment 06

Boids

Three local rules and a single perception radius are enough to turn a cloud of random velocities into a coherent flock that wheels, tightens, and scatters like a single organism — with no individual ever knowing the group's overall motion.

What is Boids?

Boids is a flocking model: each individual — a boid — perceives only its immediate neighbours, within a single fixed radius, and applies three rules to them at every simulation step. Separation: steer away from neighbours that are too close, to avoid collision. Alignment: match the average velocity of the neighbourhood. Cohesion: steer toward the neighbourhood's center of mass. These three forces, weighted and summed, determine the boid's acceleration — nothing else enters the computation.

Unlike LifeLabs' evolutionary agents, there is no brain and no selection here: every boid applies the same three rules, with the same weights, at every step, from the first individual to the last — no parameter is learned, no generation selects the fittest boids. The collective behavior is not the product of learning, but the repeated execution of a fixed, purely local rule.

Why this is emergence — collective movement, not coordination

Every run starts from randomly drawn velocities, with no shared direction: at step zero, the flock is just a cloud of points each moving on its own. No boid knows the group's heading, no message is exchanged, no target position is set in advance. And yet, after a few hundred steps, an order parameter — the average alignment of individual velocities — climbs well above what it would read for independent velocities: the flock has started flying in a shared direction, splitting into a few coherent groups, re-forming after crossing paths.

This rise is not a measurement artifact: the lab's control test (the "golden test") runs the same simulation with all three rules switched off — zero weights, no interaction between neighbours — and there the order parameter stays flat, close to its value for independent random velocities. The rise observed when the rules are active is therefore attributable to the three rules themselves, not to a bias in the computation or the initialization.

Pilot

Pilot the flock

An interactive demo runs entirely in your browser: tune the separation, alignment, and cohesion weights live, along with the perception radius, and watch the flock go from a scattered cloud to grouped flight — or fall back apart.

Open the interactive demo

Replaying a trajectory

The player below replays, frame by frame, the recorded positions and velocities of the flock over the course of the published run. Each boid starts in a random direction, then groups take shape.

Loading trajectory…

Playback

The vital signs we measure

Each run records three time series, computed at regular intervals during the simulation, which serve as "vital signs" for the observed flock:

Order parameter
the mean alignment of individual velocities, normalized between 0 (independent velocities, no shared direction) and 1 (the whole flock flies in exactly the same direction) — the most direct signal of collective self-organization.
Number of clusters
the number of spatially distinct groups detected within the flock — it drops to a single group once the flock gathers, and rises when it splits or stays scattered.
Mean speed
the mean speed of the boids across the whole flock — it shows whether the group has settled into a cruising pace or keeps accelerating or slowing down as a whole.

Vital signs — latest run

Order parameter0.67
Number of clusters6.00
Mean speed1.60 u/step

Results

First public run — 600 steps, 300 boids, seed 42. Velocities start drawn at random: the order parameter (polarization) reads 0.028, near-total disorder. Step after step the curve climbs — noisily, with plateaus and setbacks around 0.05–0.10, before taking off past the 300th step — to settle at 0.669 by the end, a gain of +0.64. The 300 boids sort themselves into 6 "groups" each streaming along a common heading, and the classifier files the result as "flocked". The negative control (same boids, same 600 steps, the three weights set to zero) stays stuck at 0.019: the rise genuinely comes from the three local rules — separation, alignment, cohesion — and not from a simulation artefact. On the video, you can see the boids go from a dispersed, disordered scatter to a few dense, coherent clumps gliding as one. The interactive demo lets you explore the regimes live.