parms {simecol} | R Documentation |
Get or set simulation model parameters, main or sub-equations, initial values, time steps or solvers and extract simulation results.
parms(obj) parms(obj) <- value main(obj) main(obj) <- value equations(obj) equations(obj) <- value init(obj) init(obj) <- value inputs(obj) inputs(obj) <- value times(obj) times(obj) <- value solver(obj) solver(obj) <- value out(obj)
obj |
a valid simObj instance. |
value |
named list, vector, function or other data structure (depending
on the slot and model class) with the same structure as the value returned by
parms . Either all or a subset of values (e.g. single
elements of vectors or lists can be changed at once. |
The accessor functions for parms
, times
and
The init
-method for class odeModel
allows to change
single named values (in contrast to the
whole) of the target slot. Special care has to be taken to use valid
names. In init
the
applied names must correspond to the names and number (!) of state
variables but the restrictions of parms
are less strict
(additional parameter values for ``future use'' are allowed). When
NA
is assigned to a named element in parms
or
init
the respective element (name and value) is deleted.
times
allows either to assign or to modify a special vector
with three elements named from
, to
and by
or to
overwrite times
with an un-named sequence (e.g. seq(1,
100, 0.1)
.
A list, named vector, matrix or function (for
main
slot) or list of functions (equation
slot) or other
appropriate data structure depending on the class of the model object.
data(lv) parms(lv) parms(lv) <- list(k2=0.5) parms(lv) <- list(k2=0.5, k1=0.3) parms(lv) data(conway) parms(conway) parms(conway) <- list(srv=c(2, 2)) parms(conway) # add a new named parameter value parms(lv) <- c(dummy = 1) # remove this value from the parameter vector parms(lv) <- c(dummy = NA)