Glide. Disagree a little more each moment. Kick, and turn. That is one fish. A school is many.
What is known. Many small fish do not swim smoothly. They kick, then glide, and they mostly change direction at the kick. This burst-and-coast swimming has been measured in schooling tetras (Calovi and colleagues, 2018, PLOS Computational Biology; cited from memory, please check).
The rule here. While a fish glides it keeps a running count, C, of how much it disagrees with what is around it: neighbours heading another way, a neighbour too close or too far, a wall ahead, food elsewhere. When C reaches the fish’s patience (π by default) it kicks, turns to a new heading, and the count starts again from zero. The new heading is an average of its neighbours’ headings and its own, and neighbours who have held their course longest count for most.
My reading. This is the CRR cycle used as a swimming rule: coherence builds, it ruptures at a threshold, and the next stretch is regenerated from the weighted past. It is a model that makes a school. It is not evidence that fish compute this, and CRR itself is under investigation.
Two other views. “Who is listening to whom” draws a line between every pair of fish within earshot, brighter where they agree. “The shared heading” shows in gold where each fish would turn if it kicked now, and in white the one heading the school holds between them. Nobody in the tank has that white line. It exists only between them.
Try. Tap the glass and watch the kicks bunch together, then spread out again. Press “Ignore the neighbours” and the school dissolves. Lower the patience and they twitch; raise it and they drift into the walls.
Left out: water flow between fish, vision cones, tiredness, hunger, and everything that makes a real fish a fish. The numbers top right are measured from this run.
This tank needs WebGL, which this browser has switched off.