pub struct HillClimbState<G: HillClimbGenotype> {
pub current_iteration: usize,
pub current_generation: usize,
pub stale_generations: usize,
pub scale_generation: usize,
pub best_generation: usize,
pub best_fitness_score: Option<FitnessValue>,
pub best_chromosome: Option<Chromosome<G::Allele>>,
pub chromosome: Option<Chromosome<G::Allele>>,
pub population: Population<G::Allele>,
pub durations: HashMap<StrategyAction, Duration>,
}Expand description
Stores the state of the HillClimb strategy.
Fields§
§current_iteration: usize§current_generation: usize§stale_generations: usize§scale_generation: usize§best_generation: usize§best_fitness_score: Option<FitnessValue>§best_chromosome: Option<Chromosome<G::Allele>>§chromosome: Option<Chromosome<G::Allele>>§population: Population<G::Allele>§durations: HashMap<StrategyAction, Duration>Implementations§
Source§impl<G: HillClimbGenotype> HillClimbState<G>
impl<G: HillClimbGenotype> HillClimbState<G>
Trait Implementations§
Source§impl<G: HillClimbGenotype> Display for HillClimbState<G>
impl<G: HillClimbGenotype> Display for HillClimbState<G>
Source§impl<G: HillClimbGenotype> StrategyState<G> for HillClimbState<G>
impl<G: HillClimbGenotype> StrategyState<G> for HillClimbState<G>
fn chromosome_as_ref(&self) -> &Option<Chromosome<G::Allele>>
fn population_as_ref(&self) -> &Population<G::Allele>
fn chromosome_as_mut(&mut self) -> &mut Option<Chromosome<G::Allele>>
fn population_as_mut(&mut self) -> &mut Population<G::Allele>
fn best_fitness_score(&self) -> Option<FitnessValue>
fn best_generation(&self) -> usize
fn current_generation(&self) -> usize
fn current_iteration(&self) -> usize
fn increment_generation(&mut self)
fn stale_generations(&self) -> usize
fn increment_stale_generations(&mut self)
fn reset_stale_generations(&mut self)
fn scale_generation(&self) -> usize
fn reset_scale_generation(&mut self)
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 best_genes(&self) -> Option<Genes<G::Allele>>
fn close_duration(&mut self, total_duration: Duration)
fn fitness_duration_rate(&self) -> f32
fn is_better_chromosome( &self, contending_chromosome: &Chromosome<G::Allele>, fitness_ordering: &FitnessOrdering, replace_on_equal_fitness: bool, ) -> (bool, bool)
Auto Trait Implementations§
impl<G> Freeze for HillClimbState<G>
impl<G> RefUnwindSafe for HillClimbState<G>
impl<G> Send for HillClimbState<G>
impl<G> Sync for HillClimbState<G>
impl<G> Unpin for HillClimbState<G>
impl<G> UnwindSafe for HillClimbState<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