This application simulates agents operating in an environment.
I origanally developed this application as an assignment for the AI and Games module which was part of the BSc in Computer Science I was studying.
There are two types of agent:
- Workers dipicted as blue squares.
- Grazers dipicted as yellow squares.
The worker agents have the following behaviour:
- Search the environment.
- Avoid obsticals.
- Gather resources.
- Return resources to their home (a white square).
- Remove grazer agents from the environment.
The grazer agents have the following behaviour:
- Search the environment.
- Avoid obsticals.
- Gather resources.
- Evade worker agents.
In order to get a better idea of how the agents are moving I included vector lines. Each agent has two vector lines:
- The green vector line shows the current direction that the agent is moving.
- The red vector line shows the desired direction that the agent wants to move to.
The user of the application can do the following:
- Turn the vector lines off or on by pressing 'V'.
- Quit the simulation by pressing 'Esc'.
There is a problem with the collision detection. When an agent moves near a corner of an obstical the agent can get stuck on the corner. I have left this in as it can produce some interesting behaviour.