osmose.engine.processes.predation¶
Predation process.
Public API:
predation_for_cell(cell_indices, state, config, rng, n_subdt, ...)
Apply predation within a single cell. In-place on state.
enable_diet_tracking / disable_diet_tracking / get_diet_matrix
Diet-tracking helpers.
compute_size_overlap, compute_appetite, compute_feeding_stages
Utility predicates.
Test-exposed private helpers (leading underscore — not stable API):
_predation_in_cell_python, _predation_in_cell_numba
_predation_on_resources
Used by targeted tests that need to exercise a specific backend
or the resource-predation path in isolation. Tests that import
these take on the maintenance burden if signatures change.
Production code uses mortality.mortality() rather than this module directly; predation_for_cell is exposed for predation-isolated testing.
Functions
|
Return the maximum biomass a predator can eat in one sub-timestep. |
|
Return True if the predator/prey size ratio falls within [ratio_min, ratio_max). |
|
Disable diet tracking (keeps buffer for reuse). |
|
Enable per-school diet tracking with a (n_schools, n_species) matrix. |
|
Return the active diet matrix, or None if tracking is disabled. |
|
Apply predation (+ optional resource predation) within a single cell. |