pub struct Predictive { /* private fields */ }Expand description
Markov-chain-driven tick strategy.
Learns screen transition patterns and allocates tick budget proportionally to transition probability. High-probability next screens tick at near-full rate; low-probability screens are aggressively throttled.
See module-level docs for architecture details.
Implementations§
Source§impl Predictive
impl Predictive
Sourcepub fn new(config: PredictiveStrategyConfig) -> Self
pub fn new(config: PredictiveStrategyConfig) -> Self
Create a new predictive strategy with the given config.
Sourcepub fn with_counter(
config: PredictiveStrategyConfig,
counter: TransitionCounter<String>,
) -> Self
pub fn with_counter( config: PredictiveStrategyConfig, counter: TransitionCounter<String>, ) -> Self
Create with pre-loaded transition data (e.g., from persistence).
Sourcepub fn predictor(&self) -> &MarkovPredictor<String>
pub fn predictor(&self) -> &MarkovPredictor<String>
Access the underlying predictor.
Sourcepub fn counter(&self) -> &TransitionCounter<String>
pub fn counter(&self) -> &TransitionCounter<String>
Access the underlying transition counter.
Trait Implementations§
Source§impl Clone for Predictive
impl Clone for Predictive
Source§fn clone(&self) -> Predictive
fn clone(&self) -> Predictive
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Predictive
impl Debug for Predictive
Source§impl TickStrategy for Predictive
impl TickStrategy for Predictive
Source§fn should_tick(
&mut self,
screen_id: &str,
tick_count: u64,
active_screen: &str,
) -> TickDecision
fn should_tick( &mut self, screen_id: &str, tick_count: u64, active_screen: &str, ) -> TickDecision
Decide whether to tick an inactive screen on this frame.
Source§fn on_screen_transition(&mut self, from: &str, to: &str)
fn on_screen_transition(&mut self, from: &str, to: &str)
Called when the runtime observes a screen transition.
Source§fn maintenance_tick(&mut self, _tick_count: u64)
fn maintenance_tick(&mut self, _tick_count: u64)
Called periodically for maintenance work.
Auto Trait Implementations§
impl Freeze for Predictive
impl RefUnwindSafe for Predictive
impl Send for Predictive
impl Sync for Predictive
impl Unpin for Predictive
impl UnsafeUnpin for Predictive
impl UnwindSafe for Predictive
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