Skip to contents

This function matches each management strategy with its correct method. And checks for errors.

Usage

parse_MS(
  MS,
  EM_out_dir = NULL,
  EM_init_dir = NULL,
  init_loop = TRUE,
  OM_dat,
  OM_out_dir = NULL,
  verbose = FALSE,
  nyrs_assess,
  dat_yrs,
  future_om_list = NULL,
  sample_struct = NULL,
  interim_struct = NULL,
  seed = NULL
)

Arguments

MS

The management strategy to use. Current options are: "last_yr_catch" which uses the previous year's catch; "no_catch" which uses 0 catch; "EM" which uses an stock synthesis model as the estimation method and the management strategy as defined in the forecast file of the stock synthesis estimation method; "Interim" to modify catch based on survey predictions between assessments. Users can also specify their own management strategies as a function. For example, if the function is called "my_ms" then the user should specify MS = "my_ms" and specify the path to the file containing the function in custom_MS_source.

EM_out_dir

Relative or absolute path to the estimation model, if using a model outside of the SSMSE package.

EM_init_dir

Initialization director that retains the reference files for interim assessments

init_loop

Logical. If this is the first initialization loop of the MSE, init_loop should be TRUE. If it is in further loops, it should be FALSE.

OM_dat

An valid SS data file read in using r4ss. In particular, this should be sampled data.

OM_out_dir

The full path to the directory in which the OM is run.

verbose

Want verbose output? Defaults to FALSE.

nyrs_assess

The number of years between assessments. E.g., if an assessment is conducted every 3 years, put 3 here. A single integer value.

dat_yrs

Which years should be added to the new model? Ignored if init_loop is TRUE.

future_om_list

An optional list of lists including changes that should be made after the end year of the input model. Each first level list element outlines 1 change to be made to the operating model. To see an example, try running create_future_om_list. Defaults to NULL, which implies that the model will be extended forward in time assuming the original model structure.

sample_struct

A optional list including which years, seasons, and fleets should be added from the OM into the EM for different types of data. If NULL, the data structure will try to be inferred from the pattern found for each of the datatypes within the EM datafiles. Include this structure for the number of years to extend the model out. Note that the data should be specified using the list component names and column names as in would be used in r4ss::SS_readdat(). The run_SSMSE_iter function examples give an example of what this structure should be. Running the function create_sample_struct() will also produce a sample_struct object in the correct form. Can be NULL only when MS is not EM.

interim_struct

An optional including how many years to average over, fleet weights, the scaling rate (Beta) of catch relative to the index change for each fleet, and the reference year for each fleet (either a fixed year or <=0 relative to end_yr, fixed year will stay constant during simulation while relative year will progress with simulation).

seed

A random seed so that reproducible results are possible.

Author

Kathryn Doering & Nathan Vaughan