Getting Started with FLAME
71
4.7 Writing a Model - Fox and Rabbit Predator Model
Simple Fox and Rabbit Model Scenario: “Foxes are chasing the rabbits, and rabbits are moving around randomly in a 2D scene”.
The above scenario describes a basic predator model, where foxes are chasing rabbits to consume them. The model writing steps include
1. Identify agents in the scenario: Fox Agent and Rabbit Agent.
2. Identify memory of each agent, based on the scenario: (Fox Memory -
x position, y position, Fox agent id), (Rabbit Memory - x position, y
position, Rabbit agent id).
3. Identify functions of agents in the scenario: (Fox function - Chase rabbit), (Rabbit function - Move randomly).
4. Identify messages being communicated between various agents: (Rabbit
location message).
5. Using the information above, draw a block representation of how the
agent would perform during one iteration of the simulation (Figure 4.3).
FIGURE 4.3: Flow diagram for the simulation describing agents, its functions and communications.
71
4.7 Writing a Model - Fox and Rabbit Predator Model
Simple Fox and Rabbit Model Scenario: “Foxes are chasing the rabbits, and rabbits are moving around randomly in a 2D scene”.
The above scenario describes a basic predator model, where foxes are chasing rabbits to consume them. The model writing steps include
1. Identify agents in the scenario: Fox Agent and Rabbit Agent.
2. Identify memory of each agent, based on the scenario: (Fox Memory -
x position, y position, Fox agent id), (Rabbit Memory - x position, y
position, Rabbit agent id).
3. Identify functions of agents in the scenario: (Fox function - Chase rabbit), (Rabbit function - Move randomly).
4. Identify messages being communicated between various agents: (Rabbit
location message).
5. Using the information above, draw a block representation of how the
agent would perform during one iteration of the simulation (Figure 4.3).
FIGURE 4.3: Flow diagram for the simulation describing agents, its functions and communications.
