pub struct BalancedRecallState {
pub relevance: BetaPosterior,
pub salience: BetaPosterior,
pub temporal: BetaPosterior,
pub entity_posteriors: EntityPosteriors,
pub total_events: u64,
pub exploration_epoch: u64,
}Expand description
State for the BalancedRecallProfile — the v1 default profile.
Migrated from the predecessor scalar BrainState design (ADR-032 §5a).
Three-parameter Beta posteriors with informative priors + per-entity LRU.
Fields§
§relevance: BetaPosteriorrelevance_weight — prior Beta(7,3): warm-starts expecting 70% success
salience: BetaPosteriorsalience_weight — prior Beta(2,8)
temporal: BetaPosteriortemporal_weight — prior Beta(1,9)
entity_posteriors: EntityPosteriorsPer-entity posteriors, bounded LRU (10K default)
total_events: u64Total events processed by this profile
exploration_epoch: u64Incremented each time posteriors are reset to priors
Implementations§
Source§impl BalancedRecallState
impl BalancedRecallState
pub fn new(entity_capacity: usize) -> Self
pub fn reset_posteriors(&mut self)
pub fn to_snapshot(&self) -> BalancedRecallSnapshot
pub fn from_snapshot( snapshot: BalancedRecallSnapshot, entity_capacity: usize, ) -> Self
Trait Implementations§
Source§impl Fold<Event, BalancedRecallState> for BalancedRecallFold
impl Fold<Event, BalancedRecallState> for BalancedRecallFold
Source§fn init(&self, _context: &FoldContext) -> BalancedRecallState
fn init(&self, _context: &FoldContext) -> BalancedRecallState
Get the initial state before any entries are processed.
Source§fn reduce(
&self,
state: BalancedRecallState,
event: &Event,
_ctx: &FoldContext,
) -> BalancedRecallState
fn reduce( &self, state: BalancedRecallState, event: &Event, _ctx: &FoldContext, ) -> BalancedRecallState
Process a single entry and return the new state.
Source§fn finalize(
&self,
state: BalancedRecallState,
_context: &FoldContext,
) -> BalancedRecallState
fn finalize( &self, state: BalancedRecallState, _context: &FoldContext, ) -> BalancedRecallState
Finalize the state after all entries are processed. Read more
Source§fn derive<'a, I>(&self, entries: I, context: &FoldContext) -> FoldOutcome<S>
fn derive<'a, I>(&self, entries: I, context: &FoldContext) -> FoldOutcome<S>
Derive state from an iterator of entries. Read more
Source§fn derive_filtered<'a, I, F>(
&self,
entries: I,
context: &FoldContext,
filter: F,
) -> FoldOutcome<S>
fn derive_filtered<'a, I, F>( &self, entries: I, context: &FoldContext, filter: F, ) -> FoldOutcome<S>
Derive state with a filter.
Auto Trait Implementations§
impl Freeze for BalancedRecallState
impl RefUnwindSafe for BalancedRecallState
impl Send for BalancedRecallState
impl Sync for BalancedRecallState
impl Unpin for BalancedRecallState
impl UnsafeUnpin for BalancedRecallState
impl UnwindSafe for BalancedRecallState
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