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

Equal forage distribution algorithm. More...

#include <forage_distribution_algorithms.h>

Inheritance diagram for Fauna::DistributeForageEqually:
Fauna::DistributeForage

Public Member Functions

virtual void operator() (const HabitatForage &available, ForageDistribution &forage_distribution) const
 Distribute forage equally among herbivores. More...
 
- Public Member Functions inherited from Fauna::DistributeForage
virtual void operator() (const HabitatForage &available, ForageDistribution &forage_distribution) const =0
 Distribute forage equally among herbivores. More...
 
virtual ~DistributeForage ()
 Virtual destructor. More...
 

Detailed Description

Equal forage distribution algorithm.

No direct competition. Under forage scarcity, each herbivore gets its share in proportion to its demanded forage.

Under food scarcity, the following equation holds:

\[
\frac{P_{ind}}{A} = \frac{D_{ind}}{D_{total}}
\]

  • $P_{ind}$: individual portion of one herbivore
  • $D_{ind}$: forage demanded by that herbivore
  • A: total available forage
  • $D_{total}$: sum of all forage demands
Note
There could occur precision errors leading to the sum of forage being greater than what is available. To counteract this, only a fraction of 99.9% of the available forage gets actually distributed.

Member Function Documentation

◆ operator()()

void DistributeForageEqually::operator() ( const HabitatForage available,
ForageDistribution forage_distribution 
) const
virtual

Distribute forage equally among herbivores.

No direct competition. Under forage scarcity, each herbivore gets its share in proportion to its demanded forage.

Parameters
[in]availableAvailable forage in the habitat.
[in,out]forage_distributionAs input: Demanded forage of each herbivore (see HerbivoreInterface::get_forage_demands()). As output: Forage portion for each herbivore. Unit is kgDM/km². The sum of all portions must not exceed the available forage!

Implements Fauna::DistributeForage.


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