public abstract class Agent extends CircularMapComponent implements DirectlyUpdatable
update(int)
will be called at every iteration in the simulation. It is assumed to be
circular, but can have a radius of 0 (which is the default).Modifier and Type | Field and Description |
---|---|
private java.lang.String[] |
log
The log value.
|
position
map
Constructor and Description |
---|
Agent(Position position)
Creates an agent at a specific
Position with a 0 radius. |
Agent(Position position,
double radius)
Creates an agent at a specific
Position . |
Modifier and Type | Method and Description |
---|---|
protected abstract <T> java.util.Collection<T> |
getObservation(java.lang.Class<T> type)
Gets an observation of a specific type.
|
void |
init()
This method is used to initialize the agent.
|
void |
setLog(java.lang.String[] log)
Sets the log value.
|
void |
update(int timeStep)
Updates the updatable element.
|
abstract boolean |
wantsToBeDestoryed()
Determines if the agent wants to be removed from the simulation.
|
java.lang.String[] |
writeLog()
Gets the log of the agent and empties it.
|
getRadius, getVectorToPosition, isLineCollision
getDistance, getPosition
isDestroyed
public Agent(Position position)
Position
with a 0 radius.position
- The position.protected abstract <T> java.util.Collection<T> getObservation(java.lang.Class<T> type)
T
- The type of observation.type
- The map component.public abstract boolean wantsToBeDestoryed()
public void init()
public void setLog(java.lang.String[] log)
log
- The log.public java.lang.String[] writeLog()