pub struct MemoryFacade {
pub case: CaseMemory,
pub strategy: StrategyMemory,
pub cas: CasState,
pub cognitive_effect: RuleEffect,
}Expand description
Data structure representing memory facade.
Fields§
§case: CaseMemoryCase for this value.
strategy: StrategyMemoryStrategy for this value.
cas: CasStateCas for this value.
cognitive_effect: RuleEffectActive structured cognitive effect (updated when L1 commits a patch).
Implementations§
Source§impl MemoryFacade
impl MemoryFacade
Sourcepub fn retrieve(&self, query: &str, k: usize) -> Result<BTreeMap<String, Value>>
pub fn retrieve(&self, query: &str, k: usize) -> Result<BTreeMap<String, Value>>
Performs retrieve for this type.
Sourcepub fn update(&mut self, traj: &Trajectory) -> Result<()>
pub fn update(&mut self, traj: &Trajectory) -> Result<()>
Raw case/strategy/CAS absorb without idle decay.
Prefer Learner::update for the full learning path.
Sourcepub fn record_reward(&mut self, action: &str, reward: f64)
pub fn record_reward(&mut self, action: &str, reward: f64)
Feed external task reward into strategy memory (closes the task loop).
Trait Implementations§
Source§impl Debug for MemoryFacade
impl Debug for MemoryFacade
Auto Trait Implementations§
impl !Freeze for MemoryFacade
impl !RefUnwindSafe for MemoryFacade
impl !Sync for MemoryFacade
impl Forget for MemoryFacade
impl Move for MemoryFacade
impl Send for MemoryFacade
impl Unpin for MemoryFacade
impl UnsafeUnpin for MemoryFacadewhere
*const u8 is !null: UnsafeUnpin,
PhantomData<Case>: UnsafeUnpin,
*const LeafNode<String, Strategy> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, Strategy)>>: UnsafeUnpin,
*const LeafNode<String, f64> is !null: UnsafeUnpin,
PhantomData<Box<(String, f64)>>: UnsafeUnpin,
impl UnwindSafe for MemoryFacadewhere
RawVecInner: UnwindSafe,
NonZero<i32>: UnwindSafe,
Utc: UnwindSafe,
BTreeMap<String, Strategy>: UnwindSafe,
BTreeMap<String, f64>: UnwindSafe,
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