pub struct TemporalClusterGenerator { /* private fields */ }Expand description
Generator for temporal clustering.
Implementations§
Source§impl TemporalClusterGenerator
impl TemporalClusterGenerator
Sourcepub fn add_cluster(&mut self, cluster: TemporalAnomalyCluster)
pub fn add_cluster(&mut self, cluster: TemporalAnomalyCluster)
Adds a custom cluster.
Sourcepub fn get_multiplier(&self, date: NaiveDate, anomaly_type: &AnomalyType) -> f64
pub fn get_multiplier(&self, date: NaiveDate, anomaly_type: &AnomalyType) -> f64
Gets the combined rate multiplier for a date and anomaly type.
Sourcepub fn get_active_clusters(
&self,
date: NaiveDate,
) -> Vec<&TemporalAnomalyCluster>
pub fn get_active_clusters( &self, date: NaiveDate, ) -> Vec<&TemporalAnomalyCluster>
Gets active clusters for a date.
Sourcepub fn clusters(&self) -> &[TemporalAnomalyCluster]
pub fn clusters(&self) -> &[TemporalAnomalyCluster]
Returns all clusters.
Sourcepub fn set_cluster_enabled(&mut self, name: &str, enabled: bool)
pub fn set_cluster_enabled(&mut self, name: &str, enabled: bool)
Enables or disables a cluster by name.
Sourcepub fn should_inject<R: Rng>(
&self,
base_rate: f64,
date: NaiveDate,
anomaly_type: &AnomalyType,
rng: &mut R,
) -> bool
pub fn should_inject<R: Rng>( &self, base_rate: f64, date: NaiveDate, anomaly_type: &AnomalyType, rng: &mut R, ) -> bool
Determines if an anomaly should be injected based on temporal patterns.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TemporalClusterGenerator
impl RefUnwindSafe for TemporalClusterGenerator
impl Send for TemporalClusterGenerator
impl Sync for TemporalClusterGenerator
impl Unpin for TemporalClusterGenerator
impl UnwindSafe for TemporalClusterGenerator
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