pub struct Sampler {
pub actuation: ActuationPass,
pub budget: Budget,
}Expand description
A bounded without-replacement sampler composed from ActuationPass and Budget.
Fields§
§actuation: ActuationPassOwner of support, selection, and applied effects.
budget: BudgetOwner of the sample-size ceiling.
Implementations§
Source§impl Sampler
impl Sampler
Sourcepub fn new(distribution: Vec<u64>, sample_size: usize) -> Self
pub fn new(distribution: Vec<u64>, sample_size: usize) -> Self
Build the ActuationPass support projection and an empty sample Budget.
Sourcepub fn weight(&self, item: usize) -> u64
pub fn weight(&self, item: usize) -> u64
Read one support weight, mapping ActuationPass’s absent allocation to zero.
Sourcepub fn contains_exec(&self, item: usize) -> bool
pub fn contains_exec(&self, item: usize) -> bool
Executable selected-membership projection.
Sourcepub fn zero(&mut self, item: usize) -> bool
pub fn zero(&mut self, item: usize) -> bool
Withdraw an unselected support item through ActuationPass.Deallocate.
Sourcepub fn draw_weighted(&mut self, item: usize, entropy: u64) -> bool
pub fn draw_weighted(&mut self, item: usize, entropy: u64) -> bool
Weighted rejection over caller-supplied proposal and entropy.
Sourcepub fn draw_uniform(&mut self, item: usize) -> bool
pub fn draw_uniform(&mut self, item: usize) -> bool
Uniform-support admission over a caller-supplied proposal.
Auto Trait Implementations§
impl Freeze for Sampler
impl RefUnwindSafe for Sampler
impl Send for Sampler
impl Sync for Sampler
impl Unpin for Sampler
impl UnsafeUnpin for Sampler
impl UnwindSafe for Sampler
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