pub struct DecayPolicy { /* private fields */ }Expand description
Governs how memory importance decays over time.
Implementations§
Source§impl DecayPolicy
impl DecayPolicy
Sourcepub fn exponential(half_life_hours: f64) -> Result<Self, AgentRuntimeError>
pub fn exponential(half_life_hours: f64) -> Result<Self, AgentRuntimeError>
Sourcepub fn half_life_hours(&self) -> f64
pub fn half_life_hours(&self) -> f64
Return the configured half-life in hours.
Sourcepub fn decay_item(&self, item: &mut MemoryItem)
pub fn decay_item(&self, item: &mut MemoryItem)
Apply decay in-place to a mutable MemoryItem.
Trait Implementations§
Source§impl Clone for DecayPolicy
impl Clone for DecayPolicy
Source§fn clone(&self) -> DecayPolicy
fn clone(&self) -> DecayPolicy
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 DecayPolicy
impl Debug for DecayPolicy
Source§impl<'de> Deserialize<'de> for DecayPolicy
impl<'de> Deserialize<'de> for DecayPolicy
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
Auto Trait Implementations§
impl Freeze for DecayPolicy
impl RefUnwindSafe for DecayPolicy
impl Send for DecayPolicy
impl Sync for DecayPolicy
impl Unpin for DecayPolicy
impl UnsafeUnpin for DecayPolicy
impl UnwindSafe for DecayPolicy
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