Simulation Work Sheet

Basic Exercise

Read Craig Reynolds’ paper on steering behaviours, up to the Seek behaviour:

Take my example simulation engine and use it to implement a simulation:

In the Agent class fill in code for the appearance of the agent, and also for bouncing off the walls. Implement the Seek behaviour so that the agents move towards the position of the mouse when it is pressed.

You might want to familiarise yourself with the Processing PVector class:


Make your agents rotate to face the direction in which they are looking (you will need to calculate a rotation angle from the x and y direction of the agent’s velocity, the atan2 method is the best way to do this)

Implement other behaviours from Reynolds’ paper.

Use these methods to create a simulation of something, you can choose what.

Read up on and implement Reynolds’ flocking birds:

Create PDF    Send article as PDF to