ImperialCollegeLondon / virtual_ecosystem

This repository is the home for the codebase for the Virtual Ecosystem project.
https://virtual-ecosystem.readthedocs.io
BSD 3-Clause "New" or "Revised" License
9 stars 1 forks source link

Animal - review the use of ceiling for number_dead #469

Open TaranRallings opened 3 months ago

TaranRallings commented 3 months ago

Is your feature request related to a problem? Please describe. In inflict_non_predation_mortality in animal_cohorts.py the ceil function is used to turn the continuous rate function into an integer number of dead individuals. This is a problem because the rate will always be > 0, meaning at least one individual will die every time-step. For large animals this is an unsound assumption.

Describe the solution you'd like Find a better solution than ceil for making that value an integer. For numbers below one, it may make sense to convert it to a probability of one individual dying.