888 animal model foraging time budget#906
Conversation
…e in AnimalCohort.
…raging time is equally distributed between dietary components.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #906 +/- ##
========================================
Coverage 93.96% 93.96%
========================================
Files 77 77
Lines 5861 5862 +1
========================================
+ Hits 5507 5508 +1
Misses 354 354 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
dalonsoa
left a comment
There was a problem hiding this comment.
Code-wise, this looks totally fine. I'm curious about the science of it, though. I bet there're diet that animals consume only as a last resort if there's nothing else available, right? I understand that might be hard to model, though.
You're absolutely right. In real life, animal diets are diversely weighted at any particular moment and, broadly, quite adaptive. I spent a big chunk of my doctoral work on this problem in herbivores. The plan for animal diets its to stage out the complexity over time, particularly as we see how run-time is looking:
We have just moved from stage 1 -> stage 2. It is currently unclear whether our final destination is stage 3 (a standard, defensible approach) or stage 4 (more state-of-the-art). Moving to an weighting system with functional groups requires some additional scientific work so I'll tackle it after the basic version is up and running. |
Description
This PR fixes a bug where the time allocated to foraging was being reused such that the more types of resources a cohort foraged on, the more time it had to forage. Each diet-type was given the full "work-day" to forage on.
The fix takes the available time and divides it equally among the different resource types of resources can forage on. So if you consume just animals, animal foraging gets the whole time. If you consume animals and plants, each get half of the time, and so on.
Changes:
DietType.count_dietary_categories()AnimalCohort.diet_category_countAnimalCohort.forage_cohort()Fixes # (issue)
Type of change
Key checklist
pre-commitchecks:$ pre-commit run -a$ poetry run pytestFurther checks