Struct genetic_algorithm::strategy::evolve::EvolveState
source · pub struct EvolveState<A: Allele> {
pub current_iteration: usize,
pub current_generation: usize,
pub stale_generations: usize,
pub best_generation: usize,
pub best_chromosome: Chromosome<A>,
pub durations: HashMap<StrategyAction, Duration>,
pub chromosome: Chromosome<A>,
pub population: Population<A>,
pub current_scale_index: Option<usize>,
pub max_scale_index: usize,
}Expand description
Stores the state of the Evolve strategy. Next to the expected general fields, the following strategy specific fields are added:
- population: the population of the current generation
Fields§
§current_iteration: usize§current_generation: usize§stale_generations: usize§best_generation: usize§best_chromosome: Chromosome<A>§durations: HashMap<StrategyAction, Duration>§chromosome: Chromosome<A>§population: Population<A>§current_scale_index: Option<usize>§max_scale_index: usizeImplementations§
Trait Implementations§
source§impl<A: Clone + Allele> Clone for EvolveState<A>
impl<A: Clone + Allele> Clone for EvolveState<A>
source§fn clone(&self) -> EvolveState<A>
fn clone(&self) -> EvolveState<A>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl<A: Allele> Default for EvolveState<A>
impl<A: Allele> Default for EvolveState<A>
source§impl<A: Allele> Display for EvolveState<A>
impl<A: Allele> Display for EvolveState<A>
source§impl<A: Allele> StrategyState<A> for EvolveState<A>
impl<A: Allele> StrategyState<A> for EvolveState<A>
fn chromosome_as_ref(&self) -> &Chromosome<A>
fn chromosome_as_mut(&mut self) -> &mut Chromosome<A>
fn population_as_ref(&self) -> &Population<A>
fn population_as_mut(&mut self) -> &mut Population<A>
fn best_chromosome_as_ref(&self) -> &Chromosome<A>
fn best_generation(&self) -> usize
fn current_generation(&self) -> usize
fn current_iteration(&self) -> usize
fn stale_generations(&self) -> usize
fn increment_stale_generations(&mut self)
fn reset_stale_generations(&mut self)
fn store_best_chromosome(&mut self, improved_fitness: bool) -> (bool, bool)
fn add_duration(&mut self, action: StrategyAction, duration: Duration)
fn total_duration(&self) -> Duration
fn best_fitness_score(&self) -> Option<FitnessValue>
fn close_duration(&mut self, total_duration: Duration)
fn update_best_chromosome( &mut self, fitness_ordering: &FitnessOrdering, replace_on_equal_fitness: bool, ) -> (bool, bool)
Auto Trait Implementations§
impl<A> Freeze for EvolveState<A>
impl<A> RefUnwindSafe for EvolveState<A>where
A: RefUnwindSafe,
impl<A> Send for EvolveState<A>
impl<A> Sync for EvolveState<A>
impl<A> Unpin for EvolveState<A>where
A: Unpin,
impl<A> UnwindSafe for EvolveState<A>where
A: UnwindSafe,
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)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 more