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:

PlantResources(data, cell_id, constants)

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:

constants

The animals constants.

data

A reference to the core data object.

energy_density

The energy (J) in a kg of plant [currently set to toy value of Alfalfa].

energy_max

The maximum amount of energy that the cohort can have [J] [Alfalfa].

is_alive

Whether the cohort is alive [True] or dead [False].

mass_current

The mass of the plant leaf mass [kg].

stored_energy

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.

energy_density: float

The energy (J) in a kg of plant [currently set to toy value of Alfalfa].

energy_max: float

The maximum amount of energy that the cohort can have [J] [Alfalfa].

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.

is_alive: bool

Whether the cohort is alive [True] or dead [False].

mass_current: float

The mass of the plant leaf mass [kg].

stored_energy

The amount of energy in the plant cohort [J] [toy].