- Boids try to move into the center of the flock.
- They try to keep a small distance from other boids.
- They try to match their speed and flight direction with that of other boids in the flock.
The applet
The applet implements the 3 main rules, plus the code for avoiding walls of the "aquarium". To make the lives of boids less boring, i've added predators to the aquarium. A predator tries to move itself into the center of the flock, and when it has enough energy, it does a "sprint" towards the nearest boid (and eats it if it catches it).The Legend:
Drive to center - how eager the boids are to move towards the center of the flock.
Av. speed - how eager the boids are to align their speed and direction with that of others.
Repel - how eagerly they avoid being within Min comf distance of another boid.
Min comf distance - the minimal distance of boid from another boid at which the boid is not yet repelled by its neighbour.
Max speed - the maximum speed of a boid/predator.
Max chase speed - the maximum speed at which the predator can hunt a boid.
The applet requires Java 1.4 to run. The source code can be downloaded from here.