View source: R/utilities-simulation.R
runSimulationBatches | R Documentation |
Run simulation batches
runSimulationBatches(
simulationBatches,
simulationRunOptions = NULL,
silentMode = FALSE,
stopIfFails = FALSE
)
simulationBatches |
List of |
simulationRunOptions |
Optional instance of a |
silentMode |
If |
stopIfFails |
Whether to stop the execution if one of the simulations failed. Default is |
Runs a set of simulation batches. The simulation batches must be populated
with sets of parameter and start values with SimulationBatch$addRunValues()
prior to running. After the run, the list of parameter and start values is cleared.
Nested list of SimulationResults
objects. The first level of the
fist are the IDs of the SimulationBatches, containing a list of
SimulationResults
for each set of parameter/initial values. If a simulation
with a parameter/initial values set fails, the result for this run is NULL
## Not run:
sim1 <- loadSimulation("sim1", loadFromCache = TRUE)
sim2 <- loadSimulation("sim2", loadFromCache = TRUE)
parameters <- c("Organism|Liver|Volume", "R1|k1")
molecules <- "Organism|Liver|A"
# Create two simulation batches.
simulationBatch1 <- createSimulationBatch(
simulation = sim1,
parametersOrPaths = parameters,
moleculesOrPaths = molecules
)
simulationBatch2 <- createSimulationBatch(
simulation = sim2,
parametersOrPaths = parameters,
moleculesOrPaths = molecules
)
# Ids of run values
ids <- c()
ids[[1]] <- simulationBatch1$addRunValues(parameterValues = c(1, 2), initialValues = 1)
ids[[2]] <- simulationBatch1$addRunValues(parameterValues = c(1.6, 2.4), initialValues = 3)
ids[[3]] <- simulationBatch2$addRunValues(parameterValues = c(4, 2), initialValues = 4)
ids[[4]] <- simulationBatch2$addRunValues(parameterValues = c(2.6, 4.4), initialValues = 5)
res <- runSimulationBatches(simulationBatches = list(simulationBatch1, simulationBatch2))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.