pub struct SettleInterpreter { /* private fields */ }Expand description
Per-pulse interpreter of objective settling. See the module docs.
Implementations§
Source§impl SettleInterpreter
impl SettleInterpreter
Sourcepub fn new(
kernel: Box<dyn Kernel>,
samples: &str,
value_wire: &str,
stable_wire: &str,
horizon: usize,
) -> Self
pub fn new( kernel: Box<dyn Kernel>, samples: &str, value_wire: &str, stable_wire: &str, horizon: usize, ) -> Self
Build an interpreter over a compiled settle kernel. samples is
its vec_f64 window input; value_wire / stable_wire are the
is_stable multi-output wire names; horizon is how many recent
samples the window holds.
§Panics
When the kernel has no samples input: a malformed settle kernel.
Sourcepub fn register(&self) -> Arc<ArcSwap<SettleReading>> ⓘ
pub fn register(&self) -> Arc<ArcSwap<SettleReading>> ⓘ
The shared register handle. The executor reads the settled objective from this at phase completion; the interpreter publishes into it on every pulse.
Sourcepub fn pulse(&mut self, sample: f64) -> SettleReading
pub fn pulse(&mut self, sample: f64) -> SettleReading
Deliver one cadence pulse: append sample to the window (dropping
the oldest past horizon), write the window to the kernel, read
is_stable’s verdict on it, publish the stabilized value, and
return the reading.
Auto Trait Implementations§
impl !RefUnwindSafe for SettleInterpreter
impl !UnwindSafe for SettleInterpreter
impl Freeze for SettleInterpreter
impl Send for SettleInterpreter
impl Sync for SettleInterpreter
impl Unpin for SettleInterpreter
impl UnsafeUnpin for SettleInterpreter
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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