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

Base class for herbivore forage in a habitat. More...

#include <forage_base.h>

Inheritance diagram for Fauna::ForageBase:
Fauna::GrassForage

Public Member Functions

 ForageBase ()
 Constructor with zero values. More...
 
double get_digestibility () const
 Fractional digestibility of the biomass for ruminants. More...
 
double get_mass () const
 Dry matter forage biomass over the whole area [kgDM/km²]. More...
 
double get_nitrogen_mass () const
 Nitrogen mass per area [kgN/km²]. More...
 
void set_digestibility (const double d)
 Fractional digestibility of the biomass for ruminants. More...
 
void set_mass (const double dm)
 Dry matter forage biomass over the whole area [kgDM/km²]. More...
 
void set_nitrogen_mass (const double n_mass)
 Nitrogen mass per area [kgN/km²]. More...
 

Protected Member Functions

ForageBasemerge_base (const ForageBase &other, const double this_weight, const double other_weight)
 Merge this object with another one by building (weighted) means. More...
 

Private Attributes

double digestibility
 
double dry_matter_mass
 
double nitrogen_mass
 

Detailed Description

Base class for herbivore forage in a habitat.

Constructor & Destructor Documentation

◆ ForageBase()

Fauna::ForageBase::ForageBase ( )
inline

Constructor with zero values.

Member Function Documentation

◆ get_digestibility()

double Fauna::ForageBase::get_digestibility ( ) const
inline

Fractional digestibility of the biomass for ruminants.

Digestibility as measured in-vitro with rumen liquor.

◆ get_mass()

double Fauna::ForageBase::get_mass ( ) const
inline

Dry matter forage biomass over the whole area [kgDM/km²].

◆ get_nitrogen_mass()

double Fauna::ForageBase::get_nitrogen_mass ( ) const
inline

Nitrogen mass per area [kgN/km²].

◆ merge_base()

ForageBase & ForageBase::merge_base ( const ForageBase other,
const double  this_weight,
const double  other_weight 
)
protected

Merge this object with another one by building (weighted) means.

Forage mass is simply weighted with the number of data points given by this_weight and other_weight. In contrast, weighting digestibility considers also the forage mass of this and the other object. This way, merging a ForageBase object that has zero forage will disregard its digestibility.

Parameters
otherOther object to merge into this one.
this_weightNumber of data points this object aggregates.
other_weightNumber of data points the other object aggregates.
Returns
This object.
Exceptions
std::invalid_argumentThe same as average().
See also
Fauna::average().

◆ set_digestibility()

void Fauna::ForageBase::set_digestibility ( const double  d)
inline

Fractional digestibility of the biomass for ruminants.

Digestibility as measured in-vitro with rumen liquor.

Exceptions
std::invalid_argumentif not 0.0<=d<=1.0

◆ set_mass()

void ForageBase::set_mass ( const double  dm)

Dry matter forage biomass over the whole area [kgDM/km²].

Exceptions
std::invalid_argumentIf dm<0.0
std::logic_errorIf nitrogen mass > dry matter mass.

◆ set_nitrogen_mass()

void ForageBase::set_nitrogen_mass ( const double  n_mass)

Nitrogen mass per area [kgN/km²].

Exceptions
std::invalid_argumentIf n_mass < 0.0.
std::logic_errorIf nitrogen mass > dry matter mass.

Member Data Documentation

◆ digestibility

double Fauna::ForageBase::digestibility
private

◆ dry_matter_mass

double Fauna::ForageBase::dry_matter_mass
private

◆ nitrogen_mass

double Fauna::ForageBase::nitrogen_mass
private

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