pub struct DecaySchedule {
pub half_life: Duration,
pub valence_weight: f64,
pub min_valence_for_permanent: f64,
}Expand description
Ebbinghaus-inspired memory decay schedule.
Fields§
§half_life: Duration§valence_weight: f64§min_valence_for_permanent: f64Implementations§
Source§impl DecaySchedule
impl DecaySchedule
Sourcepub fn retention(&self, tile: &Tile, now: DateTime<Utc>) -> f64
pub fn retention(&self, tile: &Tile, now: DateTime<Utc>) -> f64
Ebbinghaus forgetting curve: retention = e^(-t/S)
Returns a value between 0.0 and 1.0 representing how well this tile should be retained. High-valence tiles decay slower.
Sourcepub fn should_forget(&self, tile: &Tile, now: DateTime<Utc>) -> bool
pub fn should_forget(&self, tile: &Tile, now: DateTime<Utc>) -> bool
Should this tile be forgotten based on decay?
Sourcepub fn reconsolidate(&self, tile: &mut Tile, new_context: &str)
pub fn reconsolidate(&self, tile: &mut Tile, new_context: &str)
Reconsolidate: update tile with new context, resetting decay.
This models the neurobiological process where recalling a memory makes it labile again, and re-storing it can strengthen or modify it.
Sourcepub fn fast_decay() -> Self
pub fn fast_decay() -> Self
Create a fast-decay schedule (for testing).
Sourcepub fn slow_decay() -> Self
pub fn slow_decay() -> Self
Create a slow-decay schedule (permanent-ish memories).
Trait Implementations§
Source§impl Clone for DecaySchedule
impl Clone for DecaySchedule
Source§fn clone(&self) -> DecaySchedule
fn clone(&self) -> DecaySchedule
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 moreSource§impl Debug for DecaySchedule
impl Debug for DecaySchedule
Auto Trait Implementations§
impl Freeze for DecaySchedule
impl RefUnwindSafe for DecaySchedule
impl Send for DecaySchedule
impl Sync for DecaySchedule
impl Unpin for DecaySchedule
impl UnsafeUnpin for DecaySchedule
impl UnwindSafe for DecaySchedule
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