pub struct BenfordSampler { /* private fields */ }Expand description
Sampler that produces amounts following Benford’s Law distribution.
Implementations§
Source§impl BenfordSampler
impl BenfordSampler
Sourcepub fn new(seed: u64, config: AmountDistributionConfig) -> Self
pub fn new(seed: u64, config: AmountDistributionConfig) -> Self
Create a new Benford sampler with the given seed and amount configuration.
Sourcepub fn sample_with_first_digit(&mut self, first_digit: u8) -> Decimal
pub fn sample_with_first_digit(&mut self, first_digit: u8) -> Decimal
Sample an amount with a specific first digit.
Auto Trait Implementations§
impl Freeze for BenfordSampler
impl RefUnwindSafe for BenfordSampler
impl Send for BenfordSampler
impl Sync for BenfordSampler
impl Unpin for BenfordSampler
impl UnwindSafe for BenfordSampler
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