Simple flocking as a result of averaging rule vectors

In the previous simulation the rules governing flocking behaviour were illustrated using coloured vectors, however the simulation stopped short of integrating these vectors into the navigational model. The simple flocking behaviour shown in this section results from averaging the rule vectors associated with each agent and interpolating this result together with the agents current heading. At present there is no method of normalising the component vectors and this leads to jerky and often unrealistic agent movement. In further implementations of the simulation i plan on extending each agents navigational model to include acceleration constraints aimed at reducing these effects.

Integers are used to control the weightings of each rule used in the averaging process. Drastically different flocking behaviours can be observed from altering the weightings of each rule. Increasing the importance of flock centering forces the flock to proceed in single file, each agent striving to get nearer to the immediate group ahead of itself and ignoring the group immediately behind its current position due to the constraints imposed by the perception model. Increasing the weighting of the velocity matching rule forces each agent to match it's neighbours heading neglecting the desire to crowd towards the centre of the local group of neighbours. This creates a single sweeping wave of agents which scans across the face of the applet like a windscreen wiper.

It is not just the rule weightings that affect the type of flocking behaviour exhibited. The dimensions of the agent's perception area and the flexibility and magnitude of the agent's maximum speed also play a part. It is my eventual goal to allow every aspect of the simulation to be controlled dynamically via a front-end interface.