The Boids algorithm was an artificial life program developed by Craig Reynolds in 1986 to model flocking behavior of birds. Complicated behaviors emerge from only a few simple rules:
- separation: steer to avoid crowding local flockmates
- alignment: steer towards the average heading of local flockmates
- cohesion: steer to move toward the average position (center of mass) of local flockmates
Basically, each boid considers all other boids within a set distance to be part of its flock, adjusting its own velocity to both match that of flock members in its cone of vision and attempting to avoid collisions.