Generates the input files for each of the Nsim simulations. Specifically, this function re-write the original input files in the True folder and:

  1. allows for considering random variation in recruitment (either by adding random variations (normally distributed) to the original recruitment deviations or by generating "new deviations",

  2. Set the maximum number of function calls to 1,

  3. call the gmacs.exe (with no estimation) to generate a new gmacsall.out file that will be used for the simulations.

The function is called for each simulation so it will generate Nsim gmacsall.out which are copy and paste in the Run folder.

GenSimFiles(
  Isim = NULL,
  OrigFiles = NULL,
  Ndev_Rec = NULL,
  SigmaR = NULL,
  DoRecDev = NULL,
  verbose = NULL,
  FunCall = TRUE,
  Dir_TPL = NULL
)

Arguments

Isim

(integer)- simulation number (1 to Nsim)

OrigFiles

(named list)- Output of the prepSim() function.

Ndev_Rec

(integer)- Number of year to which apply a deviation in recruitment

SigmaR

(numeric)- Standard deviation used in the stats::rnorm() function

DoRecDev

(logical)- if FALSE : add deviation to the original ones, if TRUE generate new deviations.

verbose

(logical)- flag to print processing information.

FunCall

(logical)- Run the executable (with no estimation) ?

Dir_TPL

(character string)- the directory where the gmacsbase.TPL file you are using for the stock assessment is hold.

Value

the SimData.out file as a named list for each simulation.