Creates 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_obs_lens = n_lens,
n_caal_lens = n_lens,
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,
bias_correct_pe = "rec",
bias_correct_oe = 0
)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 modeled 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 and at-age data, the columns of
AgeingError_input. Can differ fromn_ageswhen the plus group or youngest ages are pooled differently in observations. Defaults ton_ages.- n_obs_lens
Positive integer. Number of length bins the length compositions are recorded on, the columns of
LenBinMap_inputinSetup_Sim_Biologicals. Defaults ton_lens.- n_caal_lens
Positive integer. Number of length rows of the conditional age-at-length data, the columns of
CAAL_LenBinMap_inputinSetup_Sim_Biologicals. Defaults ton_lens.- 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.- bias_correct_pe
Which log scale process deviations the operating model centers on minus half their marginal variance:
"none","rec"(default, recruitment and the initial ages) or"all"(those plus the numbers at age state).- bias_correct_oe
Whether a lognormally simulated observation is drawn at its mean rather than its median,
0(default, the median) or1. Both switches are the same onesSetup_Mod_Dimtakes, and a self test needs the same value on each side.
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_obs_lens,n_caal_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 initialize equilibrium conditions.run_feedback,feedback_start_yrFeedback control settings.