pub struct FactTracker { /* private fields */ }Expand description
Tracks which facts from the original source survive each telephone round.
Implementations§
Source§impl FactTracker
impl FactTracker
Sourcepub fn new(facts: &HashMap<String, String>) -> Self
pub fn new(facts: &HashMap<String, String>) -> Self
Create a new tracker from the original set of facts.
Sourcepub fn record_round(&mut self, tile: &Tile)
pub fn record_round(&mut self, tile: &Tile)
Record a round: check which original facts are still present in the tile.
Sourcepub fn survival_rate(&self, round: usize) -> f64
pub fn survival_rate(&self, round: usize) -> f64
Get survival rate at a specific round (fraction of facts still present).
Auto Trait Implementations§
impl Freeze for FactTracker
impl RefUnwindSafe for FactTracker
impl Send for FactTracker
impl Sync for FactTracker
impl Unpin for FactTracker
impl UnsafeUnpin for FactTracker
impl UnwindSafe for FactTracker
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