NetLogo Models Library:
This is an adaptation of the Flocking model to produce V-like formations in artificial flocks. Not all birds produce V-like formations when they flock, but they are often observed in large birds traveling together distances (e.g. migrating Canada geese). This model demonstrates simple rules that cause V-formations to occur.
Each bird starts out with a random position and heading in the world. If the bird cannot see any other birds in its limited vision range, it will continue to fly straight at its normal base speed. If it can see another bird, it follows four basic rules, given by this order of precedence.
NUMBER-OF-BIRDS sets the number of birds in the world. Use SETUP to populate the world with birds, and GO to run the model.
Vision Parameters: VISION-DISTANCE and VISION-CONE defines the radius and angle span, respectively, of the area within which a bird can see another bird. A VISION-CONE of 120 means that the bird can see up to 60 degrees to its right and 60 degrees to its left. OBSTRUCTION-CONE defines the angle span for which a bird considers its vision to be obstructed by another bird.
Motion Parameters: BASE-SPEED defines the speed that birds will fly if they are not speeding up to catch another bird that they see, or slowing down to avoid colliding with a bird. SPEED-CHANGE-FACTOR is the factor by which birds increase or decrease their speed, given as a fraction of their base speed. A BASE-SPEED of 1 with a SPEED-CHANGE-FACTOR of 0.25 means that birds will travel at speeds of 0.75 (slow speed), 1.0 (normal speed), or 1.25 (fast speed). UPDRAFT-DISTANCE defines how near to another bird one must be to take advantage of its upwash. TOO-CLOSE defines how close one bird can be to another bird before slowing down to avoid collision. MAX-TURN sets the maximum number of degrees that a bird can turn during a single tick.
Visualization Parameters: If SHOW-UNHAPPY? is switched ON, birds that have not satisfied the conditions outlined in the HOW IT WORKS section are colored red, and all the birds that have are colored white. If SHOW-UNHAPPY? is OFF, birds are colored varying shades of yellow.
After forming a vee-flock for a while, birds tend to drift apart from one another.
Birds following these rules may form flock formations other than a balanced V. These include asymmetrical (unbalanced) V shapes, echelons (diagonal lines), or inverted V shapes. In fact, imperfect formations such as these are more commonly observed than balanced vees in nature too.
Play with the sliders to see if you can get tighter flocks, looser flocks, fewer flocks, more flocks, more or less splitting and joining of flocks, more or less rearranging of birds within flocks, etc.
Does having lots of birds make it more or less likely to form good V shapes?
Can you set parameters such that running the model for a long time produces a single static flock? Or will the birds never settle down to a fixed formation?
What would happen if you put walls around the edges of the world that the birds can't fly through?
What would happen if you gave birds limited energy levels, so that flying fast would make them expend more energy and eventually become exhausted. Flying slowly, or within another bird's updraft, could allow them to recoup some energy.
Try making a 3D version of this model. What additional considerations have to be taken into account in three dimensions?
in-cone to find neighbors and determine whether their view is obstructed.
subtract-headings primitive is also useful, for turning gradually (only partway) toward some new heading.
This model is loosely based on rules introduced in the paper: Nathan, A. & Barbosa, V. C. (2008). V-like formations in flocks of artificial birds. Artificial Life, 14(2), pp. 179-188. (available at https://arxiv.org/pdf/cs/0611032.pdf)
If you mention this model or the NetLogo software in a publication, we ask that you include the citations below.
For the model itself:
Please cite the NetLogo software as:
Copyright 2009 Uri Wilensky.
This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License. To view a copy of this license, visit https://creativecommons.org/licenses/by-nc-sa/3.0/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
Commercial licenses are also available. To inquire about commercial licenses, please contact Uri Wilensky at email@example.com.