pub struct DecayWeights {
pub similarity: f64,
pub recency: f64,
pub importance: f64,
pub recency_half_life: Duration,
}Expand description
Weights and half-life of the long-term ranking formula.
Fields§
§similarity: f64Weight of semantic similarity.
recency: f64Weight of recency.
importance: f64Weight of importance.
recency_half_life: DurationAge at which the recency term is 0.5.
Implementations§
Source§impl DecayWeights
impl DecayWeights
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates weights with the default 0.7 / 0.15 / 0.15 mix and a 7-day half-life.
Sourcepub fn with_weights(
self,
similarity: f64,
recency: f64,
importance: f64,
) -> Self
pub fn with_weights( self, similarity: f64, recency: f64, importance: f64, ) -> Self
Sets all three mix weights (need not sum to 1; the score is a plain weighted sum).
Sourcepub fn with_half_life(self, half_life: Duration) -> Self
pub fn with_half_life(self, half_life: Duration) -> Self
Sets the recency half-life.
Trait Implementations§
Source§impl Clone for DecayWeights
impl Clone for DecayWeights
Source§fn clone(&self) -> DecayWeights
fn clone(&self) -> DecayWeights
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 DecayWeights
Source§impl Debug for DecayWeights
impl Debug for DecayWeights
Source§impl Default for DecayWeights
impl Default for DecayWeights
Source§impl PartialEq for DecayWeights
impl PartialEq for DecayWeights
impl StructuralPartialEq for DecayWeights
Auto Trait Implementations§
impl Freeze for DecayWeights
impl RefUnwindSafe for DecayWeights
impl Send for DecayWeights
impl Sync for DecayWeights
impl Unpin for DecayWeights
impl UnsafeUnpin for DecayWeights
impl UnwindSafe for DecayWeights
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