setCompartments
applies given values to compartments of the model depending on the key
argument.
setCompartments(
key = NULL,
name = NULL,
type = NULL,
dimensionality = NULL,
initial_size = NULL,
initial_expression = NULL,
expression = NULL,
data = NULL,
preserve_concentrations = FALSE,
model = getCurrentModel()
)
Identify which compartment to edit by specifying it's key, as string. Also supports fragments of keys, if uniquely matching one compartment.
Name to set, as string.
Type ("fixed", "assignment", "ode") to set, as string.
Dimensionality to set (0D, 1D, 2D, 3D), as number.
Initial size to set, as string.
Initial expression to set, as string, finite numeric, or logical.
Expression to set, as string, finite numeric, or logical.
A data frame as given by getCompartments
which will be applied before the other arguments.
Whether changes in compartment size should keep species concentrations fixed, as flag.
If set to TRUE
, size changes will in turn affect species particle numbers. Has no effect on expressions.
A model object.
Use the key
argument to specify which compartment to modify and any of the other arguments to specify the value to set.
The function is fully vectorized.
If a NA
value is supplied, the model value is kept unchanged.
The online article on managing model entities provides some further context.
getCompartments
getCompartmentReferences
Other compartment functions:
deleteCompartment()
,
entity_finders
,
getCompartmentReferences()
,
getCompartments()
,
newCompartment()