Learn R Programming

DLMtool (version 5.1.3)

runMSErobust: Run a Management Strategy Evaluation

Description

Run a Management Strategy Evaluation and save out the results to a Rdata file. To increase speed and efficiency, particulary for runs with a large number simulations (nsim), the simulations are split into a number of packets. The functions loops over the packets and combines the output into a single MSE object. If the MSE model crashes during a run, the MSE is run again until it is successfully completed. The MSE is stopped if the number of consecutive crashes exceeds maxCrash. There is an ption to save the packets as Rdata files to the current working directory (default is FALSE). By default, the functions saves the completed MSE object as a Rdata file (to the current working directory).

Usage

runMSErobust(OM = DLMtool::testOM, MPs = c("AvC", "DCAC", "FMSYref", "curE",
  "matlenlim", "MRreal"), timelimit = 1, CheckMPs = FALSE, Hist = FALSE,
  ntrials = 50, fracD = 0.05, CalcBlow = FALSE, HZN = 2, Bfrac = 0.5,
  AnnualMSY = TRUE, maxsims = 64, name = NULL, unique = FALSE,
  maxCrash = 10, saveMSE = TRUE, savePack = FALSE)

Arguments

OM

An operating model object (class OM)

MPs

A vector of methods (character string) of class Output or Input.

timelimit

Maximum time taken for a method to carry out 10 reps (methods are ignored that take longer)

CheckMPs

Logical to indicate if Can function should be used to check if MPs can be run.

Hist

Should model stop after historical simulations? Returns a list containing all historical data

ntrials

Maximum of times depletion and recruitment deviations are resampled to optimize for depletion. After this the model stops if more than percent of simulations are not close to the required depletion

fracD

maximum allowed proportion of simulations where depletion is not close to sampled depletion from OM before model stops with error

CalcBlow

Should low biomass be calculated where this is the spawning biomass at which it takes HZN mean generation times of zero fishing to reach

HZN

The number of mean generation times required to reach Bfrac SSBMSY in the Blow calculation

Bfrac

fraction of SSBMSY

AnnualMSY

Logical. Should MSY statistics be calculated for each projection year?

maxsims

Maximum number of simulations per packet

name

Character string for name of saved MSE packets (if savePack=TRUE) and final MSE object. If none provided, it uses the first five letters from the OM name

unique

Logical. Should the name be unique? Current date and time appended to name.

maxCrash

Maximum number of consecutive crashes before the MSE stops

saveMSE

Logical to indicate if final MSE object should be saved to current working directory (this is probably a good idea)

savePack

Logical to indicate if packets should be save to current working directory

Value

An object of class MSE