runTCSAM02: Function to run TCSAM02.

View source: R/runTCSAM02.R

runTCSAM02R Documentation

Function to run TCSAM02.

Description

This function runs a TCSAM02 model once.

Usage

runTCSAM02(
  os = "osx",
  path = ".",
  model = "tcsam02",
  path2model = "",
  configFile = "",
  pin = FALSE,
  pinFile = NULL,
  mseMode = NULL,
  minPhase = 1,
  maxPhase = NULL,
  calcOFL = FALSE,
  calcTAC = FALSE,
  HCR = 1,
  calcDynB0 = FALSE,
  hess = FALSE,
  mcmc = FALSE,
  mc.N = 1e+06,
  mc.save = 1000,
  mc.scale = 1000,
  jitter = FALSE,
  iSeed = NULL,
  saveResults = hess,
  test = FALSE,
  cleanup = TRUE,
  verbose = FALSE
)

Arguments

os
  • 'win', 'mac', 'osx', or 'linux'

path
  • path for model output

model
  • TCSAM02 model executable name

path2model
  • path to model executable

configFile
  • filename (including path) to model configuration file

pin
  • T/F to use a pin file

pinFile
  • name of pin file to use (if pin=TRUE)

mseMode
  • flag to run model in MSE mode (see getRunComands)

minPhase
  • phase to start minimization (or NULL)

maxPhase
  • final minimization phase (or NULL)

calcOFL
  • flag (T/F) to perform OFL calculations

calcTAC
  • flag (T/F) to calculate the TAC for the next fishing year

HCR
  • integer indicating the Harvest Control Rule used to calculate the TAC

calcDynB0
  • flag to calculate dynamic B0

hess
  • T/F to compute hessian (and .std file)

mcmc
  • T/F to run mcmc

mc.N
  • number of mcmc iterations to do

mc.save
  • number of iterations to skip when saving mcmc calculations

mc.scale
  • number of iterations to adjust scale for mcmc calculations

jitter
  • T/F to jitter parameters

iSeed
  • seed for random number generator (or NULL)

saveResults
  • T/F to save results to ModelResults.RData as a tcsam02.resLst object using getResLst(...)

test
  • flag (T/F) to run function in "test" mode

cleanup
  • flag (T/F) to clean up some output files

verbose
  • flag to print debugging info

Details

This function creates a shell script ('./tmp.sh') in the working directory and uses it to run a version of the TCSAM02 model.
Initial model parameters can be jittered based on the system clock time or using iSeed to set the random number generator. The iSeed and final objective function value are saved for each model run in a csv file (the value of out.csv).

If the path associated with configFile is a relative one, it should be relative to the path variable. If saveResults=TRUE, getResLSt() is used to read in the report file, prs file, and std files are read in and the resulting tcsam02.resLst object is saved to 'ModelResults.RData'. If jitter=TRUE, hess=FALSE, and cleanup=TRUE, then most output files (including the .rep files) are deleted after the model run to save disk space.

Value

  • dataframe of class 'tcam02.par', with 2 columns (name, value) with jitter iSeed (if jittered) and par file info, or NULL if par file does not exist.


wStockhausen/rTCSAM02 documentation built on June 30, 2023, 4:18 a.m.