pub struct Variable {
pub component: Vary,
pub perturbation: f64,
pub init_guess: f64,
pub max_step: f64,
pub max_value: f64,
pub min_value: f64,
pub frame: Option<Frame>,
}
Fields§
§component: Vary
The component that will be varied in the targeter
perturbation: f64
The perturbation for the finite differencing algorithm
init_guess: f64
The initial guess of this variable
max_step: f64
The maximum step this variable may have between each iteration
max_value: f64
The absolute maximum value this parameter can ever have
min_value: f64
The absolute minimum value this parameter can ever have
frame: Option<Frame>
The frame in which this variable should be applied, must be either a local frame or inertial
Implementations§
source§impl Variable
impl Variable
sourcepub fn valid(&self) -> Result<(), TargetingError>
pub fn valid(&self) -> Result<(), TargetingError>
Returns whether the configuration of this variable is valid
pub fn with_initial_guess(self, guess: f64) -> Self
pub fn with_pert(self, pert: f64) -> Self
pub fn with_min(self, min_val: f64) -> Self
pub fn with_max(self, max_val: f64) -> Self
sourcepub fn apply_bounds(&self, val: f64) -> f64
pub fn apply_bounds(&self, val: f64) -> f64
Ensure that val
is within the variable bounds
sourcepub fn ensure_bounds(&self, val: &mut f64)
pub fn ensure_bounds(&self, val: &mut f64)
Ensure that val
is within the variable bounds
sourcepub fn check_bounds(&self, val: f64) -> (f64, bool)
pub fn check_bounds(&self, val: f64) -> (f64, bool)
Returns the input value unless it is out of bounds, then it returns the bound, and whether the input value was OK
Trait Implementations§
source§impl PartialEq<Variable> for Variable
impl PartialEq<Variable> for Variable
impl Copy for Variable
impl StructuralPartialEq for Variable
Auto Trait Implementations§
impl RefUnwindSafe for Variable
impl Send for Variable
impl Sync for Variable
impl Unpin for Variable
impl UnwindSafe for Variable
Blanket Implementations§
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> Printing<T> for Twhere
T: Display,
impl<T> Printing<T> for Twhere T: Display,
§fn to_str(self) -> String
fn to_str(self) -> String
Method to serialize.
Decorates Vecs with square brackets and tuples with round ones.
Implementation code is in
printing.rs
. §fn to_plainstr(self) -> String
fn to_plainstr(self) -> String
Method to serialize in minimal form (space separated, no brackets)
Implementation code is in
printing.rs
.§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere 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.