Class Agent
Defined in File agent.h
Inheritance Relationships
Derived Types
public kami::ReporterAgent
(Class ReporterAgent)public kami::StagedAgent
(Class StagedAgent)
Class Documentation
-
class Agent
A superclass for all agents.
All agents should subclass the
Agent
class. At a minimum, subclasses must implement thestep()
function, to execute a single time step for each agent.See also
Subclassed by kami::ReporterAgent, kami::StagedAgent
Public Functions
Execute a time-step for the agent.
This function should step the agent instance. Any activities that the agent should perform as part of its time step should be in this function.
- Parameters
model – a reference copy of the model
- Returns
a copy of the AgentID
Friends
-
friend bool operator==(const Agent &lhs, const Agent &rhs)
Compare if two
Agent
s are the sameAgent
.Subclasses of Agent may chose to extend this operator to tighten the restrictions on the comparison.
Note
This does not compare that two Agent instances are identical. Accordingly, this can be used to compare two instances of the same Agent at different points in its time stream.
- Parameters
lhs – is the left-hand side of the equality test.
rhs – is the right-hand side of the equality test.
- Returns
true is they are equal and false if not.
-
friend bool operator!=(const Agent &lhs, const Agent &rhs)
Compare if two
Agent
s are not the sameAgent
.Subclasses of
Agent
may chose to extend this operator to tighten the restrictions on the comparison.Note
This does not compare that two Agent instances are identical. Accordingly, this can be used to compare two instances of the same
Agent
at different points in its time stream.- Parameters
lhs – is the left-hand side of the equality test.
rhs – is the right-hand side of the equality test.
- Returns
true is they are not equal and false if they are.