pub struct ResolvedScoring {
pub half_life_days_short: f64,
pub half_life_days_mid: f64,
pub half_life_days_long: f64,
pub legacy_scoring: bool,
}Expand description
Resolved scoring values after merging config overrides with compiled
defaults. Half-lives are clamped to the range [0.1, 36_500.0] days
(≈100 years) to keep the decay math well-behaved.
Fields§
§half_life_days_short: f64§half_life_days_mid: f64§half_life_days_long: f64§legacy_scoring: boolImplementations§
Source§impl ResolvedScoring
impl ResolvedScoring
Sourcepub fn from_config(cfg: Option<&RecallScoringConfig>) -> Self
pub fn from_config(cfg: Option<&RecallScoringConfig>) -> Self
Build from optional config overrides, falling back to compiled defaults. Out-of-range values are silently clamped.
Sourcepub fn half_life_for_tier(&self, tier: &Tier) -> f64
pub fn half_life_for_tier(&self, tier: &Tier) -> f64
Half-life in days for a given tier.
Sourcepub fn decay_multiplier(&self, tier: &Tier, age_days: f64) -> f64
pub fn decay_multiplier(&self, tier: &Tier, age_days: f64) -> f64
Compute the decay multiplier exp(-ln(2) * age_days / half_life)
for a memory of the given tier and age. Returns 1.0 when
legacy_scoring is true (no decay) or when age_days is non-positive
(future timestamps, clock skew, or new memories).
Trait Implementations§
Source§impl Clone for ResolvedScoring
impl Clone for ResolvedScoring
Source§fn clone(&self) -> ResolvedScoring
fn clone(&self) -> ResolvedScoring
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 moreimpl Copy for ResolvedScoring
Source§impl Debug for ResolvedScoring
impl Debug for ResolvedScoring
Auto Trait Implementations§
impl Freeze for ResolvedScoring
impl RefUnwindSafe for ResolvedScoring
impl Send for ResolvedScoring
impl Sync for ResolvedScoring
impl Unpin for ResolvedScoring
impl UnsafeUnpin for ResolvedScoring
impl UnwindSafe for ResolvedScoring
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,
impl<T> ErasedDestructor for Twhere
T: 'static,
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