pub struct Run { /* private fields */ }Expand description
A run in progress: its population, ranked, and the candidates waiting to be evaluated.
Implementations§
Source§impl Run
impl Run
Sourcepub fn candidates(&self) -> &[Vec<f64>]
pub fn candidates(&self) -> &[Vec<f64>]
The candidates to evaluate next: the first population, then each generation’s children. Empty once the run has finished.
Sourcepub fn generation(&self) -> usize
pub fn generation(&self) -> usize
How many generations have been evaluated.
Sourcepub fn members(&self) -> &[Member]
pub fn members(&self) -> &[Member]
The population as it stands, ranked: empty before the first generation is told.
Sourcepub fn tell(
&mut self,
values: &[Vec<f64>],
) -> Result<Option<Front>, AnalysisError>
pub fn tell( &mut self, values: &[Vec<f64>], ) -> Result<Option<Front>, AnalysisError>
Takes the goals of the candidates, in their order, with no constraints: the population
is updated, and once the last generation is told the run’s Front is returned. A
design with a goal of +∞ counts as failed (Goals::failed): every design whose goals
are all finite dominates it.
§Errors
Sourcepub fn tell_constrained(
&mut self,
goals: &[Goals],
) -> Result<Option<Front>, AnalysisError>
pub fn tell_constrained( &mut self, goals: &[Goals], ) -> Result<Option<Front>, AnalysisError>
Run::tell with each candidate’s constraint violation: designs are sorted by
constrained domination. A failed design (Goals::failed) may have any number of goals,
as they are set aside: each counts as +∞. A design with a goal of +∞ fails too, its
violation taken as +∞.
§Errors
AnalysisError::Length for a number of goals other than the candidates’ (telling a
finished run, which has none, too) or a design’s number of goals other than the
optimizer’s; AnalysisError::Output for a goal that is NaN or −∞, with the index of
its evaluation in the run; and AnalysisError::Domain for a violation that is negative
or NaN.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Run
impl RefUnwindSafe for Run
impl Send for Run
impl Sync for Run
impl Unpin for Run
impl UnsafeUnpin for Run
impl UnwindSafe for Run
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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