API for the constants module

The models.animals.constants module contains a set of dataclasses containing constants” (fitting relationships taken from the literature) required by the broader animals module

The near-future intention is to rework the relationship between these constants and the AnimalCohort objects in which they are used such that there is a FunctionalType class in-between them. This class will hold the specific scaling, rate, and conversion parameters required for determining the function of a specific AnimalCohort and will avoid frequent searches through this constants file for values.

Classes:

AnimalConsts(metabolic_rate_terms, dict[str, ...)

Dataclass to store all constants related to metabolic rates.

Data:

DECAY_FRACTION_CARCASSES

Fraction of carcass biomass that is assumed to decay rather than be consumed.

DECAY_FRACTION_EXCREMENT

Fraction of excrement that is assumed to decay rather than be consumed [unitless].

class virtual_ecosystem.models.animals.constants.AnimalConsts(metabolic_rate_terms: dict[~virtual_ecosystem.models.animals.animal_traits.MetabolicType, dict[str, tuple[float, float]]] = <factory>, damuths_law_terms: dict[~virtual_ecosystem.models.animals.animal_traits.TaxaType, dict[~virtual_ecosystem.models.animals.animal_traits.DietType, tuple[float, float]]] = <factory>, fat_mass_terms: dict[~virtual_ecosystem.models.animals.animal_traits.TaxaType, tuple[float, float]] = <factory>, muscle_mass_terms: dict[~virtual_ecosystem.models.animals.animal_traits.TaxaType, tuple[float, float]] = <factory>, intake_rate_terms: dict[~virtual_ecosystem.models.animals.animal_traits.TaxaType, tuple[float, float]] = <factory>, energy_density: dict[str, float] = <factory>, conversion_efficiency: dict[~virtual_ecosystem.models.animals.animal_traits.DietType, float] = <factory>, mechanical_efficiency: dict[~virtual_ecosystem.models.animals.animal_traits.DietType, float] = <factory>, prey_mass_scaling_terms: dict[~virtual_ecosystem.models.animals.animal_traits.MetabolicType, dict[~virtual_ecosystem.models.animals.animal_traits.TaxaType, tuple[float, float]]] = <factory>, longevity_scaling_terms: dict[~virtual_ecosystem.models.animals.animal_traits.TaxaType, tuple[float, float]] = <factory>, birth_mass_threshold: float = 1.5, flow_to_reproductive_mass_threshold: float = 1.0, dispersal_mass_threshold: float = 0.8, energy_percentile_threshold: float = 0.5, decay_fraction_excrement: float = 0.5, decay_fraction_carcasses: float = 0.2)

Dataclass to store all constants related to metabolic rates.

TODO: The entire constants fille will be reworked in this style after the energy to mass conversion.

Attributes:

M_disp_ref

The reference mass for calculating diffusive juvenile dispersal in grams.

M_herb_0

Time that it would take a herbivore of body mass equal to the reference mass, to handle one gram of autotroph biomass.

M_herb_ref

Reference mass for herbivore handling time.

M_pred_ref

The reference value for predator mass.

N_sigma_opt_pred_prey

The standard deviations of the realized attack rates around the optimal predator-prey body mass ratio for which to calculate predator specific cumulative prey densities.

V_disp

Diffusive dispersal speed on an individual of body-mass equal to M_disp_ref in km/month.

alpha_0_herb

Effective rate per unit mass at which a herbivore searches its environment.

alpha_0_pred

Effective rate per unit mass at which a predator searches its environment.

b_herb

Herbivore exponent of the power-law function relating the handling time of autotroph matter to herbivore mass.

b_pred

Carnivore exponent of the power-law relationship between the handling time of prey and the ratio of prey to predator body mass.

beta_responsive_bodymass

Ratio of current body-mass to adult body-mass at which starvation-response dispersal is attempted.

c_tol

Intercept of the relationship between monthly temperature variability and the upper critical temperature limit relative to annual mean temperature, for terrestrial ectothermic functional groups.

c_tsm

Intercept of the relationship between monthly temperature variability and the optimal temperature relative to annual mean temperature, for terrestrial ectothermic functional groups.

h_herb_0

Time that it would take a herbivore of body mass equal to the reference mass, to handle one gram of autotroph biomass

h_pred_0

Time that it would take a predator of body mass equal to the reference mass, to handle a prey individual of body mass equal to one gram.

m_tol

Slope of the relationship between monthly temperature variability and the upper critical temperature limit relative to annual mean temperature, for terrestrial ectothermic functional groups.

m_tsm

Slope of the relationship between monthly temperature variability and the optimal temperature relative to annual mean temperature, for terrestrial ectothermic functional groups.

o_disp

Power law exponent for the scaling relationship between body-mass and dispersal distance as mediated by a reference mass, M_disp_ref.

phi_herb_t

Fraction of the resource stock that is available to any one herbivore cohort.

sigma_f_t

Proportion of the time step in which it's suitable to be active for functional group f.

sigma_opt_f

The standard deviation of optimal predator-prey mass ratios among cohorts.

sigma_opt_pred_prey

Standard deviation of the normal distribution describing realized attack rates around the optimal predator-prey body mass ratio.

tau_f

Proportion of time for which functional group is active.

theta_opt_f

The mean optimal prey-predator body mass ratio, from which actual cohort optima are drawn.

theta_opt_min_f

The minimum optimal prey-predator body mass ratio.

M_disp_ref = 1.0

The reference mass for calculating diffusive juvenile dispersal in grams.

M_herb_0 = 0.7

Time that it would take a herbivore of body mass equal to the reference mass, to handle one gram of autotroph biomass.

M_herb_ref = 1.0

Reference mass for herbivore handling time.

M_pred_ref = 1.0

The reference value for predator mass.

N_sigma_opt_pred_prey = 3.0

The standard deviations of the realized attack rates around the optimal predator-prey body mass ratio for which to calculate predator specific cumulative prey densities.

V_disp = 0.0278

Diffusive dispersal speed on an individual of body-mass equal to M_disp_ref in km/month.

alpha_0_herb = 1e-11

Effective rate per unit mass at which a herbivore searches its environment.

alpha_0_pred = 1e-06

Effective rate per unit mass at which a predator searches its environment.

b_herb = 0.7

Herbivore exponent of the power-law function relating the handling time of autotroph matter to herbivore mass.

b_pred = 0.05

Carnivore exponent of the power-law relationship between the handling time of prey and the ratio of prey to predator body mass.

beta_responsive_bodymass = 0.8

Ratio of current body-mass to adult body-mass at which starvation-response dispersal is attempted.

c_tol = 6.61

Intercept of the relationship between monthly temperature variability and the upper critical temperature limit relative to annual mean temperature, for terrestrial ectothermic functional groups.

c_tsm = 1.51

Intercept of the relationship between monthly temperature variability and the optimal temperature relative to annual mean temperature, for terrestrial ectothermic functional groups.

h_herb_0 = 0.7

Time that it would take a herbivore of body mass equal to the reference mass, to handle one gram of autotroph biomass

h_pred_0 = 0.5

Time that it would take a predator of body mass equal to the reference mass, to handle a prey individual of body mass equal to one gram.

m_tol = 1.6

Slope of the relationship between monthly temperature variability and the upper critical temperature limit relative to annual mean temperature, for terrestrial ectothermic functional groups.

m_tsm = 1.53

Slope of the relationship between monthly temperature variability and the optimal temperature relative to annual mean temperature, for terrestrial ectothermic functional groups.

o_disp = 0.48

Power law exponent for the scaling relationship between body-mass and dispersal distance as mediated by a reference mass, M_disp_ref.

phi_herb_t = 0.1

Fraction of the resource stock that is available to any one herbivore cohort.

sigma_f_t = 0.5

Proportion of the time step in which it’s suitable to be active for functional group f.

sigma_opt_f = 0.02

The standard deviation of optimal predator-prey mass ratios among cohorts.

sigma_opt_pred_prey = 0.7

Standard deviation of the normal distribution describing realized attack rates around the optimal predator-prey body mass ratio.

tau_f = 0.5

Proportion of time for which functional group is active.

theta_opt_f = 0.1

The mean optimal prey-predator body mass ratio, from which actual cohort optima are drawn.

theta_opt_min_f = 0.01

The minimum optimal prey-predator body mass ratio.

virtual_ecosystem.models.animals.constants.DECAY_FRACTION_CARCASSES: float = 0.2

Fraction of carcass biomass that is assumed to decay rather than be consumed.

[unitless]. TODO - The number given here is very much made up, see DECAY_FRACTION_EXCREMENT for details of how this should be changed in future.

virtual_ecosystem.models.animals.constants.DECAY_FRACTION_EXCREMENT: float = 0.5

Fraction of excrement that is assumed to decay rather than be consumed [unitless].

TODO - The number given here is very much made up. In future, we either need to find a way of estimating this from data, or come up with a smarter way of handling this process.