SimulationBatch | R Documentation |
An optimized simulation with faster loading. The corresponding .NET class is "OSPSuite.R.Services.ConcurrentRunSimulationBatch"
rSharp::NetObject
-> ospsuite::DotNetWrapper
-> SimulationBatch
simulation
Underlying simulation used for the batch run. Read only.
runValuesIds
Ids of the run values that will be executed on next run
id
The id of the .NET wrapped object. (read-only)
rSharp::NetObject$call()
rSharp::NetObject$finalize()
rSharp::NetObject$get()
rSharp::NetObject$getFields()
rSharp::NetObject$getMemberSignature()
rSharp::NetObject$getMethods()
rSharp::NetObject$getProperties()
rSharp::NetObject$getStaticFields()
rSharp::NetObject$getStaticMethods()
rSharp::NetObject$getStaticProperties()
rSharp::NetObject$set()
new()
Initialize a new instance of the class
SimulationBatch$new(netObject, simulation)
netObject
An rSharp::NetObject
object.
simulation
Simulation used in the batch run
A new SimulationBatch
object.
addRunValues()
Add a set of parameter and start values for next execution.
SimulationBatch$addRunValues(parameterValues = NULL, initialValues = NULL)
parameterValues
Vector of parameter values to set in the simulation (default is NULL
)
initialValues
Vector of initial values to set in the simulation (default is NULL
)
Intended for the use with runSimulationBatches
. The simulation batch is executed
with the sets of parameter and initial values that have been scheduled.
The set of run values is cleared after successful run.
Id of the values set that can be used to get the correct result from runSimulationBatches
.
\dontrun{ 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)) }
getVariableParameters()
Returns a list of parameter paths that are variable in this batch.
SimulationBatch$getVariableParameters()
The order of parameters is the same as the order of parameter
values added with $addRunValues()
method.
List of parameter paths, or NULL
if no parameter is variable.
getVariableMolecules()
Returns a list of molecules paths that are variable in this batch
SimulationBatch$getVariableMolecules()
The order of molecules is the same as the order of molecule
start values added with $addRunValues()
method.
List of parameter paths, or NULL
if no molecule is variable.
print()
Print the object to the console
SimulationBatch$print(...)
...
Additional arguments.
## ------------------------------------------------
## Method `SimulationBatch$addRunValues`
## ------------------------------------------------
## 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.