| SimInf_events-class {SimInf} | R Documentation |
Class "SimInf_events"
Description
Class to hold data for scheduled events to modify the discrete state of individuals in a node at a pre-defined time t.
Slots
EEach row corresponds to one compartment in the model. The non-zero entries in a column indicates the compartments to include in an event. For the exit, internal transfer and external transfer events, a non-zero entry indicate the compartments to sample individuals from. For the enter event, all individuals enter first non-zero compartment.
Eis sparse matrix of classdgCMatrix.NDetermines how individuals in internal transfer and external transfer events are shifted to enter another compartment. Each row corresponds to one compartment in the model. The values in a column are added to the current compartment of sampled individuals to specify the destination compartment, for example, a value of
1in an entry means that sampled individuals in this compartment are moved to the next compartment. Which column to use for each event is specified by theshiftvector (see below).Nis an integer matrix.eventType of event: 0) exit, 1) enter, 2) internal transfer, and 3) external transfer. Other values are reserved for future event types and not supported by the current solvers. Integer vector.
timeTime of when the event occurs i.e., the event is processed when time is reached in the simulation.
timeis an integer vector.nodeThe node that the event operates on. Also the source node for an external transfer event. Integer vector. 1 <=
node[i]<= Number of nodes.destThe destination node for an external transfer event i.e., individuals are moved from
nodetodest, where 1 <=dest[i]<= Number of nodes. Setevent = 0for the other event types.destis an integer vector.nThe number of individuals affected by the event. Integer vector. n[i] >= 0.
proportionIf
n[i]equals zero, the number of individuals affected byevent[i]is calculated by sampling the number of individuals from a binomial distribution using theproportion[i]and the number of individuals in the compartments. Numeric vector. 0 <= proportion[i] <= 1.selectTo process
event[i], the compartments affected by the event are specified withselect[i]together with the matrixE, whereselect[i]determines which column inEto use. The specific individuals affected by the event are proportionally sampled from the compartments corresponding to the non-zero entries in the specified column inE[, select[i]], whereselectis an integer vector.shiftDetermines how individuals in internal transfer and external transfer events are shifted to enter another compartment. The sampled individuals are shifted according to column
shift[i]in matrixNi.e.,N[, shift[i]], whereshiftis an integer vector. See above for a description ofN. Unsued for the other event types.