Skip main navigation

Flocking in Nature and Machines

An example of typical cooperative behaviour is ‘flocking’, where ‘animals’ move around in formation. Sheep provide a good example of flocking in nature, where there is one leader and the rest follow. Zebras also stay together which makes them safer; it’s difficult for a predator to distinguish one zebra from the rest.

An example of typical cooperative behaviour is ‘flocking’, where ‘animals’ move around in formation. Sheep provide a good example of flocking in nature, where there is one leader and the rest follow. Zebras also stay together which makes them safer; it’s difficult for a predator to distinguish one zebra from the rest.

Fish swim together in schools. Birds provide another excellent example; geese for instance, fly in a v-formation. The ones behind are in the ‘slip stream’, and use less energy.

On motorways, lorries drive behind each other in convoy – again to use less fuel.

Flocking Behaviour in Machines

In this video demonstration a group of lab robots have been programmed to demonstrate simple flocking behaviour, using some of the rules you’ve already met.

  • The lead ‘animal’ operates in ‘avoid obstacle’ mode.
  • The others operate in ‘follow’ mode.

Watch as the robots gather behind the leader, like a convoy of ducklings lining up to follow their mother across a road.

Programmed Flocking

Craig Reynolds is a software engineer, based in California. His research centres around using computer programs to simulate complex natural phenomenon. Reynolds writes software which simulates various types of human and animal behaviour. He has developed three rules for flocking behaviour of ‘boids’ that combined, give a realistic impression of flocking birds:

  1. Separation: Steer to avoid crowding with local flock mates.
  2. Alignment: Steer toward the average heading of local flock mates.
  3. Cohesion: Steer to move toward average position of local flock mates.

In this video of the boids, at first glance, you might think you are watching birds in a cooperative behaviour display or ‘flocking’, however, on a closer inspection you will see they are artificial. Chris Langton, a pioneer in Artificial Life, explains it well:

“Boids are not birds; they are not even remotely like birds; they have no cohesive physical structure, but rather exist as information structures – processes with a computer. But – and this is the critical ‘but’ – at the level of behaviours, flocking boids and flocking birds are two instances of the same phenomenon: flocking. So these boids are examples of artificial life, ‘but not as we know it.”

What did you think of the flocking and the boids videos?

This article is from the free online

Begin Robotics

Created by
FutureLearn - Learning For Life

Reach your personal and professional goals

Unlock access to hundreds of expert online courses and degrees from top universities and educators to gain accredited qualifications and professional CV-building certificates.

Join over 18 million learners to launch, switch or build upon your career, all at your own pace, across a wide range of topic areas.

Start Learning now