
The three main aspects of simulating flocking, as described by Craig Reynolds.

The 'detection zone' for each bird within the flock. In my assignment, I would like to have the user be able to adjust the scale of the neighborhood.

Because I opted to use ellipses instead of triangles, I named my boid object class 'humanoid' instead, since the ellipses reminded me of heads within a crowd. Each object contains vectorized velocity and acceleration units, as well as limits for speed and force.

To satisfy the first requirement of 'flocking', I needed to achieve alignment. This means that one humanoid must steer itself towards the average direction of the other humanoids in its immediate vicinity

Cohesion is similar to alignment, but also different in that rather than attaining the average velocity, a humanoid should be able to match the direction of the other humanoids in the neighborhood. In other words, I needed to get the average position of the flock

Now, to set the acceleration of the humanoids in the flock to both alignment and cohesion parameters, we just add them together.

Sliders set to respective speed, force, and field of vision variables.