Skip to content

Commit

Permalink
fix, docs: get set_MSE_seeds to work in readme example
Browse files Browse the repository at this point in the history
  • Loading branch information
k-doering-NOAA committed Jul 6, 2020
1 parent 88fd356 commit 4bd2fd6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
4 changes: 1 addition & 3 deletions R/runSSMSE.R
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,12 @@ run_SSMSE <- function(scen_list = NULL,
set.seed(seed=NULL)
#Now set the global, scenario, and iteration seeds that will be used as needed
seed<-set_MSE_seeds(seed = seed,
scen_name_vec = scen_list$scen_name_vec,
iter_vec = scen_list$iter_vec)
iter_vec = iter_vec)

# Get directory of base OM files for each scenario as they may be different
rec_stddev<-rep(0,length(scen_list$scen_name_vec))
n_impl_error_groups <- rep(0,length(scen_list$scen_name_vec))
rec_autoCorr<-list()

for(i in 1:length(scen_list$scen_name_vec)){
if(!is.null(scen_list$OM_in_dir_vec)){
OM_dir <- locate_in_dirs(scen_list$OM_name_vec[i], scen_list$OM_in_dir_vec[i])
Expand Down
3 changes: 1 addition & 2 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -741,8 +741,7 @@ copy_SS_inputs <- function(dir.old = NULL,
#' @param iter_vec The number of iterations per scenario. A vector of integers
#' in the same order as scen_name_vec.
#' @returns A list of length 3 with 1) the global seed value; 2) the scenario seed values; and 3) the iteration seed values.
#' @example set_MSE_seeds(seed = seq(10, 80, by = 10),
#' iter_vec = c(2, 3))
#' @example set_MSE_seeds(seed = seq(10, 80, by = 10), iter_vec = c(2, 3))
set_MSE_seeds<-function(seed = NULL, iter_vec)
{
if(is.null(seed)){
Expand Down
2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ dir.create(run_res_path)
# run 1 iteration and 1 scenario of SSMSE using an EM.
run_SSMSE(scen_name_vec = c("H-ctl", "H-1"), # name of the scenario
out_dir_scen_vec = run_res_path, # directory in which to run the scenario
iter_list = list(1:5, 1:5), # run with 5 iterations each
iter_vec = c(5,5), # run with 5 iterations each
OM_name_vec = NULL, # specify directories instead
OM_in_dir_vec = c(cod_mod_path, normalizePath(cod_1_path)), # OM files
EM_name_vec = c("cod", "cod"), # cod is included in package data
Expand Down

0 comments on commit 4bd2fd6

Please sign in to comment.