A wrapper around experiment2() that builds a fully-factorial set of
simLists from a single base simList plus alternative params / modules
/ inputs / objects, then runs them via experiment2()'s future
backend. The factorial design is built with factorialDesign().
experiment(
sim,
replicates = 1,
params,
modules,
objects = list(),
inputs,
dirPrefix = "simNum",
substrLength = 3,
saveExperiment = TRUE,
experimentFile = "experiment.RData",
clearSimEnv = FALSE,
notOlderThan,
cl,
...
)A simList, acting as the basis for the experiment.
The number of replicates to run of the same simList.
Like for SpaDES.core::simInit(), but for each parameter, provide a list of
alternative values.
Like for SpaDES.core::simInit(), but a list of module names (as strings).
Like for SpaDES.core::simInit(), but a list of named lists of named objects.
Like for SpaDES.core::simInit(), but a list of inputs data.frames.
String vector. This will be concatenated as a prefix on the directory names.
Numeric. While making outputPath for each spades call, this
is the number of characters kept from each factor level.
Logical. Should the resulting experimental design be saved to a file. Default TRUE.
String. Filename if saveExperiment is TRUE; saved to
outputPath(sim) in .RData format.
Logical. If TRUE, then the envir(sim) of each simList in the
return is emptied, to reduce RAM load. Default FALSE.
Currently unused (kept for back-compatibility).
Deprecated and ignored; control parallelism with future::plan().
Passed to experiment2() and onward to SpaDES.core::spades()
(e.g. debug, .plotInitialTime, cache, and events – see
Controlling events in experiment2()).
Invisibly, a simLists object. The experimental design list
(expDesign + expVals) is attached as an attribute named "experiment"
on the object's data environment, i.e. attr(out@.xData, "experiment"),
and is also written to experimentFile.
This function (and the simLists class it produces) was moved here from the
now-unmaintained SpaDES.experiment package. Two behavioural notes versus the
historical version: parallelism is now controlled by future::plan() rather
than a cl cluster object (the cl argument is accepted but ignored, with a
message), and the return value is a simLists object (as from
experiment2()) rather than a plain list. The experimental design table is
still saved to experimentFile and is attached to the result (see Value).