pub struct PermutateState<G: PermutateGenotype> {
pub current_iteration: usize,
pub current_generation: usize,
pub stale_generations: usize,
pub best_generation: usize,
pub best_fitness_score: Option<FitnessValue>,
pub durations: HashMap<StrategyAction, Duration>,
pub chromosome: Option<G::Chromosome>,
pub population: Population<G::Chromosome>,
}
Expand description
Stores the state of the Permutate strategy
Fields§
§current_iteration: usize
§current_generation: usize
§stale_generations: usize
§best_generation: usize
§best_fitness_score: Option<FitnessValue>
§durations: HashMap<StrategyAction, Duration>
§chromosome: Option<G::Chromosome>
§population: Population<G::Chromosome>
Implementations§
Source§impl<G: PermutateGenotype> PermutateState<G>
impl<G: PermutateGenotype> PermutateState<G>
Trait Implementations§
Source§impl<G: PermutateGenotype> Display for PermutateState<G>
impl<G: PermutateGenotype> Display for PermutateState<G>
Source§impl<G: PermutateGenotype> StrategyState<G> for PermutateState<G>
impl<G: PermutateGenotype> StrategyState<G> for PermutateState<G>
fn chromosome_as_ref(&self) -> &Option<G::Chromosome>
fn population_as_ref(&self) -> &Population<G::Chromosome>
fn chromosome_as_mut(&mut self) -> &mut Option<G::Chromosome>
fn population_as_mut(&mut self) -> &mut Population<G::Chromosome>
fn best_fitness_score(&self) -> Option<FitnessValue>
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 current_scale_index(&self) -> Option<usize>
fn population_cardinality(&self) -> Option<usize>
fn durations(&self) -> &HashMap<StrategyAction, Duration>
fn add_duration(&mut self, action: StrategyAction, duration: Duration)
fn total_duration(&self) -> Duration
fn close_duration(&mut self, total_duration: Duration)
fn fitness_duration_rate(&self) -> f32
fn is_better_chromosome( &self, contending_chromosome: &G::Chromosome, fitness_ordering: &FitnessOrdering, replace_on_equal_fitness: bool, ) -> (bool, bool)
Auto Trait Implementations§
impl<G> Freeze for PermutateState<G>
impl<G> RefUnwindSafe for PermutateState<G>
impl<G> Send for PermutateState<G>
impl<G> Sync for PermutateState<G>
impl<G> Unpin for PermutateState<G>
impl<G> UnwindSafe for PermutateState<G>
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> 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