pub struct MixtureDistributionSchemaConfig {
pub enabled: bool,
pub distribution_type: MixtureDistributionType,
pub components: Vec<MixtureComponentConfig>,
pub min_value: f64,
pub max_value: Option<f64>,
pub decimal_places: u8,
}Expand description
Mixture model distribution configuration.
Fields§
§enabled: boolEnable mixture model for amount generation.
distribution_type: MixtureDistributionTypeDistribution type: “gaussian” or “lognormal”.
components: Vec<MixtureComponentConfig>Mixture components with weights.
min_value: f64Minimum value constraint.
max_value: Option<f64>Maximum value constraint (optional).
decimal_places: u8Decimal places for rounding.
Implementations§
Source§impl MixtureDistributionSchemaConfig
impl MixtureDistributionSchemaConfig
Sourcepub fn to_log_normal_config(&self) -> Option<LogNormalMixtureConfig>
pub fn to_log_normal_config(&self) -> Option<LogNormalMixtureConfig>
Convert this schema-level config into a [LogNormalMixtureConfig]
suitable for LogNormalMixtureSampler::new. Returns None if there
are no components (schema default is an empty list, which cannot
drive a sampler).
Callers should gate this with self.enabled before invoking.
Sourcepub fn to_gaussian_config(&self) -> Option<GaussianMixtureConfig>
pub fn to_gaussian_config(&self) -> Option<GaussianMixtureConfig>
Convert this schema-level config into a [GaussianMixtureConfig].
Returns None if there are no components.
Trait Implementations§
Source§impl Clone for MixtureDistributionSchemaConfig
impl Clone for MixtureDistributionSchemaConfig
Source§fn clone(&self) -> MixtureDistributionSchemaConfig
fn clone(&self) -> MixtureDistributionSchemaConfig
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 moreSource§impl<'de> Deserialize<'de> for MixtureDistributionSchemaConfig
impl<'de> Deserialize<'de> for MixtureDistributionSchemaConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for MixtureDistributionSchemaConfig
impl RefUnwindSafe for MixtureDistributionSchemaConfig
impl Send for MixtureDistributionSchemaConfig
impl Sync for MixtureDistributionSchemaConfig
impl Unpin for MixtureDistributionSchemaConfig
impl UnsafeUnpin for MixtureDistributionSchemaConfig
impl UnwindSafe for MixtureDistributionSchemaConfig
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