pub struct DefaultMatrixHook<T: ConvergenceRecorder, R: RoutingResolver> { /* private fields */ }Expand description
Concrete implementation that bridges pe-matrix types into the hook trait.
Created by pe-runtime when wiring up the matrix layer. Uses Mutex
for interior mutability since the BSP loop is sequential.
§Thread safety assumption
This type assumes single-threaded sequential access within each
BSP superstep. The Mutex satisfies the Sync bound but is never
contended in practice. If a Mutex::lock() fails (poisoned), the
hook silently returns defaults — this can only happen if the engine
panics while holding the lock, which the BSP loop prevents.
Implementations§
Source§impl<T: ConvergenceRecorder, R: RoutingResolver> DefaultMatrixHook<T, R>
impl<T: ConvergenceRecorder, R: RoutingResolver> DefaultMatrixHook<T, R>
Trait Implementations§
Source§impl<T: ConvergenceRecorder, R: RoutingResolver> MatrixHook for DefaultMatrixHook<T, R>
impl<T: ConvergenceRecorder, R: RoutingResolver> MatrixHook for DefaultMatrixHook<T, R>
Source§fn on_converge(
&self,
_node_name: &str,
actual_contribution: f64,
surprise: f64,
quality: f64,
)
fn on_converge( &self, _node_name: &str, actual_contribution: f64, surprise: f64, quality: f64, )
Called when a node returns
NodeResult::Converge. Read moreSource§fn route(&self, from: &str, candidates: &[String]) -> Option<Vec<String>>
fn route(&self, from: &str, candidates: &[String]) -> Option<Vec<String>>
Resolve routing for a conditional edge using learned probabilities. Read more
Source§fn completion(&self) -> f64
fn completion(&self) -> f64
Current completion estimate.
Source§fn is_converged(&self) -> bool
fn is_converged(&self) -> bool
Whether convergence threshold has been reached.
Auto Trait Implementations§
impl<T, R> !Freeze for DefaultMatrixHook<T, R>
impl<T, R> RefUnwindSafe for DefaultMatrixHook<T, R>
impl<T, R> Send for DefaultMatrixHook<T, R>
impl<T, R> Sync for DefaultMatrixHook<T, R>
impl<T, R> Unpin for DefaultMatrixHook<T, R>
impl<T, R> UnsafeUnpin for DefaultMatrixHook<T, R>where
T: UnsafeUnpin,
R: UnsafeUnpin,
impl<T, R> UnwindSafe for DefaultMatrixHook<T, R>
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