Skip to contents

Step Template to Create a Single Sim File per Scenarios Using the Files From netsim_scenarios

Usage

step_tmpl_merge_netsim_scenarios(
  sim_dir,
  output_dir,
  keep.transmat = TRUE,
  keep.network = TRUE,
  keep.nwstats = TRUE,
  keep.other = TRUE,
  param.error = FALSE,
  keep.diss.stats = TRUE,
  truncate.at = NULL,
  n_cores = 1,
  setup_lines = NULL,
  keep.run = TRUE,
  keep.cumulative.edgelist = FALSE,
  keep.attr.history = TRUE
)

Arguments

sim_dir

The folder where the simulation files are to be stored.

output_dir

The folder where the merged files will be stored.

keep.transmat

If TRUE, keep the transmission matrices from the original x and y elements. Note: transmission matrices only saved when (save.transmat == TRUE).

keep.network

If TRUE, keep the networkDynamic objects from the original x and y elements. Note: network only saved when (tergmLite == FALSE).

keep.nwstats

If TRUE, keep the network statistics (as set by the nwstats.formula parameter in control.net) from the original x and y elements.

keep.other

If TRUE, keep the other simulation elements (as set by the save.other parameter in control.net) from the original x and y elements. Elements with their own keep.* argument (e.g. run) follow that argument instead.

param.error

If TRUE, if x and y have different params (in param.net()) or controls (passed in control.net()) an error will prevent the merge. Use FALSE to override that check. The controls for how the runs were executed rather than what they simulated (nsims, ncores, verbose, verbose.int, and the checkpoint settings) may differ.

keep.diss.stats

If TRUE, keep diss.stats from the original x and y objects.

truncate.at

Time step at which to left-truncate the time series.

n_cores

Parallelize the process over n_cores (default = 1)

setup_lines

(optional) a vector of bash lines to be run first. This can be used to load the required modules (like R, python, etc).

keep.run

If TRUE, keep the run sublists (as set by the save.run parameter in control.net) from the original x and y elements. These are required to restart from a simulation of the merged object in netsim(), selected with get_sims().

keep.cumulative.edgelist

If TRUE, keep the cumulative edgelists (as set by the save.cumulative.edgelist parameter in control.net) from the original x and y elements. FALSE by default, as these grow with the length of the simulation.

keep.attr.history

If TRUE, keep the attribute histories (as set by record_attr_history()) from the original x and y elements.

Value

a template function to be used by add_workflow_step

Step Template

Step Templates are helper functions to be used within add_workflow_step. Some basic ones are provided by the slurmworkflow package. They instruct the workflow to run either a bash script, a set of bash lines given as a character vector or an R script. Additional Step Templates can be created to simplify specific tasks. The easiest way to do so is as wrappers around existing templates.