simInit
and spades
or experiment
togetherThese functions are convenience wrappers that may allow for
more efficient Caching.
Passes all arguments to simInit
, then passes the created simList
to spades
or experiment
.
simInitAndSpades(times, params, modules, objects, paths, inputs, outputs,
loadOrder, notOlderThan, debug, progress, cache, .plotInitialTime,
.saveInitialTime, ...)simInitAndExperiment(times, params, modules, objects, paths, inputs,
outputs, loadOrder, notOlderThan, replicates, dirPrefix, substrLength,
saveExperiment, experimentFile, clearSimEnv, cl, ...)
A named list of numeric simulation start and end times
(e.g., times = list(start = 0.0, end = 10.0)
).
A list of lists of the form list(moduleName=list(param1=value, param2=value))
.
See details.
A named list of character strings specifying the names
of modules to be loaded for the simulation. Note: the module name
should correspond to the R source file from which the module is loaded.
Example: a module named "caribou" will be sourced form the file
caribou.R
, located at the specified modulePath(simList)
(see below).
(optional) A vector of object names (naming objects
that are in the calling environment of
the simInit
, which is often the
.GlobalEnv
unless used programmatically
-- NOTE: this mechanism will
fail if object name is in a package dependency), or
a named list of data objects to be
passed into the simList (more reliable).
These objects will be accessible
from the simList as a normal list, e.g,. mySim$obj
.
An optional named list with up to 4 named elements,
modulePath
, inputPath
, outputPath
, and cachePath
.
See details. NOTE: Experimental feature now allows for multiple modulePath
s
to be specified in a character vector. The modules will be searched for sequentially
in the first modulePath
, then if it doesn't find it, in the second etc.
A data.frame
. Can specify from 1 to 6
columns with following column names: objectName
(character, required),
file
(character), fun
(character), package
(character),
interval
(numeric), loadTime
(numeric).
See inputs
and vignette("ii-modules") section about inputs.
A data.frame
. Can specify from 1 to 5
columns with following column names: objectName
(character, required),
file
(character), fun
(character), package
(character),
saveTime
(numeric). See outputs
and
vignette("ii-modules")
section about outputs.
An optional list of module names specifying the order in which to load the modules. If not specified, the module load order will be determined automatically.
A time, as in from Sys.time()
. This is passed into
the Cache
function that wraps .inputObjects
.
If the module uses the .useCache
parameter and it is
set to TRUE
or ".inputObjects"
,
then the .inputObjects
will be cached.
Setting notOlderThan = Sys.time()
will cause the
cached versions of .inputObjects
to be refreshed,
i.e., rerun.
Optional logical flag or character vector indicating what to print to
console at each event. See details.
Default is to use the value in getOption("spades.debug")
.
Logical (TRUE
or FALSE
show a graphical progress bar),
character ("graphical"
, "text"
) or numeric indicating
the number of update intervals to show in a graphical progress bar.
Logical. If TRUE
, then the spades
call will be cached.
This means that if the call is made again with the same simList,
then `spades`` will return the return value from the previous run
of that exact same simList. Default FALSE
. See Details.
See also the vignette on caching for examples.
Numeric. Temporarily override the .plotInitialTime
parameter for all modules. See Details.
Numeric. Temporarily override the .plotInitialTime
parameter for all modules. See Details.
Arguments passed to simInit, and spades or experiment
The number of replicates to run of the same simList
.
See details and examples.
String vector. This will be concatenated as a prefix on the directory names. See details and examples.
Numeric. While making outputPath
for each spades call, this
is the number of characters kept from each factor level.
See details and examples.
Logical. Should params, modules, inputs, sim, and resulting
experimental design be saved to a file. If TRUE are saved to a single list
called experiment
. Default TRUE.
String. Filename if saveExperiment
is TRUE; saved to
outputPath(sim)
in .RData
format. See Details.
Logical. If TRUE, then the envir(sim) of each simList in the return list is emptied. This is to reduce RAM load of large return object. Default FALSE.
A cluster object. Optional. This would generally be created using
parallel::makeCluster or equivalent. This is an alternative way, instead
of beginCluster()
, to use parallelism for this function, allowing for
more control over cluster use.
Same as spades
(a simList
) or
experiment
(list of simList
objects)
simInitAndExperiment
cannot pass modules or params to experiment
because
these are also in simInit
. If the experiment
is being used
to vary these arguments, it must be done separately (i.e., simInit
then
experiment
).