Flocking birds, schooling fish, swarming bees, and
conforming humans aren't necessarily following a leader. In this simulation boids (virtual birds) follow three simple rules:
Alignment: Turn as your nearest neighbors
turns.
Cohesion: Turn to get closer to your nearest neighbor.
Separation: Turn away if too close.
Actually, there's a fourth rule: when a predator comes,
scatter.