kuramoto order parameter 0.00 (1 means perfectly synced)
period2.0s
sync strength0.05
movement speed150
vision radius120
count170
attack0.09s
decay1.27s
Fireflies
Some firefly species in Southeast Asia synchronize their flashing across an
entire tree, with no leader and no signal telling them all to start at once. Each insect just
watches its neighbors and nudges its own rhythm toward theirs, and that's enough for the
whole group to fall into a shared beat.
the rule
Every firefly blinks on the same period, but each has its own
phase offset, which is where in the cycle it happens to be. A firefly's
brightness follows a wave shaped by its offset: mostly dark, with one glowing pulse per
period. A blink is the moment that pulse peaks.
how they sync
When a firefly blinks, every other firefly within vision radius nudges its own
phase offset toward it, by an amount set by sync strength. Here are two
fireflies actually doing it, live: each one's phase offset is the arrow underneath it, and
the arrow jumps the instant its firefly gets nudged by the other's blink. Once they're
synced up they scatter to fresh random phases and start over:
reading the glow
Each blink has a sharp attack (fast brighten) and a softer decay
(slower fade). Real firefly flashes turn on quicker than they fade, which is part of what
gives a single blink its shape against the dark. Here's one blink cycle, sweeping in real
time along with an actual firefly blinking on the real period:
Sharp rise up the left side of the spike, slower
fall down the right: that asymmetry is attack vs decay.
the sync number
The number in the top left is the kuramoto order parameter, the standard way
to measure how in-sync a crowd of oscillators is. Picture every firefly's phase offset as an
arrow pointing out from the center of a clock face. As time passes every arrow sweeps around
together at the real period. The dotted line marks $\theta = 0$, and an arrow
lights up with the real attack/decay shape whenever it crosses it,
exactly like an actual blink. The solid triangle is the average of all the others; it sweeps
around with them, but its length never changes. Above each diagram is that same
group as an actual population of fireflies:
not synced, order ≈ 0.5synced, order ≈ 0.99
The thin arrows are the individual fireflies; the
solid triangle is their average. Scattered arrows cancel out to almost nothing ($0$);
aligned arrows add up to nearly full length ($1$), and that length is the order parameter.