|
Modular Megafauna Model 1.1.5
A physiological, dynamic herbivore simulator in C++.
|
Aggregates output from different simulation units over time. More...
#include <aggregator.h>
Public Member Functions | |
| void | add (const Date &today, const std::string &aggregation_unit, const CombinedData &output) |
| Add output data of one SimulationUnit for completed simulation day. More... | |
| const DateInterval & | get_interval () const |
| The time span covered by the currently added data. More... | |
| std::vector< Datapoint > | retrieve () |
| Get the aggregated data and reset object state. More... | |
Private Member Functions | |
| Datapoint & | get_datapoint (const std::string &agg_unit) |
| Find the datapoint for a given aggregation unit (create it if missing). More... | |
Private Attributes | |
| std::vector< Datapoint > | datapoints |
| DateInterval | interval = DateInterval(Date(0, 0), Date(0, 0)) |
Aggregates output from different simulation units over time.
Use this to aggregate output data for every day and from all simulation units until one output interval is completed and the data can be sent to the output writer.
All the Datapoint objects in this class have the same date interval because the purpose of this class is to produce one consistent set of aggregated data that is ready to be sent to output.
| void Aggregator::add | ( | const Date & | today, |
| const std::string & | aggregation_unit, | ||
| const CombinedData & | output | ||
| ) |
Add output data of one SimulationUnit for completed simulation day.
| today | Date of the given output data. |
| aggregation_unit | The identifier for spatial aggregation: Fauna::Habitat::get_aggregation_unit(). |
| output | The data from one simulation in given day: Fauna::SimulationUnit::get_output(). |
|
private |
Find the datapoint for a given aggregation unit (create it if missing).
| const DateInterval & Aggregator::get_interval | ( | ) | const |
The time span covered by the currently added data.
| std::logic_error | If no data have been added yet. |
| std::vector< Datapoint > Aggregator::retrieve | ( | ) |
Get the aggregated data and reset object state.
|
private |
|
private |