Learn R Programming

DLMtool (version 5.2)

runMSE: Run a Management Strategy Evaluation

Description

A function that runs a Management Strategy Evaluation (closed-loop simulation) for a specified operating model

Usage

runMSE(OM = DLMtool::testOM, MPs = c("AvC", "DCAC", "FMSYref", "curE",
  "matlenlim", "MRreal"), CheckMPs = FALSE, timelimit = 1, Hist = FALSE,
  ntrials = 50, fracD = 0.05, CalcBlow = TRUE, HZN = 2, Bfrac = 0.5,
  AnnualMSY = TRUE, silent = FALSE, PPD = FALSE, parallel = FALSE,
  save_name = NULL, checks = FALSE, control = NULL)

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 MP

CheckMPs

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

timelimit

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

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 Bfrac fraction of SSBMSY

HZN

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

Bfrac

The target fraction of SSBMSY for calculating Blow

AnnualMSY

Logical. Should MSY statistics be calculated for each projection year? May differ from MSY statistics from last historical year if there are changes in productivity

silent

Should messages be printed out to the console?

PPD

Logical. Should posterior predicted data be included in the MSE object Misc slot?

parallel

Logical. Should the MSE be run using parallel processing?

save_name

Character. Optional name to save parallel MSE list

checks

Logical. Run tests?

control

control options for testing and debugging

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

...

Arguments to runMSE function

Value

An object of class '>MSE

Functions

  • runMSE: Default function to use.

  • runMSErobust: 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 option 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).

See Also

joinMSE checkMSE updateMSE