pub enum AdvancedAmountSampler {
LogNormal(LogNormalMixtureSampler),
Gaussian(GaussianMixtureSampler),
Pareto(ParetoSampler),
}Expand description
Advanced amount sampler wrapping one of the supported distribution
families. Callers keep their existing legacy [AmountSampler](super::
AmountSampler) and only consult this wrapper when
distributions.amounts.enabled (or another advanced sub-block like
distributions.pareto.enabled) is true.
v3.4.4 added the Pareto variant for heavy-tailed monetary samples
(capex, strategic contracts, fraud amounts).
Variants§
LogNormal(LogNormalMixtureSampler)
Log-normal mixture (preferred for positive monetary amounts).
Gaussian(GaussianMixtureSampler)
Gaussian mixture (useful for signed quantities like deltas).
Pareto(ParetoSampler)
Pareto heavy-tailed distribution (v3.4.4+).
Implementations§
Source§impl AdvancedAmountSampler
impl AdvancedAmountSampler
Sourcepub fn new_log_normal(
seed: u64,
config: LogNormalMixtureConfig,
) -> Result<Self, String>
pub fn new_log_normal( seed: u64, config: LogNormalMixtureConfig, ) -> Result<Self, String>
Create a log-normal-mixture sampler.
Sourcepub fn new_gaussian(
seed: u64,
config: GaussianMixtureConfig,
) -> Result<Self, String>
pub fn new_gaussian( seed: u64, config: GaussianMixtureConfig, ) -> Result<Self, String>
Create a Gaussian-mixture sampler.
Sourcepub fn new_pareto(seed: u64, config: ParetoConfig) -> Result<Self, String>
pub fn new_pareto(seed: u64, config: ParetoConfig) -> Result<Self, String>
Create a Pareto sampler (v3.4.4+).
Sourcepub fn sample_decimal(&mut self) -> Decimal
pub fn sample_decimal(&mut self) -> Decimal
Sample one amount as Decimal.
Trait Implementations§
Source§impl Clone for AdvancedAmountSampler
impl Clone for AdvancedAmountSampler
Source§fn clone(&self) -> AdvancedAmountSampler
fn clone(&self) -> AdvancedAmountSampler
Returns a duplicate 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 Freeze for AdvancedAmountSampler
impl RefUnwindSafe for AdvancedAmountSampler
impl Send for AdvancedAmountSampler
impl Sync for AdvancedAmountSampler
impl Unpin for AdvancedAmountSampler
impl UnsafeUnpin for AdvancedAmountSampler
impl UnwindSafe for AdvancedAmountSampler
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