Separation

The separation rule of a flocking system (also known as avoidance) ensures that boids will not collide with one another during the flocking simulation. This is achieved using a simple collision avoidance algorithm. Collision Avoidance is not the same as collision detection where a collision must occur before an action is taken. Instead the collision must never happen.

During the flocking simulation each boid will need to be aware of one or more of its flock neighbours, usually this will be its closest neighbouring boids. With awareness of other flock members a boid can apply steering force away from its neighbours when it comes within a specified separation distance. Once it has moved out of this avoidance distance, normal movement can resume.