Wednesday, January 25, 2006

"Boids" and a couple of hawks

Harris hawks. On my drive to work I often find myself following flocks of pigeons wheeling around in the sky in front of me. Yesterday morning, I stopped at a red light at a very busy intersection and was watching a large flock of pigeons flying over Walgreen's, when all of a sudden the flock broke up and scattered. I saw a Harris hawk flying through the flock. Suddenly a second hawk swooped down, circled just in front of my windshield, and then flew off after its mate. I was absolutely stunned. It's the closest I've been to a hawk in the wild (if you can call the middle of Tucson wild).

Boids. I'm always fascinated by the formations of flocks of flying birds. Craig Reynolds studied the movement of flocks of birds and schools of fish and wrote a computer simulation "Boids." Wikipedia has a nice definition of "boids,"
Boids, developed by Craig Reynolds in 1986, is an artificial life program, simulating the flocking behaviour of birds.

As with most artificial life simulations, Boids is an example of emergent behaviour; that is, the complexity of Boids arises from the interaction of individual agents (the boids, in this case) adhering to a set of simple rules. The rules applied in the simplest Boids world are as follows:

  • separation: steer to avoid crowding local flockmates
  • alignment: steer towards the average heading of local flockmates
  • cohesion: steer to move toward the average position of local flockmates

More complex rules can be added, such as obstacle avoidance and goal seeking.

The movement of Boids can either be characterized as chaotic (splitting groups and wild behaviour) or orderly. Unexpected behaviours, such as splitting flocks and reuniting after avoiding obstacles, can be considered emergent.

The boids framework is often used in computer graphics, providing realistic-looking representations of flocks of birds and other creatures, such as schools of fish or herds of animals.

Boids work in a manner similar to cellular automata, since each boid "acts" autonomously and references a neighbourhood, as do cellular automata.

Since Craig published his first paper, there have been numerous follow-up studies and more sophisticated simulations such as the ones by Conrad Parker, where you can see the birds take off and land. (Parker 1, Parker 2).

No comments: