pub struct DecayAwareSalienceObjective {
pub decay_rate: f64,
}Expand description
Scores a NoteCandidate by salience with configurable temporal decay.
ADR-021 §5 / ADR-033 §4. The decay formula is determined by the configured
DecayModel (injected at construction time). The default DecayModel::Exponential
uses the note’s own decay_factor: salience * exp(-decay_factor * age_days).
This objective participates in WeightedObjective composition alongside
RrfFusionObjective and TemporalRecencyObjective to form the full recall
scoring pipeline.
Fields§
§decay_rate: f64Exponential decay rate k (>= 0.0). Score = salience * exp(-k * age_days).
Corresponds to ADR-021’s per-note decay_factor parameter.
Implementations§
Source§impl DecayAwareSalienceObjective
impl DecayAwareSalienceObjective
Sourcepub fn new(decay_rate: f64) -> Self
pub fn new(decay_rate: f64) -> Self
Create a new objective with the given exponential decay rate.
decay_rate = 0.01 gives a ~69-day half-life (the ADR-021 default for memory notes).
Sourcepub fn default_memory() -> Self
pub fn default_memory() -> Self
Default memory decay rate from ADR-021: 0.01 (~69-day half-life).
Trait Implementations§
Source§impl Objective<NoteCandidate> for DecayAwareSalienceObjective
impl Objective<NoteCandidate> for DecayAwareSalienceObjective
Source§fn score(&self, candidate: &NoteCandidate, _context: &ObjectiveContext) -> f64
fn score(&self, candidate: &NoteCandidate, _context: &ObjectiveContext) -> f64
Source§fn precision(&self, _candidate: &T, _context: &ObjectiveContext) -> f64
fn precision(&self, _candidate: &T, _context: &ObjectiveContext) -> f64
Source§fn passes_score(&self, score: f64, context: &ObjectiveContext) -> bool
fn passes_score(&self, score: f64, context: &ObjectiveContext) -> bool
Source§fn passes(&self, candidate: &T, context: &ObjectiveContext) -> bool
fn passes(&self, candidate: &T, context: &ObjectiveContext) -> bool
Source§fn batch_score(
&self,
candidates: &[T],
context: &ObjectiveContext,
) -> Vec<(usize, f64)>
fn batch_score( &self, candidates: &[T], context: &ObjectiveContext, ) -> Vec<(usize, f64)>
(index, score) pairs. Read more