Learn R Programming

simecol (version 0.3-11)

iteration: Discrete Simulation

Description

Solver function to simulate discrete ecological (or other) dynamic models. It is normally called indirectly from sim.

Usage

iteration(obj, animate = FALSE, ...)

Arguments

obj
the simObj object to be iterated
animate
animation during the simulation
...
optional arguments passed to the plot function if animate=TRUE

Value

  • a list of the model outputs (states ...) for each timestep.

Details

The solver method iteration is used to simulate discrete event models. It creates a local environment in a way that parameters, inputs and equations are visible within the main function of the simObj. Normally, this function is run indirectly from sim.

See Also

sim, parms, lsoda, rk4.

Examples

Run this code
data(conway)
  ## plot after simulation:
  plot(sim(conway), delay=100)

  ## plot during simulation
  sim(conway, animate=TRUE, delay=100)

Run the code above in your browser using DataLab