| SimInf_model-class {SimInf} | R Documentation |
Class "SimInf_model"
Description
Class to handle data for the SimInf_model.
Slots
GDependency 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 rateineeds to be recalculated if the state transitionjoccurs. Sparse matrix (Nt \times Nt) of object classdgCMatrix.SEach column corresponds to a state transition, and execution of state transition
jamounts to adding theS[, j]column to the state vectoru[, i]of node i where the transition occurred. Sparse matrix (Nc \times Nt) of object classdgCMatrix.UThe result matrix with the number of individuals in each compartment in every node.
U[, j]contains the number of individuals in each compartment attspan[j].U[1:Nc, j]contains the number of individuals in node 1 attspan[j].U[(Nc + 1):(2 * Nc), j]contains the number of individuals in node 2 attspan[j]etc. Integer matrix (N_n N_c \timeslength(tspan)).U_sparseIf the model was configured to write the solution to a sparse matrix (
dgCMatrix) theU_sparsecontains the data andUis empty. The layout of the data inU_sparseis identical toU. Please note thatU_sparseis numeric andUis integer.VThe result matrix for the real-valued continuous state.
V[, j]contains the real-valued state of the system attspan[j]. Numeric matrix (N_ndim(ldata)[1]\timeslength(tspan)).V_sparseIf the model was configured to write the solution to a sparse matrix (
dgCMatrix) theV_sparsecontains the data andVis empty. The layout of the data inV_sparseis identical toV.ldataA matrix with local data for the nodes. The column
ldata[, j]contains the local data vector for the nodej. The local data vector is passed as an argument to the transition rate functions and the post time step function.gdataA 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.
tspanA vector of increasing time points where the state of each node is to be returned.
u0The initial state vector (
N_c \times N_n) with the number of individuals in each compartment in every node.v0The initial value for the real-valued continuous state. Numeric matrix (
dim(ldata)[1]\times N_n).eventsScheduled events
SimInf_eventsC_codeCharacter vector with optional model C code. If non-empty, the C code is written to a temporary C-file when the
runmethod 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.