Class SimInf_individual_events
Source: R/SimInf_individual_events.R
SimInf_individual_events-class.RdStorage class for cleaned individual-level event data, such as
births, deaths, and movements. This class serves as an
intermediate step in the data preparation pipeline, holding raw
records that will later be aggregated into the scheduled events
(SimInf_events) required by a
SimInf_model at predefined time-points.
Details
The typical workflow is:
Collect raw individual event data (e.g., from a database).
Clean and validate it using
individual_events, which returns aSimInf_individual_eventsobject.Aggregate the individual events into node-level scheduled events for the model, for example using
u0_from_individual_eventsto derive the initial state.
Slots
idAn integer or character vector serving as a unique identifier for each individual.
eventThe type of event. Four types are supported: exit, enter, internal transfer, and external transfer. These can be specified as either a numeric code or a character string:
0or"exit": Individual leaves the system.1or"enter": Individual enters the system.2or"intTrans": Individual moves within the same node.3or"extTrans": Individual moves to a different node.
timeA numeric, character, or
Datevector indicating when the event occurred. Character strings must be coercible toDate(e.g., "2023-01-15").nodeAn integer or character vector identifying the source node for the event.
destAn integer or character vector identifying the destination node. For exit and enter events, this value is typically
NAor unused.
See also
individual_events for cleaning and processing raw
event data into this class format,
u0_from_individual_events for deriving the initial
state from these events, and SimInf_events
for the node-level aggregated event format used by the solver.