Modular Megafauna Model 1.1.5
A physiological, dynamic herbivore simulator in C++.
Loading...
Searching...
No Matches
Fauna::Output::CombinedData Struct Reference

Output data for herbivores and habitat(s). More...

#include <combined_data.h>

Public Member Functions

CombinedDatamerge (const CombinedData &)
 Merge other data into this object. More...
 
CombinedData reset ()
 Retrieve aggregated data and reset object. More...
 

Public Attributes

unsigned int datapoint_count = 0
 How many data points are merged in this object. More...
 
HabitatData habitat_data
 Habitat output data. More...
 
std::map< const std::string, HerbivoreDatahft_data
 Herbivore output data aggregated by output group. More...
 

Detailed Description

Output data for herbivores and habitat(s).

This can be data for one Fauna::SimulationUnit (possibly aggregated over a period of time) or for a set of spatial units (aggregated over time and space).

See also
Output Classes

Member Function Documentation

◆ merge()

CombinedData & CombinedData::merge ( const CombinedData other)

Merge other data into this object.

Use this to aggregate (=build averages) over space and time. datapoint_count is used to weigh the values in average-building.

For herbivore data (hft_data), the merge routine creates an empty HerbivoreData object as a ‘stub’ if the HFT is found in one of the merge partners, but not in the other one. This way, the averages are built correctly across habitats even if in one habitat, there are no herbivores of one type.

This does no calculations if the partners are the same object, or datapoint_count is zero in one of the two objects.

Returns
This object after merging.
See also
HerbivoreData::merge()
HabitatData::merge()

◆ reset()

CombinedData Fauna::Output::CombinedData::reset ( )
inline

Retrieve aggregated data and reset object.

Member Data Documentation

◆ datapoint_count

unsigned int Fauna::Output::CombinedData::datapoint_count = 0

How many data points are merged in this object.

◆ habitat_data

HabitatData Fauna::Output::CombinedData::habitat_data

Habitat output data.

◆ hft_data

std::map<const std::string, HerbivoreData> Fauna::Output::CombinedData::hft_data

Herbivore output data aggregated by output group.

An “output group” is typically an HFT.

See also
HerbivoreInterface::get_output_group()

The documentation for this struct was generated from the following files: