Learn R Programming

fb4package (version 2.0.0)

calculate_mortality_reproduction: Calculate daily mortality and reproduction (Mid-level - Main function)

Description

Calculates 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), and temperature_effect (increment due to thermal stress).

reproduction

NULL if no spawn pattern is defined in processed_mortality_params; otherwise a named list with weight_loss (g), energy_loss (J), spawn_fraction (0--1), and remaining_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.

Arguments

current_weight

Current fish weight (g)

temperature

Water temperature (deg C)

day_of_year

Day of year (1-365)

processed_mortality_params

List with processed mortality parameters

initial_weight

Initial weight for relative calculations (optional)

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

Run this code
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)

Run the code above in your browser using DataLab