public abstract class Agent extends Object implements Process, Identifiable<AgentIdentifier>
processes
.Constructor and Description |
---|
Agent() |
Modifier and Type | Method and Description |
---|---|
Timestamp |
currentTime()
Returns the timestamp that represents the current model time.
|
Attribute |
getAttribute(String name)
Returns the attribute with the respective name.
|
AgentIdentifier |
getIdentifier()
Returns the identifier of this identifiable object.
|
boolean |
hasAttribute(String name)
Checks whether an attribute with the respective name exists.
|
boolean |
hasIdentifier()
Returns whether this agent actually has an identifier.
|
void |
setAttributes(Attributes attributes)
Sets the attributes of this agent.
|
void |
setup()
This method is called before the agent is executed for the first time.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
call, hasTerminated
public void setup()
This method is called before the agent is executed for the first time. The method is empty by default. It can be overridden by inherited agent implementation in order to setup the agent (e.g., specifying its behavior).
Note that this method should be used for agent setup instead of the constructor.
Relevant configuration information (like the agent identifier
or attributes
) that might be relevant for setup
are not available during object instantiation.
public boolean hasIdentifier()
true
if the agent actually has an identifier,
false
otherwisepublic AgentIdentifier getIdentifier()
Identifiable
getIdentifier
in interface Identifiable<AgentIdentifier>
public void setAttributes(Attributes attributes)
attributes
- the attributes of this agentIllegalStateException
- if the attributes have been set alreadyNullPointerException
- if the attributes map is null
.public boolean hasAttribute(String name)
Process
hasAttribute
in interface Process
name
- the name of the attributetrue
if the attribute exists, false
otherwiseProcess.getAttribute(String)
public Attribute getAttribute(String name)
Process
null
.getAttribute
in interface Process
name
- The name of the attributeProcess.hasAttribute(String)
public Timestamp currentTime()
TimeProvider
currentTime
in interface TimeProvider
Copyright © Aimpulse Intelligent Systems GmbH
All rights reserved.