-
Notifications
You must be signed in to change notification settings - Fork 0
How it works
For this project we had to use different types of agents that had not at all the same behavior. A small ecosystem.
So we've decided to find a general pattern design for programming our agents (and others).
We thus reached a layered design, with each layer who defined a particularity of the agent.
By corollary, the diagram of classes we used, for the model side of our application, looks like something like this.
By definition an agent is dependent on its environment but an environment doesn't know and doesn't care if there are agents who navigates it or changes it.
So, the environment layer is defined like this :
- The environment can be navigated by agents.
- The environment guarantees the smooth functioning of its physical.
- The environment considers agents as any other parties making body of it.
- The environment can generate stimuli.
It's the only layer that doesn't define directly the agents, however the agents are maked to navigate on an environment, so the environment needs to be clearly defined before programming a single agent.
An agent has several interactions with his environment and the other agents, and this layer is the accumulation of those interactions. If something needs to communicate with the agent, it must pass by the interaction layer before the agent process the message received.
So, the interaction layer is defined like this :
- The interaction layer implements all the motor functions that the agent use to interact with his environment or the other agents.
- The interaction layer implements all the sensor functions that the agent use to receive stimuli emit by the environment or the other agents.
- The interaction layer defines the stimuli that the agent can receive (An agent doesn't necessarily receive all types of stimuli).
- The interaction layer implements all methods and attribute of a body of the environment.
An agent is defined by a loop of actions that he always does, in the same order.
So, the behavior layer is defined like this :
- The behavior layer implements this loop of actions.
- The behavior layer defines in which order the actions will be done.
- The behavior layer should be thought in real time ('cause it is the only layer of the agents that can be run in parallel).

