Flocking is a natural behaviour found in some birds, fish and flying insects that occurs when they group together while moving. Though each species has different characteristics in the movement they all show similarities. The most obvious similarity is the way these animals move locally without hitting each other while moving globally in unison as one group. Some species such as the starling is known to form groups of up to a million or more.
In this project I implemented two different algorithmic approaches developed in an attempt to recreate the natural phenomenon. The first approach called boids was developed by Craig W. Reynolds and divides the motion in a series of behaviours that when added all together result in the desired flocking behaviour. The second algorithm called PSO was developed by R.Eberhart y J. Kennedy and is an algorithm that was quickly extrapolated to optimization exercises. It works searching for the best optimal distance to a set objective at every iteration.
The video shows four different scenarios: a basic boid implementation, boid with obstacle collision, prey-predator boid, and finally PSO with obstacle collision.