View source: R/12-simulation-engine.R
| run_fb4_simulation | R Documentation |
Main simulation function that executes the complete FB4 model day by day. Handles different consumption methods and optional daily output. Performs basic validation of critical parameters.
run_fb4_simulation(
consumption_method,
processed_simulation_data,
oxycal = 13560,
output_daily = TRUE,
verbose = FALSE
)
consumption_method |
List with method type and value |
processed_simulation_data |
Complete processed simulation data from prepare_simulation_data() |
oxycal |
Oxycalorific coefficient (J/g O2), default 13560 |
output_daily |
Whether to save daily outputs, default TRUE |
verbose |
Whether to show progress messages, default FALSE |
A named list with up to eleven elements:
Numeric. Starting fish weight (g).
Numeric. Fish weight at end of simulation (g); minimum 0.01 g.
Numeric. Net change in weight (g).
Numeric. Relative growth as percentage of initial weight.
Numeric. Cumulative consumption over all simulated days (g prey).
Numeric. Alias for total_consumption_g
(retained for backward compatibility).
Integer. Number of days actually simulated; may be less than the full duration if mortality occurs.
List. The consumption_method supplied by the
caller.
Logical. TRUE if the simulation ran
for all requested days without early termination.
Logical. TRUE if fish weight fell to
or below 0.01 g during the simulation.
A data.frame with one row per simulated day
containing temperature, consumption, respiration, egestion, excretion,
net energy, weight, and energy density. Only present when
output_daily = TRUE.
# Requires processed simulation data; see ?prepare_simulation_data
# sim <- run_fb4_simulation(
# consumption_method = list(type = "p_value", value = 0.5),
# processed_simulation_data = sim_data
# )
# sim$final_weight
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.