pub struct Hippocampus {
pub context_bindings: HashMap<u64, ContextBinding>,
pub episodes: Vec<EpisodicIndex>,
pub consolidation_queue: Vec<u64>,
pub binding_threshold: f32,
}Fields§
§context_bindings: HashMap<u64, ContextBinding>§episodes: Vec<EpisodicIndex>§consolidation_queue: Vec<u64>§binding_threshold: f32Implementations§
Source§impl Hippocampus
impl Hippocampus
pub fn new() -> Self
Sourcepub fn create_binding(
&mut self,
query_hash: u64,
context: &str,
blocks: Vec<u32>,
) -> u64
pub fn create_binding( &mut self, query_hash: u64, context: &str, blocks: Vec<u32>, ) -> u64
Create context-event binding: link blocks to their retrieval context
Sourcepub fn reinforce_binding(&mut self, query_hash: u64, success: bool)
pub fn reinforce_binding(&mut self, query_hash: u64, success: bool)
Strengthen context-event binding through repetition
Sourcepub fn get_consolidation_candidates(&self, k: usize) -> Vec<EpisodicIndex>
pub fn get_consolidation_candidates(&self, k: usize) -> Vec<EpisodicIndex>
Get consolidation candidates (fresh episodes with strong bindings)
Sourcepub fn mark_consolidating(&mut self, episode_id: u64)
pub fn mark_consolidating(&mut self, episode_id: u64)
Mark episode as consolidating
Sourcepub fn mark_consolidated(&mut self, episode_id: u64)
pub fn mark_consolidated(&mut self, episode_id: u64)
Mark episode as consolidated
Sourcepub fn replay_episode(&mut self, episode_id: u64) -> Option<Vec<u32>>
pub fn replay_episode(&mut self, episode_id: u64) -> Option<Vec<u32>>
Replay episode for consolidation (simulates sleep consolidation)
Get related episodes (same context)
pub fn save(&self, dir: &Path) -> Result<(), String>
pub fn load(dir: &Path) -> Result<Self, String>
pub fn load_or_init(dir: &Path) -> Self
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Hippocampus
impl RefUnwindSafe for Hippocampus
impl Send for Hippocampus
impl Sync for Hippocampus
impl Unpin for Hippocampus
impl UnsafeUnpin for Hippocampus
impl UnwindSafe for Hippocampus
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