pub struct DecayParams {
pub half_life: f32,
pub shape: f32,
}Expand description
Configuration for a parametric decay function.
Encapsulates the two parameters of the Weibull survival function.
Builders configure these per scoring factor via ScoringDecayConfig.
Fields§
§half_life: f32Half-life parameter τ: the value of x at which decay reaches 0.5
when shape = 1.0. Must be positive.
shape: f32Shape parameter β controlling the decay curve:
1.0= standard exponential (memoryless)> 1.0= super-exponential (sharp cutoff near τ)< 1.0= sub-exponential (heavy tail past τ)
Must be positive.
Implementations§
Source§impl DecayParams
impl DecayParams
Sourcepub fn exponential(half_life: f32) -> Self
pub fn exponential(half_life: f32) -> Self
Create params for standard exponential decay with the given half-life.
Sourcepub fn heavy_tail(half_life: f32) -> Self
pub fn heavy_tail(half_life: f32) -> Self
Create params for heavy-tail decay (useful for graph proximity).
Sourcepub fn sharp_cutoff(half_life: f32) -> Self
pub fn sharp_cutoff(half_life: f32) -> Self
Create params for sharp cutoff decay (useful for time-sensitive windows).
Trait Implementations§
Source§impl Clone for DecayParams
impl Clone for DecayParams
Source§fn clone(&self) -> DecayParams
fn clone(&self) -> DecayParams
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 Debug for DecayParams
impl Debug for DecayParams
Source§impl Default for DecayParams
impl Default for DecayParams
Source§impl<'de> Deserialize<'de> for DecayParams
impl<'de> Deserialize<'de> for DecayParams
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
Source§impl PartialEq for DecayParams
impl PartialEq for DecayParams
Source§impl Serialize for DecayParams
impl Serialize for DecayParams
impl StructuralPartialEq for DecayParams
Auto Trait Implementations§
impl Freeze for DecayParams
impl RefUnwindSafe for DecayParams
impl Send for DecayParams
impl Sync for DecayParams
impl Unpin for DecayParams
impl UnwindSafe for DecayParams
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