pub struct AnomalyValidator {
pub max_magnitude: f64,
pub check_special_values: bool,
/* private fields */
}Expand description
Anomaly validator - automatic anomaly detection by Probar
Implements the Anomaly principle: “Automation with human touch” Detects anomalies and stops the line before defects propagate.
Fields§
§max_magnitude: f64Maximum allowed result magnitude
check_special_values: boolDetect NaN/Infinity
Implementations§
Source§impl AnomalyValidator
impl AnomalyValidator
Sourcepub const DEFAULT_MAX_MAGNITUDE: f64 = 1e100
pub const DEFAULT_MAX_MAGNITUDE: f64 = 1e100
Default maximum magnitude (f64::MAX / 2 for safety margin)
Sourcepub fn with_max_magnitude(max_magnitude: f64) -> Self
pub fn with_max_magnitude(max_magnitude: f64) -> Self
Creates a validator with custom maximum magnitude
Sourcepub fn validate(&mut self, result: f64) -> Result<f64, AnomalyViolation>
pub fn validate(&mut self, result: f64) -> Result<f64, AnomalyViolation>
Validates a calculation result (Anomaly check)
Returns the result if valid, or a violation describing the anomaly.
Sourcepub fn clear_history(&mut self)
pub fn clear_history(&mut self)
Clears the history
Sourcepub fn history_len(&self) -> usize
pub fn history_len(&self) -> usize
Returns the number of results in history
Trait Implementations§
Source§impl Clone for AnomalyValidator
impl Clone for AnomalyValidator
Source§fn clone(&self) -> AnomalyValidator
fn clone(&self) -> AnomalyValidator
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AnomalyValidator
impl Debug for AnomalyValidator
Auto Trait Implementations§
impl Freeze for AnomalyValidator
impl RefUnwindSafe for AnomalyValidator
impl Send for AnomalyValidator
impl Sync for AnomalyValidator
impl Unpin for AnomalyValidator
impl UnsafeUnpin for AnomalyValidator
impl UnwindSafe for AnomalyValidator
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