API for the plant_resources
module
The ‘’plant_resources’’ classes provides toy plant module functionality that are required for setting up and testing the early stages of the animal module.
Classes:
|
A class implementing the Resource protocol for plant data. |
- class virtual_ecosystem.models.animals.plant_resources.PlantResources(data: Data, cell_id: int, constants: AnimalConsts)
A class implementing the Resource protocol for plant data.
This class acts as the interface between plant model data stored in the core data object using the
Resource
protocol.At present, it only exposes a single resource - the total leaf mass of the entire plant community in a cell - but this is likely to expand to allow vertical structure of plant resources, diversification to fruit and other resources and probably plant cohort specific herbivory.
- Parameters:
data – A Data object containing information from the plants model.
cell_id – The cell id for the plant community to expose.
Attributes:
The animals constants.
A reference to the core data object.
The energy (J) in a kg of plant [currently set to toy value of Alfalfa].
The maximum amount of energy that the cohort can have [J] [Alfalfa].
Whether the cohort is alive [True] or dead [False].
The mass of the plant leaf mass [kg].
The amount of energy in the plant cohort [J] [toy].
Methods:
get_eaten
(consumed_mass, herbivore, ...)This function handles herbivory on PlantResources.
- constants
The animals constants.
- data
A reference to the core data object.
- get_eaten(consumed_mass: float, herbivore: Consumer, excrement_pool: DecayPool) float
This function handles herbivory on PlantResources.
TODO: plant waste should flow to a litter pool of some kind
- Parameters:
consumed_mass – The mass intended to be consumed by the herbivore.
herbivore – The Consumer (AnimalCohort) consuming the PlantResources.
excrement_pool – The pool to which remains of uneaten plant material is added
- Returns:
The actual mass consumed by the herbivore, adjusted for efficiencies.
- stored_energy
The amount of energy in the plant cohort [J] [toy].