pub struct PredictiveCache {
pub predictions: Vec<Prediction>,
pub stats: CacheStats,
}Fields§
§predictions: Vec<Prediction>§stats: CacheStatsImplementations§
Source§impl PredictiveCache
impl PredictiveCache
pub fn load_or_init(output_dir: &Path) -> Self
Sourcepub fn check(&self, query_hash: u64) -> Option<(Vec<u32>, f32)>
pub fn check(&self, query_hash: u64) -> Option<(Vec<u32>, f32)>
Check if we have a prediction for this query. Returns cached blocks + confidence. This is called BEFORE the actual search, so the results can be used immediately.
Sourcepub fn evaluate(
&mut self,
query_hash: u64,
actual_results: &[u32],
thought_graph: &mut ThoughtGraphState,
) -> (&'static str, usize)
pub fn evaluate( &mut self, query_hash: u64, actual_results: &[u32], thought_graph: &mut ThoughtGraphState, ) -> (&'static str, usize)
Evaluate prediction accuracy after a recall completes. Compares predicted blocks against actual results. Returns: (hit_type, overlap_count) where hit_type is “hit”, “partial”, or “miss”.
Sourcepub fn predict_next(&mut self, thought_graph: &ThoughtGraphState)
pub fn predict_next(&mut self, thought_graph: &ThoughtGraphState)
Generate predictions for the next likely query based on current session state. Called after each recall to pre-load the cache.
Sourcepub fn merge_stats(
&mut self,
remote_predictions: u32,
remote_hits: u32,
remote_misses: u32,
)
pub fn merge_stats( &mut self, remote_predictions: u32, remote_hits: u32, remote_misses: u32, )
Merge remote stats (additive, for reporting).
Sourcepub fn dream_cleanup(&mut self)
pub fn dream_cleanup(&mut self)
Dream cleanup: remove predictions with very low confidence.
Auto Trait Implementations§
impl Freeze for PredictiveCache
impl RefUnwindSafe for PredictiveCache
impl Send for PredictiveCache
impl Sync for PredictiveCache
impl Unpin for PredictiveCache
impl UnsafeUnpin for PredictiveCache
impl UnwindSafe for PredictiveCache
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
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