Modular Megafauna Model 1.1.5
A physiological, dynamic herbivore simulator in C++.
Loading...
Searching...
No Matches
aggregator.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2020 W. Traylor <wolfgang.traylor@senckenberg.de>
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
11#ifndef FAUNA_OUTPUT_AGGREGATOR_H
12#define FAUNA_OUTPUT_AGGREGATOR_H
13
14#include "datapoint.h"
15
16namespace Fauna {
17// Forward Declarations
18class Date;
19
20namespace Output {
22
32 public:
34
41 void add(const Date& today, const std::string& aggregation_unit,
42 const CombinedData& output);
43
45
48 const DateInterval& get_interval() const;
49
51
56 std::vector<Datapoint> retrieve();
57
58 private:
60 Datapoint& get_datapoint(const std::string& agg_unit);
61
62 std::vector<Datapoint> datapoints;
64};
65} // namespace Output
66} // namespace Fauna
67
68#endif // FAUNA_OUTPUT_AGGREGATOR_H
Two dates framing a time interval.
Definition: date_interval.h:25
Helper class to hold an absolute simulation day.
Definition: date.h:19
Aggregates output from different simulation units over time.
Definition: aggregator.h:31
Datapoint & get_datapoint(const std::string &agg_unit)
Find the datapoint for a given aggregation unit (create it if missing).
Definition: aggregator.cpp:29
void add(const Date &today, const std::string &aggregation_unit, const CombinedData &output)
Add output data of one SimulationUnit for completed simulation day.
Definition: aggregator.cpp:20
DateInterval interval
Definition: aggregator.h:63
std::vector< Datapoint > retrieve()
Get the aggregated data and reset object state.
Definition: aggregator.cpp:53
std::vector< Datapoint > datapoints
Definition: aggregator.h:62
const DateInterval & get_interval() const
The time span covered by the currently added data.
Definition: aggregator.cpp:45
Spatially and temporally aggregated output data container.
Definition: average.h:16
Output data for herbivores and habitat(s).
Definition: combined_data.h:26
Simple container for spatially and temporally aggregated output data.
Definition: datapoint.h:31