Reynolds' Boids (1987) produces lifelike flocking from three purely local rules applied to every agent at each step: separation (avoid crowding), alignment (match neighbors' headings), and cohesion (steer toward the local center of mass). The name "Boid" is a portmanteau of bird-oid — bird-like.
Each rule acts within its own spatial radius — separation closest, cohesion farthest — and the emergent collective motion depends sensitively on the balance of their weights.
Unlike other classic collective motion models such as the Vicsek model (Vicsek et al., 1995), Boids has no explicit noise term; behavioral richness arises from the nonlinear interplay of three competing forces.
For an interactive simulation, see Tab ② Simulation.
Weighted sum steers the current velocity; direction is normalized and speed is reset to vmax. Ordering rs < ra ≤ rc is typical.
System Properties
Order Parameter φ
φ = (1/N)|Σj eiθj|
= (1/N)√((Σcosθ)2+(Σsinθ)2)
φ = 0: all headings random. φ = 1: perfect alignment. A global statistic of collective coherence — not part of the per-boid dynamics.
φ ≈ 0
φ ≈ 0.5
φ ≈ 1
Algorithm Sketch
initialize N boids in [0,L]²:
xi ∼ U([0,L]²); θi ∼ U(−π,π)
vi = vmax(cosθi, sinθi)
repeat each timestep:
for each boid i:
fsep = steer away from {j: d < rs}
falign = match heading of {j: d < ra}
fcoh = toward CoM of {j: d < rc}
vi ← normalize(vi + wsfsep
+ wafalign + wcfcoh) · vmax
xi ← xi + vi
apply boundary conditions
Key Differences from Vicsek
Vicsek uses a single averaging rule with additive noise; Boids uses three competing forces without noise. The three radii create spatial structure absent in Vicsek — a boid simultaneously repels its nearest neighbors, aligns with a wider group, and coheres with an even wider group. Tuning their weights and radii produces qualitatively distinct collective states: directed flocking, compact swarming, milling vortices, and dispersed wandering — a richer behavioral landscape than Vicsek's ordered-vs-disordered binary.
Agents are colored by heading angle. Tune the three force weights and their spatial radii to explore the different collective behaviors.
The three radii are shown as concentric colored rings when toggled on: red = separation, amber = alignment, green = cohesion.
Use the presets to jump to qualitatively different regimes, then explore the parameter space around them.
Boid swarmready
Press Run to start
Heading distribution & order parameter
φ (order param.) = —
φ (order param.)
Presets (colored by phase)
Controls
speed1×
Force weights
wsep1.8
walign1.0
wcoh0.8
Interaction radii (rs < ra ≤ rc typical)
rsep0.8
ralign2.0
rcoh3.5
Speed & count
vmax0.08
N80
Phase diagram (approx., Couzin et al. 2002)
Four collective regimes from Couzin et al. (2002), plotted as ratios of separation and alignment radii to the cohesion radius. The dot shows current parameters, adjusted for force weights. Note: Couzin's original model uses non-overlapping zones with equal weights — with weighted overlapping zones as used here, force weights shift the effective boundaries.