2 Reference

2.3 Measuring the swarm

2.3.1 Measures (SwarmMetrics)

Measure Range Definition
polarization 0 – 1 length of the mean unit heading \|Σ v̂ᵢ\| / N: 0 = headings cancel, 1 = all aligned
centroid px circular mean per axis, correct for groups straddling an edge
diameter px largest distance between two members
elongation 0 – 1 1 − √(λ₂/λ₁) from the position covariance: 0 = round, 1 = a line

2.3.2 Flocks and their identity

A flock is a group of boids connected through their interaction radius: two boids are linked when they are within max(alignment, cohesion) of each other, i.e. when they influence each other. Groups of at least 5 boids count. Each flock is measured with the same four measures as the whole swarm.

2.3.3 Encounters (SwarmEvents)

An encounter is the moment two boids enter each other's separation radius. It fires once on entering, not while they stay close. A pair only counts as apart again 12.5 px beyond the radius (hysteresis): without it, pairs jittering at the boundary would re-trigger every frame — over 1,000 encounters per second, pinning the sound at its limit. With it: about 16 – 40 per second, varying with how the swarm moves. The margin is fixed rather than growing with the radius, so that even a jammed swarm can part and meet again: at high separation the stage allows only about 131 px between 120 boids, and the jam rains quietly instead of falling silent.