Learn R Programming

simecol (version 0.5-5)

sim: Simulation of 'simObj' model objects

Description

This function provides the core functionality of the `simecol' package. Several methods depending on the class of the model are available.

Usage

sim(obj, ...)
  # sim(obj, animation=FALSE, delay=0, ...)

Arguments

obj
an object of class simObj or one of its subclasses.
animation
logical value to switch animation on (for classes gridModel and rwalkModel.
delay
delay (in ms and in addition to the time needed for the simulation) between consecutive images (for gridModels) or xy-plots (for rwalkModels).
...
optional parameters passed to the solver function (e.g. hmax for lsoda).

Value

  • The function returns the complete simObj instance with the simulation results in the out slot.

Details

Objects of class rwalkModel are simulated by the default simObj method. If you derive own sublasses from simObj it may be neccessary to write an appropriate sim method and/or solver function.

Examples

Run this code
data(lv)
    plot(sim(lv))

    lv2 <- lv
    parms(lv2)["k1"] <- 0.5
    lv2 <- sim(lv2)
    plot(out(lv2))

Run the code above in your browser using DataLab