The Swing interface built for the main application makes use of JFormattedTextField's and the SpringLayout manager both of which are recent additions to the Java API and remain unsupported in many browsers. With this in mind i have removed the bulk of the interface not essential to demonstrating the relationship between rules and agent behaviour.
I have included a fourth rule, "current heading", which serves to limit the maximum acceleration an agent can be subjected to. Increasing this rule smoothes the transition between agent headings and gives the flock a more graceful appearance. A good example of flocking behaviour can be observed from the following weightings:
| Rule | Weighting |
|---|---|
| Current Heading | 23% |
| Separation | 34% |
| Cohesion | 20% |
| Alignment | 23% |