Trait metaheuristics_nature::Bounded
source · pub trait Bounded: MaybeParallel {
// Required method
fn bound(&self) -> &[[f64; 2]];
// Provided methods
fn dim(&self) -> usize { ... }
fn bound_of(&self, s: usize) -> [f64; 2] { ... }
fn bound_width(&self, s: usize) -> f64 { ... }
fn bound_range(&self, s: usize) -> RangeInclusive<f64> { ... }
fn lb(&self, s: usize) -> f64 { ... }
fn ub(&self, s: usize) -> f64 { ... }
fn clamp(&self, s: usize, v: f64) -> f64 { ... }
}
Expand description
A problem is well bounded.
Provide constant array reference or dynamic slice for the variables.
Required Methods§
Provided Methods§
sourcefn bound_width(&self, s: usize) -> f64
fn bound_width(&self, s: usize) -> f64
Get the width of the upper bound and the lower bound.
sourcefn bound_range(&self, s: usize) -> RangeInclusive<f64>
fn bound_range(&self, s: usize) -> RangeInclusive<f64>
Get the upper bound and the lower bound as a range.
The variable is constrain with lower <= x <= upper.