Skip to main content

Predictor

Trait Predictor 

Source
pub trait Predictor {
    // Required methods
    fn reset(&mut self);
    fn update(&mut self, t: u64, x: f64) -> Result<(), PredictorError>;
    fn predict(&self, t: u64) -> Option<f64>;
    fn state_hash(&self) -> u64;
}
Expand description

Object-safe numeric predictor interface used by the engine and custom models.

Required Methods§

Source

fn reset(&mut self)

Reset predictor state to its initial value.

Source

fn update(&mut self, t: u64, x: f64) -> Result<(), PredictorError>

Update predictor with a sample at time t and value x.

Source

fn predict(&self, t: u64) -> Option<f64>

Predict value at time t. Must not mutate predictor state.

Source

fn state_hash(&self) -> u64

Deterministic hash of predictor state.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§