parms {simecol}R Documentation

Accessor Functions for 'simObj' Objects

Description

Get or set simulation model parameters, main or sub-equations, initial values, time steps or solvers and extract simulation results.

Usage

   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
   
   initfunc(obj, ...)
   initfunc(obj) <- value

   out(obj, ...)
   out(obj, ...)

Arguments

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.
... Reserved for method consistency.

Details

These are the accessing functions for parms, times etc. 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). If NA is assigned to a named element in parms or init the respective element (name and value) is deleted. The function 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).

Value

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.

See Also

simecol-package.

Examples

    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)

[Package simecol version 0.4-2 Index]