Flocking birds in MGS

Principles

This model is inspired by a simulation of flocking birds proposed by U.Wilensky and by the development of steering behaviors of boids (generic simulated flocking creatures) invented by C. Reynolds. The algorithm we use here is roughly similar to the algorithm they uses, but it is not the same.
The idea is to mimic the flocking of birds. The resulting motion also resembles schools of fish. The flocks that appear in this model are not created or led in any way by special leader birds. Rather, each bird is following exactly the same set of rules, from which apparent flocks emerge. The basic flocking model consists of three simple steering behaviors which describe how an individual boid maneuvers based on the positions and velocities its nearby flockmates:

1. separation : when a birds is to close of a neighbor, it changes of direction
2. cohesion : when a birds is to far from one of its neighbor, it try to join quickly the fartest
3. alignment : when the neighbors of a birds are neither too far or to close, the bird chose a direction which is te average of the direction of its neighbors.

For the sake of the simplicity, the birds moves in a 2D plane. Each bird follows some direction at the same constant speed. This speed is increased when it tries to reach a neighbor to far. The neighbors of a bird in the 2D space are computed using a Delaunay triangulation (you can compute delaunay triangulation on-line thanks to this java-applet). In MGS, the Delaunay collection type is a collection of points (in an euclidean space) whose neighborhood relationships are computed by a delaunay triangulation.This collection type is used to represents the birds.

The 6 pictures below are the record of the trajectory followed by 50 birds shoot ate several time step. The position and direction followed by the birds at t=0 (first picture) are randomly choosed. After a while the trajectory tend to be organized and a flock emerges.

Click on a picture to enlarge the view.

You can download a short-movie (.avi, 2.4Mb) that shows the trajectory of the birds (the last 10 positions of each bird are pictured as a coloured bead). This file can be displayed using an avi player. We routinely use the free VLC media player which can be installed both on Unix or Windows plateform.