logist.behavior
Interface ReactiveBehavior


public interface ReactiveBehavior

The behavior of a state-based reactive agent.

Author:
Robin Steiger

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

setup

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.

The agent argument allows you to access important information about your agent, most notably:

Parameters:
topology - The topology of the simulation
distribution - The task distribution of the simulation
agent - The properties of the agent

act

Action act(Vehicle vehicle,
           Task availableTask)
This method is called whenever the agent arrives in a new city and is not carrying a task.
The agent can see one available task in the city and decide whether or not to accept the task.

Parameters:
vehicle - The vehicle that the agent is controlling
availableTask - the proposed task or null if there is no task
Returns:
A Action.Pickup action if the task was accepted, or a Action.Move action if the task was refused.