Struct genetic_algorithm::strategy::hill_climb::HillClimbBuilder
source · pub struct HillClimbBuilder<G: IncrementalGenotype, F: Fitness<Genotype = G>> {
pub genotype: Option<G>,
pub variant: Option<HillClimbVariant>,
pub fitness: Option<F>,
pub fitness_ordering: FitnessOrdering,
pub multithreading: bool,
pub max_stale_generations: Option<usize>,
pub target_fitness_score: Option<FitnessValue>,
pub valid_fitness_score: Option<FitnessValue>,
pub scaling: Option<Scaling>,
}
Expand description
The builder for an HillClimb struct.
Fields§
§genotype: Option<G>
§variant: Option<HillClimbVariant>
§fitness: Option<F>
§fitness_ordering: FitnessOrdering
§multithreading: bool
§max_stale_generations: Option<usize>
§target_fitness_score: Option<FitnessValue>
§valid_fitness_score: Option<FitnessValue>
§scaling: Option<Scaling>
Implementations§
source§impl<G: IncrementalGenotype, F: Fitness<Genotype = G>> Builder<G, F>
impl<G: IncrementalGenotype, F: Fitness<Genotype = G>> Builder<G, F>
pub fn new() -> Self
pub fn build(self) -> Result<HillClimb<G, F>, TryFromBuilderError>
pub fn call<R: Rng>( self, rng: &mut R ) -> Result<HillClimb<G, F>, TryFromBuilderError>
pub fn call_repeatedly<R: Rng>( self, max_repeats: usize, rng: &mut R ) -> Result<HillClimb<G, F>, TryFromBuilderError>
pub fn with_genotype(self, genotype: G) -> Self
pub fn with_variant(self, variant: HillClimbVariant) -> Self
pub fn with_fitness_ordering(self, fitness_ordering: FitnessOrdering) -> Self
pub fn with_multithreading(self, multithreading: bool) -> Self
pub fn with_fitness(self, fitness: F) -> Self
pub fn with_max_stale_generations(self, max_stale_generations: usize) -> Self
pub fn with_max_stale_generations_option( self, max_stale_generations_option: Option<usize> ) -> Self
pub fn with_target_fitness_score( self, target_fitness_score: FitnessValue ) -> Self
pub fn with_target_fitness_score_option( self, target_fitness_score_option: Option<FitnessValue> ) -> Self
pub fn with_valid_fitness_score(self, valid_fitness_score: FitnessValue) -> Self
pub fn with_valid_fitness_score_option( self, valid_fitness_score_option: Option<FitnessValue> ) -> Self
pub fn with_scaling(self, scaling: Scaling) -> Self
Trait Implementations§
source§impl<G: Clone + IncrementalGenotype, F: Clone + Fitness<Genotype = G>> Clone for Builder<G, F>
impl<G: Clone + IncrementalGenotype, F: Clone + Fitness<Genotype = G>> Clone for Builder<G, F>
source§impl<G: Debug + IncrementalGenotype, F: Debug + Fitness<Genotype = G>> Debug for Builder<G, F>
impl<G: Debug + IncrementalGenotype, F: Debug + Fitness<Genotype = G>> Debug for Builder<G, F>
Auto Trait Implementations§
impl<G, F> RefUnwindSafe for Builder<G, F>where F: RefUnwindSafe, G: RefUnwindSafe,
impl<G, F> Send for Builder<G, F>
impl<G, F> Sync for Builder<G, F>where G: Sync,
impl<G, F> Unpin for Builder<G, F>where F: Unpin, G: Unpin,
impl<G, F> UnwindSafe for Builder<G, F>where F: UnwindSafe, G: 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