Initialise simulation dimension settings
Setup_Sim_Dim.RdCreates the foundational sim_list object used throughout a closed-loop
simulation or static simulation. All downstream setup
functions (Setup_Sim_Biologicals, Setup_Sim_Containers,
etc.) expect a sim_list produced by this function. Dimension scalars are
validated on input and stored alongside derived quantities such as
init_iter and the natal_region mapping.
Usage
Setup_Sim_Dim(
n_sims,
n_yrs,
n_pop = 1,
n_seas = 1,
n_regions,
natal_region = NULL,
n_ages,
n_lens = NULL,
n_obs_ages = n_ages,
n_sexes,
n_fish_fleets,
n_srv_fleets,
seasdur = if (n_seas == 1) 1 else rep(1/n_seas, n_seas),
run_feedback = FALSE,
feedback_start_yr = NULL
)Arguments
- n_sims
Positive integer. Number of simulation replicates.
- n_yrs
Positive integer. Number of projection years.
- n_pop
Positive integer. Number of distinct populations (default
1). Populations share movement and selectivity schedules but can have independent stock-recruit relationships and natal regions.- n_seas
Positive integer. Number of seasons within each year (default
1).- n_regions
Positive integer. Number of spatial regions.
- natal_region
Integer vector of length
n_popmapping each population to its natal region (1-indexed). Defaults are applied whenNULL:n_regions == 1: all populations assigned to region 1.n_pop == n_regions: one-to-one mapping (1:n_pop).n_pop == 1: assigned to region 1.
Must be supplied explicitly when
n_pop > 1,n_pop != n_regions, andn_regions > 1, as multiple populations would share a natal region and no sensible default exists.- n_ages
Positive integer. Number of modelled age classes.
- n_lens
Positive integer. Number of length bins. Set to
NULL(default) when length compositions are not simulated.- n_obs_ages
Positive integer. Number of observed age bins in composition data. Can differ from
n_ageswhen the plus group or youngest ages are pooled differently in observations. Defaults ton_ages.- n_sexes
Integer. Number of sexes; must be either
1(sex-aggregated) or2(sex-structured).- n_fish_fleets
Positive integer. Number of fishery fleets.
- n_srv_fleets
Positive integer. Number of survey fleets.
- seasdur
Numeric vector of length
n_seasgiving the duration of each season as a fraction of a year. Values must sum to 1. Defaults to1whenn_seas == 1, orrep(1 / n_seas, n_seas)for equal-length seasons otherwise.- run_feedback
Logical. Whether to run a closed-loop feedback MSE in which an estimation model and harvest control rule update fishing mortality each year. Default
FALSE(open-loop simulation).- feedback_start_yr
Integer. First year in which feedback is applied. Required when
run_feedback = TRUE; ignored otherwise.
Value
A named list (sim_list) containing:
n_sims,n_yrs,n_pop,n_regions,n_seas,n_ages,n_obs_ages,n_lens,n_sexes,n_fish_fleets,n_srv_fleetsDimension scalars supplied as inputs.
natal_regionInteger vector of length
n_popdefining natal regions.seasdurSeason durations summing to 1.
init_iterDerived value
n_ages * 10used to initialise equilibrium conditions.run_feedback,feedback_start_yrFeedback control settings.