Simulation of Flocking Behavior
by Ron Kurtus (revised 22 August 2012)
The following computer simulation shows how a flock of birds or a school of fish would behave following a few simple rules. The simulation allows the you to adjust some of the parameters to see how the behavior pattern will change. It also includes the capability to add an intruder to the scene and have the members of the flock attack the intruder.
Note: This simulation was written on an older version of Java. You may see a dialog box, asking if you want to continue. Press "Run" to see the simulation.
Questions you may have include:
- What is the background of this simulation?
- What rules are involved?
- How do I vary the parameters?
This lesson will answer those questions.
Background of simulation
This simulation was developed by Israeli software developer, Ariel Dolan, as part of a study on artificial life. Dolan coined the term "Floys" to describe the artificial birds or fish in his simulation. You can find out more about his work and simulations at arieldolan.com.
The Floys follow a simple set of behavioral rules that result in a realistic group behavior. The user can adjust a number of parameters to enhance his or her study of the Floy behavior.
The user also has the option of adding an intruder or stranger to the scene. When the Floys get close enough to the stranger, they attack it.
Dolan also has more complex Floy simulations, which will be added to this site at a later date.
Rules of behavior
The rules of behavior for a flock of flying birds or a school of fish are:
- Motion is generally random
- Birds (or fish) identify their own kind
- They try to get close, but not too close
- They follow the center of gravity of the flock
To add some spice to the simulation, the possibility of aggression toward strangers has been added. Rules concerning the attitude toward strangers to the flock have been added, :
- They identify those not from the flock
- If they get close, they will attack
The rules of behavior of the strangers are:
- If attacked, run away
Use the Slower and Faster buttons to establish a comfortable speed for your computer. Try to define a smooth and peaceful behavior.
You can modify the behavior of the Floys by clicking the Properties button and changing the parameters. The Default button returns values to the default behavior.
Choose the Stranger button to insert a stranger to the scene. When the Floys get close enough to the stranger, they will chase and attack until they kill it. Then a new stranger will appear.
Use the Start button to restart the action after returning from the properties screen.
Try the simulation and perform some experiments with different parameters.
Learn through experimentation.
Resources and references
"Boids of a Feather Flock Together" by Shawn Carlson, Scientific American, November 2000
Ariel Dolan's Web Site: Artificial Life and Other Experiments - Developer of the simulation
Questions and comments
Do you have any questions, comments, or opinions on this subject? If so, send an email with your feedback. I will try to get back to you as soon as possible.
Click on a button to bookmark or share this page through Twitter, Facebook, email, or other services:
Students and researchers
The Web address of this page is:
Please include it as a link on your website or as a reference in your report, document, or thesis.
Where are you now?
Simulation of Flocking Behavior