https://github.com/cran/simecol
Tip revision: ce9edb46a7228393bae544a53448f34582ccb2fa authored by Thomas Petzoldt on 30 September 2007, 00:00:00 UTC
version 0.5-2
version 0.5-2
Tip revision: ce9edb4
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)
}
)