Class ReporterModel
Defined in File reporter.h
Inheritance Relationships
Base Type
public kami::Model
(Class Model)
Class Documentation
-
class ReporterModel : public kami::Model
An abstract for generic models with a reporting capability.
See also
Public Functions
-
ReporterModel()
Constructor.
-
virtual std::unique_ptr<nlohmann::json> collect() = 0
Collect the current state of the model.
This function should collect the model’s current state. The model, 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.This is not expected to return agent data collection, as the agents’ information is collected separately.
-
virtual unsigned int get_step_id()
Get the step id of the model.
The step_id should probably be a monotonically incrementing integer.
-
virtual std::shared_ptr<Model> step() override
Execute a single time step of the model.
This method will collect all the
Agent
s in thePopulation
associated with the model and pass them to the associatedScheduler
for stepping. After scheduling, this method will run the collect() for theReporter
associated with this model.- Returns
a shared pointer to the model instance
-
std::unique_ptr<nlohmann::json> report()
Get the current report.
This method will return an object containg the data collected to that point in the simulation.
- Returns
a unique pointer to a
nlohmann::json
object representing the current report
-
ReporterModel()