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

Herbivore output data for one time unit. More...

#include <herbivore_data.h>

Public Attributes

Per-individual variables
double age_years = 0.0
 Age in years. More...
 
double bodyfat = 0.0
 Body fat [fraction]. More...
 
double expenditure = 0.0
 Energy expenditure [MJ/ind/day]. More...
 
Per-habitat variables
double inddens = 0.0
 Individual density [ind/km²]. More...
 
double massdens = 0.0
 Mass density [kg/km²]. More...
 
std::map< Fauna::MortalityFactor, double > mortality
 Daily mortality rate [ind/ind/day]. More...
 
double offspring = 0.0
 Newborns (offspring) per day [ind/km²/day]. More...
 
Fauna::ForageMass eaten_forage_per_ind = 0.0
 Eaten forage per individual [kgDM/ind/day]. More...
 
Fauna::ForageMass eaten_forage_per_mass = 0.0
 Eaten forage per body mass [kgDM/kg/day]. More...
 
double eaten_nitrogen_per_ind = 0.0
 Ingested nitrogen mass per individual and day [mgN/ind/day]. More...
 
Fauna::ForageEnergyContent energy_content = 0.0
 Net energy content of available forage [MJ/kgDM]. More...
 
Fauna::ForageEnergy energy_intake_per_ind = 0.0
 Intake of net energy in forage per individual [MJ/ind/day]. More...
 
Fauna::ForageEnergy energy_intake_per_mass = 0.0
 Intake of net energy in forage per herbivore mass [MJ/kg/day]. More...
 

Aggregation Functionality

HerbivoreDatamerge (const HerbivoreData &other, const double this_weight, const double other_weight)
 Aggregate data of this object with another one. More...
 
void reset ()
 Reset all member variables to initial zero values. More...
 
static HerbivoreData create_datapoint (const std::vector< HerbivoreData > data)
 Aggregate herbivore data within one habitat. More...
 
static void merge_energy_content (Fauna::ForageEnergyContent &obj1, const Fauna::ForageEnergyContent &obj2, const double weight1=1.0, const double weight2=1.0)
 Build weighted mean for net energy content, not counting zero values. More...
 

Detailed Description

Herbivore output data for one time unit.

See also
Output Classes

Member Function Documentation

◆ create_datapoint()

HerbivoreData HerbivoreData::create_datapoint ( const std::vector< HerbivoreData data)
static

Aggregate herbivore data within one habitat.

As opposed to merge(), this function is intended to combine data of one habitat in one point of time into a single data point. This can then be merged with other data points across space and time, using merge().

For variables per individual, this function creates the average (just like merge()). For variables per area or per habitat, this function creates the sum, adding up the numbers in the habitat.

In contrast to merge(), mortality is summed up, and all mortality factors are included because all merged datapoints have the same weight.

Note
Despite the name, this function has nothing to do with Output::Datapoint.
Exceptions
std::invalid_argumentIf length of vector data is zero.

◆ merge()

HerbivoreData & HerbivoreData::merge ( const HerbivoreData other,
const double  this_weight,
const double  other_weight 
)

Aggregate data of this object with another one.

This function builds averages for all member variables.

mortality : Only those factors are included in the result that are present in both objects (intersection). All other map entries are deleted. This is necessary because the statistical weight is the same for all variables.

This does no calculations if the partners are the same object, or one of the weights is zero.

Parameters
otherThe other object to be merged into this one.
this_weightWeight of this object in average building.
other_weightWeight of other in average building.
Returns
This object.
See also
Fauna::average(), Fauna::ForageValues::merge()
Exceptions
std::invalid_argumentIf either weight is not a positive number or if both are zero.

◆ merge_energy_content()

void HerbivoreData::merge_energy_content ( Fauna::ForageEnergyContent obj1,
const Fauna::ForageEnergyContent obj2,
const double  weight1 = 1.0,
const double  weight2 = 1.0 
)
static

Build weighted mean for net energy content, not counting zero values.

Don’t count zero net energy, which results from zero available forage. We need to check every forage type and build average only if energy content in obj2 is not zero.

See also
Fauna::average()

◆ reset()

void Fauna::Output::HerbivoreData::reset ( )
inline

Reset all member variables to initial zero values.

Member Data Documentation

◆ age_years

double Fauna::Output::HerbivoreData::age_years = 0.0

Age in years.

◆ bodyfat

double Fauna::Output::HerbivoreData::bodyfat = 0.0

Body fat [fraction].

◆ eaten_forage_per_ind

Fauna::ForageMass Fauna::Output::HerbivoreData::eaten_forage_per_ind = 0.0

Eaten forage per individual [kgDM/ind/day].

◆ eaten_forage_per_mass

Fauna::ForageMass Fauna::Output::HerbivoreData::eaten_forage_per_mass = 0.0

Eaten forage per body mass [kgDM/kg/day].

◆ eaten_nitrogen_per_ind

double Fauna::Output::HerbivoreData::eaten_nitrogen_per_ind = 0.0

Ingested nitrogen mass per individual and day [mgN/ind/day].

◆ energy_content

Fauna::ForageEnergyContent Fauna::Output::HerbivoreData::energy_content = 0.0

Net energy content of available forage [MJ/kgDM].

◆ energy_intake_per_ind

Fauna::ForageEnergy Fauna::Output::HerbivoreData::energy_intake_per_ind = 0.0

Intake of net energy in forage per individual [MJ/ind/day].

◆ energy_intake_per_mass

Fauna::ForageEnergy Fauna::Output::HerbivoreData::energy_intake_per_mass = 0.0

Intake of net energy in forage per herbivore mass [MJ/kg/day].

◆ expenditure

double Fauna::Output::HerbivoreData::expenditure = 0.0

Energy expenditure [MJ/ind/day].

◆ inddens

double Fauna::Output::HerbivoreData::inddens = 0.0

Individual density [ind/km²].

◆ massdens

double Fauna::Output::HerbivoreData::massdens = 0.0

Mass density [kg/km²].

◆ mortality

std::map<Fauna::MortalityFactor, double> Fauna::Output::HerbivoreData::mortality

Daily mortality rate [ind/ind/day].

◆ offspring

double Fauna::Output::HerbivoreData::offspring = 0.0

Newborns (offspring) per day [ind/km²/day].


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