-
Notifications
You must be signed in to change notification settings - Fork 23
Home
The basic folder structure will look like this:
paper1 -> species1 -> om1-em1-note -> om
-> em
where paper1
refers to a paper ID (one of XX, XX, XX) and species1
refers to the species ID (one of cod
, flat
, sardine
), and om1-em1-note
refers to a scenario. om1
refers to the operating model ID (whatever you want to name it), em1
refers to the estimation model ID (whatever you want to name it), and note
refers to anything you want to append to the folder name for reference. The operating and estimation model IDs should match their respective folder names. om
and em
will always be named the same and will contain the operating and estimation model files. This folder structure will be created with the create_dirs()
function.
It's important we have this absolutely consistent folder naming structure so that future functions that work with the output can easily traverse the folders.
I'd suggest that to make the code user agnostic we assume that the user has set their R
working directory first and that the R
working directory is the folder that as the paper
folders. Otherwise different people won't be able to run the same code without modifying it.
I think we should also decide to use forward slashes in folder references since these are operating system agnostic.
There will be a .r
file in each paper
folder that contains all calls to the wrapper function to run the simulation. It should be theoretically possible (although it would take a long time) to run the whole simulation again by sourcing the .r
file. In general, the expectation is to call the wrapper function once per scenario. To facilitate distributed computing among multiple people and computers, there may be multiple function calls in the main .r
folder with each running different simulation runs. In the end, this will mimic the concept of having a plain text control file, but avoid us having to invent a new file format, and error check the input. We'll be able to work directly within the R
framework.
The wrapper function will take care of:
-
moving operating and estimating models to the correct folders
-
running the operating model
-
manipulating data as needed
-
renaming files and file extensions as needed
-
running the estimation model
The wrapper function will take as input an operating folder and estimating folder. It is therefore the responsibility of the user to have these generated beforehand. We went this route to make the wrapper function as generalizable as possible. We will have examples of how the R
functions can help generate these folders in a vignette.
The recruitment deviations will be in a 100x100
matrix with the columns representing different simulation runs and the rows representing years 1:100. These will be stored in a .rda
file in the R
package. They can then be easily loaded with data(recdevs)
or we can have them loaded automatically with lazyload
in the package description. Sean will take care of this.
The recruitment deviations will be generated as N(0, 1)
and will be scaled by each operating model. Kelli will write a function to find the desired standard deviation and scale the data.