pub struct WorkingMemory {
pub items: Vec<WorkingMemoryItem>,
pub capacity: usize,
pub decay_ms: u64,
}Expand description
Working Memory állapot — korlátos puffer.
Fields§
§items: Vec<WorkingMemoryItem>§capacity: usize§decay_ms: u64Implementations§
Source§impl WorkingMemory
impl WorkingMemory
Sourcepub fn load_or_init(output_dir: &Path) -> Self
pub fn load_or_init(output_dir: &Path) -> Self
Betöltés WKM1 file-ból, vagy üres init.
Sourcepub fn push(
&mut self,
text: &str,
importance: f32,
layer: &str,
mem_type: MemoryType,
)
pub fn push( &mut self, text: &str, importance: f32, layer: &str, mem_type: MemoryType, )
Push one item. Evict lowest-score item if full.
Sourcepub fn access(&mut self, idx: usize) -> Option<&WorkingMemoryItem>
pub fn access(&mut self, idx: usize) -> Option<&WorkingMemoryItem>
Access an item by index: bumps last_access, increments count. Applies primacy boost (serial_pos == 0) and recency boost (last item).
Sourcepub fn consolidate(&mut self) -> Vec<WorkingMemoryItem>
pub fn consolidate(&mut self) -> Vec<WorkingMemoryItem>
Consolidate high-access items: returns the items that qualify. Caller is responsible for storing them via store_memory() or other means.
Sourcepub fn stats(&self) -> WorkingMemoryStats
pub fn stats(&self) -> WorkingMemoryStats
Compute working memory stats.
Auto Trait Implementations§
impl Freeze for WorkingMemory
impl RefUnwindSafe for WorkingMemory
impl Send for WorkingMemory
impl Sync for WorkingMemory
impl Unpin for WorkingMemory
impl UnsafeUnpin for WorkingMemory
impl UnwindSafe for WorkingMemory
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
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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