pub struct SirRun {
pub times: Vec<f64>,
pub susceptible: Vec<i64>,
pub infected: Vec<i64>,
pub recovered: Vec<i64>,
}Expand description
The outcome of one run of the SIR epidemic model (the owned counterpart of
igraph_sir_t), as returned by Graph::sir.
The four vectors have the same length: entry k describes the state of
the population right after the k-th event (an infection or a recovery).
Entry 0 is the initial state, at time 0, with a single infected
individual; the last entry is the moment the last infected individual
recovers. At every step susceptible + infected + recovered equals the
number of vertices of the graph.
Fields§
§times: Vec<f64>The (continuous) times of the events, starting at 0.0, non-decreasing.
susceptible: Vec<i64>Number of susceptible individuals after each event.
infected: Vec<i64>Number of infected individuals after each event.
recovered: Vec<i64>Number of recovered individuals after each event.
Implementations§
Source§impl SirRun
impl SirRun
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Whether no state was recorded (never the case for runs produced by igraph).
Sourcepub fn duration(&self) -> f64
pub fn duration(&self) -> f64
The time at which the epidemic died out (the time of the last event).
Sourcepub fn final_size(&self) -> i64
pub fn final_size(&self) -> i64
The final size of the epidemic: how many individuals were ever infected (they have all recovered at the end).
Sourcepub fn peak_infected(&self) -> i64
pub fn peak_infected(&self) -> i64
The largest number of simultaneously infected individuals.