
Calculate daily mortality and reproduction (Mid-level - Main function)
Source:R/08-mortality-reproduction.R
calculate_mortality_reproduction.RdCalculates daily mortality probability and reproductive energy loss (natural mortality, fishing mortality, predation mortality, starvation, and weight-dependent survival) for a single time step.
Usage
calculate_mortality_reproduction(
current_weight,
temperature,
day_of_year,
processed_mortality_params,
initial_weight = NULL
)Value
A named list with five elements:
- mortality
Named list with seven numeric scalars (all daily rates, 0–1):
survival_rate,combined_mortality,natural_mortality,fishing_mortality,predation_mortality,weight_effect(increment to mortality due to low body weight), andtemperature_effect(increment due to thermal stress).- reproduction
NULLif no spawn pattern is defined inprocessed_mortality_params; otherwise a named list withweight_loss(g),energy_loss(J),spawn_fraction(0–1), andremaining_weight(g).- day_of_year
Integer. Day of year, as supplied.
- current_weight
Numeric. Fish weight (g), as supplied.
- temperature
Numeric. Water temperature (\(^\circ\)C), as supplied.
Experimental
Mortality rate modelling is an **experimental feature** under active development. This function can be called directly to compute daily mortality probability for a single time step, but **mortality rates are not yet integrated** into the main `run_fb4()` simulation loop. Full integration (automatic daily mortality application, population survival tracking, and result reporting) is planned for a future release. The API may change.
Note: **spawning energy loss** (reproductive cost) *is* already integrated into `run_fb4()` and applies automatically when `reproduction_data` is supplied to the `Bioenergetic` object.
Examples
params <- list(
base_mortality = 0.001,
natural_mortality = 0.001,
fishing_mortality = 0.0005,
predation_mortality = 0.0002,
weight_threshold = 10,
starvation_factor = 2,
optimal_temp = 18,
thermal_tolerance = 8,
stress_factor = 1.5,
spawn_pattern = NULL
)
calculate_mortality_reproduction(current_weight = 100, temperature = 15,
day_of_year = 180,
processed_mortality_params = params)
#> $mortality
#> $mortality$survival_rate
#> [1] 0.9983008
#>
#> $mortality$combined_mortality
#> [1] 0.0016992
#>
#> $mortality$natural_mortality
#> [1] 0.001
#>
#> $mortality$fishing_mortality
#> [1] 5e-04
#>
#> $mortality$predation_mortality
#> [1] 2e-04
#>
#> $mortality$weight_effect
#> [1] 0
#>
#> $mortality$temperature_effect
#> [1] 0
#>
#>
#> $reproduction
#> NULL
#>
#> $day_of_year
#> [1] 180
#>
#> $current_weight
#> [1] 100
#>
#> $temperature
#> [1] 15
#>