pub struct Mode { /* private fields */ }Implementations§
Source§impl Mode
impl Mode
Sourcepub fn try_new(
fitfun: Fitness,
nobj: usize,
ncon: usize,
ints: Option<Vec<bool>>,
p: &ModeParams,
) -> Result<Self, &'static str>
pub fn try_new( fitfun: Fitness, nobj: usize, ncon: usize, ints: Option<Vec<bool>>, p: &ModeParams, ) -> Result<Self, &'static str>
Construct MODE after validating dimensions, bounds, population size, probabilities, and the optional integer mask.
Sourcepub fn new(
fitfun: Fitness,
nobj: usize,
ncon: usize,
ints: Option<Vec<bool>>,
p: &ModeParams,
) -> Self
pub fn new( fitfun: Fitness, nobj: usize, ncon: usize, ints: Option<Vec<bool>>, p: &ModeParams, ) -> Self
Construct MODE, panicking on invalid configuration. Applications that
accept user input should prefer Mode::try_new.
pub fn dim(&self) -> usize
pub fn nobj(&self) -> usize
pub fn ncon(&self) -> usize
pub fn popsize(&self) -> usize
pub fn stop(&self) -> i32
Sourcepub fn try_ask(&mut self) -> Result<Vec<Vec<f64>>, &'static str>
pub fn try_ask(&mut self) -> Result<Vec<Vec<f64>>, &'static str>
Fallible ask variant for interfaces that need to report call-order errors rather than panic.
Sourcepub fn tell(&mut self, ys: &[Vec<f64>]) -> i32
pub fn tell(&mut self, ys: &[Vec<f64>]) -> i32
Tell objective+constraint values for the offspring from ask.
Sourcepub fn try_tell(&mut self, ys: &[Vec<f64>]) -> Result<i32, &'static str>
pub fn try_tell(&mut self, ys: &[Vec<f64>]) -> Result<i32, &'static str>
Fallible tell variant validating call order and matrix shape.
Sourcepub fn tell_switch(
&mut self,
ys: &[Vec<f64>],
nsga_update: bool,
pareto_update: f64,
) -> i32
pub fn tell_switch( &mut self, ys: &[Vec<f64>], nsga_update: bool, pareto_update: f64, ) -> i32
Tell with a switched update mode (the C++ tell_switch).
pub fn try_tell_switch( &mut self, ys: &[Vec<f64>], nsga_update: bool, pareto_update: f64, ) -> Result<i32, &'static str>
Sourcepub fn set_population(&mut self, xs: &[Vec<f64>], ys: &[Vec<f64>]) -> i32
pub fn set_population(&mut self, xs: &[Vec<f64>], ys: &[Vec<f64>]) -> i32
Replace the population/offspring and tell (the C++ set_population).
pub fn try_set_population( &mut self, xs: &[Vec<f64>], ys: &[Vec<f64>], ) -> Result<i32, &'static str>
Sourcepub fn population(&self) -> Vec<Vec<f64>>
pub fn population(&self) -> Vec<Vec<f64>>
Current population (rows = individuals).
pub fn result(&self) -> ModeResult
Auto Trait Implementations§
impl Freeze for Mode
impl RefUnwindSafe for Mode
impl Send for Mode
impl Sync for Mode
impl Unpin for Mode
impl UnsafeUnpin for Mode
impl UnwindSafe for Mode
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§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 moreSource§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).Source§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.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.