pub struct PredictiveConstraintAdapter<C: ViolationComputable> { /* private fields */ }Expand description
Predictive constraint adaptation
Implementations§
Source§impl<C: ViolationComputable + Clone> PredictiveConstraintAdapter<C>
impl<C: ViolationComputable + Clone> PredictiveConstraintAdapter<C>
Sourcepub fn new(
name: impl Into<String>,
base_constraint: C,
horizon: usize,
adaptation_rate: f32,
) -> Self
pub fn new( name: impl Into<String>, base_constraint: C, horizon: usize, adaptation_rate: f32, ) -> Self
Create a new predictive constraint adapter
Sourcepub fn predict_violations(&self, trajectory: &[Array1<f32>]) -> Vec<f32>
pub fn predict_violations(&self, trajectory: &[Array1<f32>]) -> Vec<f32>
Predict future violations based on trajectory
Sourcepub fn adapt(&mut self, predicted_violations: &[f32]) -> LogicResult<()>
pub fn adapt(&mut self, predicted_violations: &[f32]) -> LogicResult<()>
Adapt constraint based on predicted violations
Sourcepub fn violation_history(&self) -> &[f32]
pub fn violation_history(&self) -> &[f32]
Get violation history
Trait Implementations§
Source§impl<C: Clone + ViolationComputable> Clone for PredictiveConstraintAdapter<C>
impl<C: Clone + ViolationComputable> Clone for PredictiveConstraintAdapter<C>
Source§fn clone(&self) -> PredictiveConstraintAdapter<C>
fn clone(&self) -> PredictiveConstraintAdapter<C>
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 moreAuto Trait Implementations§
impl<C> Freeze for PredictiveConstraintAdapter<C>where
C: Freeze,
impl<C> RefUnwindSafe for PredictiveConstraintAdapter<C>where
C: RefUnwindSafe,
impl<C> Send for PredictiveConstraintAdapter<C>where
C: Send,
impl<C> Sync for PredictiveConstraintAdapter<C>where
C: Sync,
impl<C> Unpin for PredictiveConstraintAdapter<C>where
C: Unpin,
impl<C> UnwindSafe for PredictiveConstraintAdapter<C>where
C: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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