https://github.com/cran/simecol
Tip revision: a07065ed58309d6851c343dd1d2f89b5a35ac0ca authored by Thomas Petzoldt on 12 June 2007, 00:00:00 UTC
version 0.5
version 0.5
Tip revision: a07065e
sim.R
setGeneric("sim", function(obj, ...) standardGeneric("sim"))
setMethod("sim", "simObj",
function(obj, ...) {
out <- do.call(obj@solver, list(obj, ...))
obj@out <- out
invisible(obj)
}
)
setMethod("sim", "odeModel",
function(obj, ...) {
times <- fromtoby(obj@times)
if (obj@solver == "lsoda") {
out <- wraplsoda(obj, ...)
} else {
out <- do.call(obj@solver, list(obj, ...))
}
obj@out <- as.data.frame(out)
invisible(obj)
}
)
setMethod("sim", "gridModel",
function(obj, ...) {
times <- fromtoby(obj@times)
out <- do.call(obj@solver, list(obj, ...))
obj@out <- out
invisible(obj)
}
)