## This file was automatically generated by odin.
## Do not edit by hand as changes will be lost.
.R6_cyst_generator <- R6::R6Class(
"odin_model",
parent_env = environment(odin::odin),
public = list(
name = "cyst_generator",
ptr = NULL,
use_dde = NULL,
## Cache:
init = NULL,
variable_order = NULL,
output_order = NULL,
output_length = NULL,
names = NULL,
transform_variables = NULL,
## Methods:
initialize = function(user = NULL, use_dde = FALSE) {
self$ptr <- .Call("cyst_generator_create", user, use_dde, PACKAGE = "EPICYST")
self$use_dde <- use_dde
self$init <- .Call("cyst_generator_initialise", self$ptr, NA_real_, PACKAGE = "EPICYST")
if (use_dde) {
loadNamespace("dde")
}
self$update_cache()
},
set_user = function(..., user = list(...)) {
.Call("r_cyst_generator_set_user", self$ptr, user, PACKAGE = "EPICYST")
self$init <- .Call("cyst_generator_initialise", self$ptr, NA_real_, PACKAGE = "EPICYST")
invisible(self$init)
},
update_cache = function() {
self$variable_order <- .Call("cyst_generator_variable_order", self$ptr, PACKAGE = "EPICYST")
self$output_order <- .Call("cyst_generator_output_order", self$ptr, PACKAGE = "EPICYST")
odin_prepare(self, FALSE)
},
deriv = function(t, y) {
.Call("cyst_generator_deriv_r", self$ptr, t, y, PACKAGE = "EPICYST")
},
initial = function(t) {
self$init
},
run = function(t, y = NULL, ..., use_names = TRUE) {
if (is.null(y)) {
y <- self$init
}
if (self$use_dde) {
ret <- dde::dopri(y, t, "cyst_generator_deriv_dde", self$ptr,
dllname="EPICYST",
n_out=self$output_length, output="cyst_generator_output_dde",
parms_are_real=FALSE, ynames = FALSE, ...)
} else {
ret <- deSolve::ode(y, t, "cyst_generator_deriv_ds", self$ptr,
initfunc = "cyst_generator_initmod_ds", dllname = "EPICYST",
nout = self$output_length,
...)
}
if (use_names) {
colnames(ret) <- self$names
} else {
colnames(ret) <- NULL
}
ret
},
contents = function() {
.Call("cyst_generator_contents", self$ptr, PACKAGE = "EPICYST")
}
))
cyst_generator <- function(E0, IPH0, IPL0, SP0, RP0, VP0, tau, SHC0, IHC0, SH0, IH0, CCC0, CTC0, HPS, PPS, dH, dP, bH, bP, dE, delta, theta, phi, alpha, eta, pil, chi, pih, epsilon, RR_cysticercosis, user = list(E0 = E0, IPH0 = IPH0, IPL0 = IPL0, SP0 = SP0, RP0 = RP0, VP0 = VP0, tau = tau, SHC0 = SHC0, IHC0 = IHC0, SH0 = SH0, IH0 = IH0, CCC0 = CCC0, CTC0 = CTC0, HPS = HPS, PPS = PPS, dH = dH, dP = dP, bH = bH, bP = bP, dE = dE, delta = delta, theta = theta, phi = phi, alpha = alpha, eta = eta, pil = pil, chi = chi, pih = pih, epsilon = epsilon, RR_cysticercosis = RR_cysticercosis), use_dde = FALSE) {
.R6_cyst_generator$new(user = user, use_dde = use_dde)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.