logist.agent
Interface Agent

All Superinterfaces:
AgentStatistics, java.lang.Comparable<AgentStatistics>

public interface Agent
extends AgentStatistics

Collection of useful information about an agent.

A get-prefix indicates that the return value of the method may change over time. All other methods return constant values.

Author:
Robin Steiger

Method Summary
 TaskSet getTasks()
          The tasks that the agent has accepted, but not yet picked up and delivered.
 int id()
          A unique id in the range [0,numAgents).
<T> T
readProperty(java.lang.String paramName, java.lang.Class<T> clazz, T default_)
          Reads an agent property from the agents.xml file and converts it to the requested type.
 java.util.List<Vehicle> vehicles()
          The vehicles controlled by the agent
 
Methods inherited from interface logist.agent.AgentStatistics
getTotalCost, getTotalDistance, getTotalDistanceUnits, getTotalProfit, getTotalReward, getTotalTasks, name
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

id

int id()
A unique id in the range [0,numAgents). The id of each agent corresponds to the index of its bid in the table received by AuctionBehavior.auctionResult(Task,int,Long[])


vehicles

java.util.List<Vehicle> vehicles()
The vehicles controlled by the agent


getTasks

TaskSet getTasks()
The tasks that the agent has accepted, but not yet picked up and delivered.


readProperty

<T> T readProperty(java.lang.String paramName,
                   java.lang.Class<T> clazz,
                   T default_)
Reads an agent property from the agents.xml file and converts it to the requested type. Supported types are String, Boolean, Integer, Long, Color, Double, File, ClassLoader . If the property does not exist, the default value is returned (if non-null) or a RuntimeException is thrown (if default is null).

Type Parameters:
T - Type of the property
Parameters:
paramName - Name of the property
clazz - Type of the property
default_ - A default value, or null
Returns:
The agent property
Throws:
java.lang.RuntimeException - (1) if the property does not have the correct type or (2) if the property does not exist and the default value is null.