pub struct TrajectoryObserver { /* private fields */ }Expand description
A bounded observer. Construct it with TrajectoryObserver::from_policy
so disabled observation allocates nothing.
Implementations§
Source§impl TrajectoryObserver
impl TrajectoryObserver
Sourcepub fn from_policy(
policy: TrajectoryObservationPolicy,
) -> Result<Option<Self>, TrajectoryObserverError>
pub fn from_policy( policy: TrajectoryObservationPolicy, ) -> Result<Option<Self>, TrajectoryObserverError>
Returns None for Disabled, ensuring that mode has no observer or allocation.
pub const fn sample_interval_iterations(&self) -> u64
Sourcepub fn requires_equilibrium_evidence(&self, iteration: u64) -> bool
pub fn requires_equilibrium_evidence(&self, iteration: u64) -> bool
Lets a model avoid calculating a residual on observations that will not be retained.
pub fn observe( &mut self, observation: TrajectoryObservation<'_>, ) -> Result<Option<TerminationSignal>, TrajectoryObserverError>
Sourcepub fn finish(
self,
final_observation: TrajectoryObservation<'_>,
stop_reason: StopReason,
) -> Result<TerminalState, TrajectoryObserverError>
pub fn finish( self, final_observation: TrajectoryObservation<'_>, stop_reason: StopReason, ) -> Result<TerminalState, TrajectoryObserverError>
Completes the observer and always incorporates final_observation, even off cadence.
Auto Trait Implementations§
impl Freeze for TrajectoryObserver
impl RefUnwindSafe for TrajectoryObserver
impl Send for TrajectoryObserver
impl Sync for TrajectoryObserver
impl Unpin for TrajectoryObserver
impl UnsafeUnpin for TrajectoryObserver
impl UnwindSafe for TrajectoryObserver
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> 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