SimInf_model
Create a SimInf_model
SimInf_model(G, S, tspan, events = NULL, ldata = NULL, gdata = NULL,
U = NULL, u0 = NULL, v0 = NULL, V = NULL, E = NULL, N = NULL,
C_code = NULL)
Dependency graph that indicates the transition rates that
need to be updated after a given state transition has occured.
A non-zero entry in element G[i, i]
indicates that
transition rate i
needs to be recalculated if the state
transition j
occurs. Sparse matrix (\(Nt \times Nt\))
of object class '>dgCMatrix
.
A vector (length >= 2) of increasing time points
where the state of each node is to be returned. Can be either
an integer
or a Date
vector. A Date
vector is coerced to a numeric vector as days, where
tspan[1]
becomes the day of the year of the first year
of tspan
. The dates are added as names to the numeric
vector.
A data.frame
with the scheduled events.
A matrix with local data for the nodes. The column
ldata[, j]
contains the local data vector for the node
j
. The local data vector is passed as an argument to
the transition rate functions and the post time step function.
A numeric vector with global data that is common to all nodes. The global data vector is passed as an argument to the transition rate functions and the post time step function.
The result matrix with the number of individuals in each
disease state in every node (\(N_n N_c \times\)
length(tspan)
). U[, j]
contains the number of
individuals in each disease state at
tspan[j]
. U[1:Nc, j]
contains the state of node
1
at tspan[j]
. U[(Nc + 1):(2 * Nc), j]
contains the state of node 2
at tspan[j]
etc.
The initial state vector. Either a matrix (\(N_c
\times N_n\)) or a a data.frame
with the number of
individuals in each compartment in every node.
The initial continuous state vector in every node.
(dim(ldata)[1]
\(\times N_N\)). The continuous state
vector is updated by the specific model during the simulation
in the post time step function.
The result matrix for the real-valued continous
compartment state (\(N_n\)dim(ldata)[1]
\(\times\)
length(tspan)
). V[, j]
contains the real-valued
state of the system at tspan[j]
.
Character vector with optional model C code. If
non-empty, the C code is written to a temporary C-file when
the run
method is called. The temporary C-file is
compiled and the resulting DLL is dynamically loaded. The DLL
is unloaded and the temporary files are removed after running
the model.