Set the values of parameters in the simulation by path
Source:R/utilities-parameter.R
setParameterValuesByPath.Rd
Set the values of parameters in the simulation by path
Usage
setParameterValuesByPath(
parameterPaths,
values,
simulation,
units = NULL,
stopIfNotFound = TRUE
)
Arguments
- parameterPaths
A single or a list of parameter path
- values
A numeric value that should be assigned to the parameters or a vector of numeric values, if the value of more than one parameter should be changed. Must have the same length as 'parameterPaths'
- simulation
Simulation uses to retrieve parameter instances from given paths.
- units
A string or a list of strings defining the units of the
values
. IfNULL
(default), values are assumed to be in base units. If notNULL
, must have the same length asquantityPaths
.- stopIfNotFound
Boolean. If
TRUE
(default) and no parameter exists for the given path, an error is thrown. IfFALSE
, a warning is shown to the user
Examples
simPath <- system.file("extdata", "simple.pkml", package = "ospsuite")
sim <- loadSimulation(simPath)
setParameterValuesByPath("Organism|Liver|Volume", 1, sim)
setParameterValuesByPath(c("Organism|Liver|Volume", "Organism|Volume"), c(2, 3), sim)