pub struct PartiallyRandom { /* private fields */ }Expand description
Partial random scheduler - activates a random subset of agents each step.
Each agent is independently included with probability p. Useful for
modelling intermittent activity or sampling.
Reproducibility for a fixed RNG seed still depends on deterministic source ID enumeration before filtering.
Implementations§
Source§impl PartiallyRandom
impl PartiallyRandom
Sourcepub fn new(probability: f64) -> Self
pub fn new(probability: f64) -> Self
Create a new PartiallyRandom scheduler with the given inclusion probability.
§Panics
Does not validate probability - values outside [0, 1] will produce
unexpected results from rand::Rng::gen_bool.
Trait Implementations§
Source§impl Debug for PartiallyRandom
impl Debug for PartiallyRandom
Source§impl<M> Scheduler<M> for PartiallyRandomwhere
M: HasAgentIds + Model,
impl<M> Scheduler<M> for PartiallyRandomwhere
M: HasAgentIds + Model,
Auto Trait Implementations§
impl Freeze for PartiallyRandom
impl RefUnwindSafe for PartiallyRandom
impl Send for PartiallyRandom
impl Sync for PartiallyRandom
impl Unpin for PartiallyRandom
impl UnsafeUnpin for PartiallyRandom
impl UnwindSafe for PartiallyRandom
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