pub struct CoherenceDampener { /* private fields */ }Expand description
A hysteretic soft dampener (ADR-062 D6): below dampen_below it engages and
multiplies positive scores by factor (×0.8); it only disengages once
coherence reaches recover_at. Between the two it holds its prior state —
this is “×0.8 until recovery”, never a hard gate.
Implementations§
Source§impl CoherenceDampener
impl CoherenceDampener
Sourcepub fn new() -> Self
pub fn new() -> Self
A dampener with the ADR-062 default thresholds (engage < 0.65, clear ≥ 0.85, factor 0.8).
Sourcepub fn with_thresholds(dampen_below: f32, recover_at: f32, factor: f32) -> Self
pub fn with_thresholds(dampen_below: f32, recover_at: f32, factor: f32) -> Self
A dampener with explicit thresholds. recover_at should be ≥
dampen_below for the hysteresis band to make sense.
Sourcepub fn observe(&mut self, coherence: f32) -> bool
pub fn observe(&mut self, coherence: f32) -> bool
Feed the latest coherence read; updates the engaged/cleared state with hysteresis and returns whether the dampener is now engaged.
Sourcepub fn is_dampened(&self) -> bool
pub fn is_dampened(&self) -> bool
Whether the dampener is currently engaged.
Trait Implementations§
Source§impl Clone for CoherenceDampener
impl Clone for CoherenceDampener
Source§impl Debug for CoherenceDampener
impl Debug for CoherenceDampener
Auto Trait Implementations§
impl Freeze for CoherenceDampener
impl RefUnwindSafe for CoherenceDampener
impl Send for CoherenceDampener
impl Sync for CoherenceDampener
impl Unpin for CoherenceDampener
impl UnsafeUnpin for CoherenceDampener
impl UnwindSafe for CoherenceDampener
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more