pub struct Objective {
pub parameter: StateParameter,
pub desired_value: f64,
pub tolerance: f64,
pub multiplicative_factor: f64,
pub additive_factor: f64,
}
Expand description
Defines a state parameter event finder
Fields
parameter: StateParameter
The state parameter to target
desired_value: f64
The desired self.desired_value, must be in the same units as the state parameter
tolerance: f64
The precision on the desired value
multiplicative_factor: f64
A multiplicative factor this parameter’s error in the targeting (defaults to 1.0)
additive_factor: f64
An additive factor to this parameters’s error in the targeting (defaults to 0.0)
Implementations
sourceimpl Objective
impl Objective
sourcepub fn new(parameter: StateParameter, desired_value: f64) -> Self
pub fn new(parameter: StateParameter, desired_value: f64) -> Self
Match a specific value for the parameter. By default, the tolerance on the parameter is 0.1 times whatever unit is the default for that parameter. For example, a radius event will seek the requested value at the decimeter level, and an angle event will seek it at the tenth of a degree.
sourcepub fn within_tolerance(
parameter: StateParameter,
desired_value: f64,
tolerance: f64
) -> Self
pub fn within_tolerance(
parameter: StateParameter,
desired_value: f64,
tolerance: f64
) -> Self
Match a specific value for the parameter to hit the specified value with the provided tolerance on the value
Trait Implementations
impl Copy for Objective
Auto Trait Implementations
impl RefUnwindSafe for Objective
impl Send for Objective
impl Sync for Objective
impl Unpin for Objective
impl UnwindSafe for Objective
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Printing<T> for T where
T: Display,
impl<T> Printing<T> for T where
T: Display,
fn to_str(self) -> String
fn to_str(self) -> String
Method to serialize generic items, slices, and slices of Vecs. Can be also implemented on any other types. Read more
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if self
is actually part of its subset T
(and can be converted to it).
fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more