Struct sim::pandemic::model::PandemicModel
source · pub struct PandemicModel {
pop: BTreeMap<PersonID, State>,
bldgs: SharedSpace<BuildingID>,
bus_stops: SharedSpace<TransitStopID>,
buses: SharedSpace<CarID>,
person_to_bus: BTreeMap<PersonID, CarID>,
rng: XorShiftRng,
initialized: bool,
}
Fields§
§pop: BTreeMap<PersonID, State>
§bldgs: SharedSpace<BuildingID>
§bus_stops: SharedSpace<TransitStopID>
§buses: SharedSpace<CarID>
§person_to_bus: BTreeMap<PersonID, CarID>
§rng: XorShiftRng
§initialized: bool
Implementations§
source§impl PandemicModel
impl PandemicModel
pub fn new(rng: XorShiftRng) -> PandemicModel
pub(crate) fn initialize( &mut self, population: &[Person], _scheduler: &mut Scheduler )
pub fn count_sane(&self) -> usize
pub fn count_exposed(&self) -> usize
pub fn count_infected(&self) -> usize
pub fn count_recovered(&self) -> usize
pub fn count_dead(&self) -> usize
pub fn count_total(&self) -> usize
pub(crate) fn handle_event( &mut self, now: Time, ev: &Event, scheduler: &mut Scheduler )
pub(crate) fn handle_cmd( &mut self, _now: Time, cmd: Cmd, _scheduler: &mut Scheduler )
pub fn get_time(&self, person: PersonID) -> Option<Time>
pub fn is_sane(&self, person: PersonID) -> bool
pub fn is_infectious(&self, person: PersonID) -> bool
pub fn is_exposed(&self, person: PersonID) -> bool
pub fn is_recovered(&self, person: PersonID) -> bool
pub fn is_dead(&self, person: PersonID) -> bool
fn infectious_contact( &self, person: PersonID, other: PersonID ) -> Option<PersonID>
fn transmission( &mut self, now: Time, person: PersonID, other_occupants: Vec<(PersonID, Duration)>, scheduler: &mut Scheduler )
fn transition( &mut self, now: Time, person: PersonID, _scheduler: &mut Scheduler )
fn become_exposed( &mut self, now: Time, overlap: Duration, person: PersonID, _scheduler: &mut Scheduler )
Trait Implementations§
source§impl Clone for PandemicModel
impl Clone for PandemicModel
source§fn clone(&self) -> PandemicModel
fn clone(&self) -> PandemicModel
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl RefUnwindSafe for PandemicModel
impl Send for PandemicModel
impl Sync for PandemicModel
impl Unpin for PandemicModel
impl UnwindSafe for PandemicModel
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.