|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ReactiveBehavior
The behavior of a state-based reactive agent.
| Method Summary | |
|---|---|
Action |
act(Vehicle vehicle,
Task availableTask)
This method is called whenever the agent arrives in a new city and is not carrying a task. |
void |
setup(Topology topology,
TaskDistribution distribution,
Agent agent)
The setup method is called exactly once, before the simulation starts and before any other method is called. |
| Method Detail |
|---|
void setup(Topology topology,
TaskDistribution distribution,
Agent agent)
The agent argument allows you to access important information about your agent, most notably:
Agent.vehicles() the list of vehicles controlled
by the agentAgent.getTasks() the set of tasks that the agent
has accepted but not yet delivered
topology - The topology of the simulationdistribution - The task distribution of the simulationagent - The properties of the agent
Action act(Vehicle vehicle,
Task availableTask)
vehicle - The vehicle that the agent is controllingavailableTask - the proposed task or null if there is no task
Action.Pickup action if the task was
accepted, or a Action.Move action if the task
was refused.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||