Learn R Programming

fb4package (version 2.0.0)

process_species_parameters: Process all species parameters for simulation

Description

Main function that processes and validates all species parameters, calculating derived parameters and preparing them for simulation.

Usage

process_species_parameters(species_params, n_days = NULL)

Value

A named list containing one processed sub-list for each category present in species_params (e.g. consumption,

respiration, egestion, excretion, predator, and optionally contaminant, nutrient, mortality,

composition). Each sub-list holds the validated raw parameters plus any derived values required by the chosen equation. A

processing_info element is always appended containing

processed_at (POSIXct timestamp), validation_warnings

(character vector), and categories_processed (character vector of processed category names).

Arguments

species_params

Raw species parameters from user

n_days

Integer. Number of simulation days, used to build the predator energy density vector when `ED_ini`/`ED_end` are supplied (PREDEDEQ = 1). If `NULL` the vector length is inferred later.

Examples

Run this code
sp <- list(
  consumption = list(CEQ = 1, CA = 0.303, CB = -0.275, CQ = 0.06),
  egestion    = list(EGEQ = 1, FA = 0.16),
  excretion   = list(EXEQ = 1, UA = 0.10),
  predator    = list(PREDEDEQ = 3, Alpha1 = 4800, Beta1 = 0.1),
  respiration = list(REQ = 2, RA = 0.0033, RB = -0.227,
                     RQ = 0.025, RTM = 30, RTO = 18),
  activity    = list(ACT = 1.5),
  sda         = list(SDA = 0.15)
)
process_species_parameters(sp)

Run the code above in your browser using DataLab