pub struct QueryMemory { /* private fields */ }Expand description
Bounded ring buffer of recent queries. Fixed capacity prevents unbounded growth. Tracks node frequency and seed bigrams for priming. FM-PL-005: ring buffer replaces unbounded Vec. Replaces: plasticity.py QueryMemory
Implementations§
Source§impl QueryMemory
impl QueryMemory
pub fn new(capacity: usize, num_nodes: u32) -> Self
Sourcepub fn record(&mut self, record: QueryRecord)
pub fn record(&mut self, record: QueryRecord)
Record a query. Overwrites oldest if at capacity. Replaces: plasticity.py QueryMemory.record()
Sourcepub fn get_priming_signal(
&self,
seeds: &[NodeId],
boost_strength: FiniteF32,
) -> Vec<(NodeId, FiniteF32)>
pub fn get_priming_signal( &self, seeds: &[NodeId], boost_strength: FiniteF32, ) -> Vec<(NodeId, FiniteF32)>
Get priming signal: nodes that frequently co-occur with the given seeds. Replaces: plasticity.py QueryMemory.get_priming_signal()
pub fn is_empty(&self) -> bool
Auto Trait Implementations§
impl Freeze for QueryMemory
impl RefUnwindSafe for QueryMemory
impl Send for QueryMemory
impl Sync for QueryMemory
impl Unpin for QueryMemory
impl UnsafeUnpin for QueryMemory
impl UnwindSafe for QueryMemory
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