Class ReporterAgent
Defined in File reporter.h
Inheritance Relationships
Base Type
public kami::Agent
(Class Agent)
Class Documentation
-
class ReporterAgent : public kami::Agent
A superclass for all reporting agents.
All reporting agents should subclass the
ReportingAgent
class. At a minimum, subclasses must implement thestep()
function, to execute a single time step for each agent.See also
Public Functions
-
virtual std::unique_ptr<nlohmann::json> collect() = 0
Collect the current state of the agent.
This function should collect the agent’s current state. The agent, notably, does not need to collect historical state, as the historical state is retained by the
Reporter
instance until such time asReporter::report()
is called. However, the implementation of the collect() function is up to the end user who can, ultimately, return whatever they want.The only restriction on collect is that it must return its data as a nlohmann::json JSON object. See
Reporter
for additional details.
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
-
virtual std::unique_ptr<nlohmann::json> collect() = 0