pub struct SIRConfig {
pub population: f64,
pub initial_infected: f64,
pub initial_recovered: f64,
pub beta: f64,
pub gamma: f64,
}Expand description
Configuration for SIR model.
Fields§
§population: f64Total population size.
initial_infected: f64Initial number of infected individuals.
initial_recovered: f64Initial number of recovered individuals.
beta: f64Transmission rate (β): contacts per unit time × transmission probability.
gamma: f64Recovery rate (γ): 1 / infectious period.
Implementations§
Source§impl SIRConfig
impl SIRConfig
Sourcepub fn r0(&self) -> f64
pub fn r0(&self) -> f64
Calculate basic reproduction number R0.
Returns 0.0 if gamma is zero (no recovery → undefined R0).
Sourcepub fn herd_immunity_threshold(&self) -> f64
pub fn herd_immunity_threshold(&self) -> f64
Calculate herd immunity threshold.
Returns 0.0 if R0 is zero.
Sourcepub fn initial_susceptible(&self) -> f64
pub fn initial_susceptible(&self) -> f64
Calculate initial susceptible population.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for SIRConfig
impl<'de> Deserialize<'de> for SIRConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for SIRConfig
impl RefUnwindSafe for SIRConfig
impl Send for SIRConfig
impl Sync for SIRConfig
impl Unpin for SIRConfig
impl UnsafeUnpin for SIRConfig
impl UnwindSafe for SIRConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more