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

Our purpose is to transform access to education.

We offer a diverse selection of courses from leading universities and cultural institutions from around the world. These are delivered one step at a time, and are accessible on mobile, tablet and desktop, so you can fit learning around your life.

We believe learning should be an enjoyable, social experience, so our courses offer the opportunity to discuss what you’re learning with others as you go, helping you make fresh discoveries and form new ideas.
You can unlock new opportunities with unlimited access to hundreds of online short courses for a year by subscribing to our Unlimited package. Build your knowledge with top universities and organisations.

Learn more about how FutureLearn is transforming access to education