pub struct SteadyStateBuilder<G, F, S, C, M, Fit, Term>where
G: EvolutionaryGenome,
F: FitnessValue,{ /* private fields */ }Expand description
Builder for SteadyStateGA
Implementations§
Source§impl<G, F> SteadyStateBuilder<G, F, (), (), (), (), ()>where
G: EvolutionaryGenome,
F: FitnessValue,
impl<G, F> SteadyStateBuilder<G, F, (), (), (), (), ()>where
G: EvolutionaryGenome,
F: FitnessValue,
Source§impl<G, F, S, C, M, Fit, Term> SteadyStateBuilder<G, F, S, C, M, Fit, Term>where
G: EvolutionaryGenome,
F: FitnessValue,
impl<G, F, S, C, M, Fit, Term> SteadyStateBuilder<G, F, S, C, M, Fit, Term>where
G: EvolutionaryGenome,
F: FitnessValue,
Sourcepub fn population_size(self, size: usize) -> Self
pub fn population_size(self, size: usize) -> Self
Set the population size
Sourcepub fn offspring_count(self, count: usize) -> Self
pub fn offspring_count(self, count: usize) -> Self
Set the number of offspring per step
Sourcepub fn crossover_probability(self, probability: f64) -> Self
pub fn crossover_probability(self, probability: f64) -> Self
Set the crossover probability
Sourcepub fn replacement(self, strategy: ReplacementStrategy) -> Self
pub fn replacement(self, strategy: ReplacementStrategy) -> Self
Set the replacement strategy
Sourcepub fn parallel_evaluation(self, enabled: bool) -> Self
pub fn parallel_evaluation(self, enabled: bool) -> Self
Enable or disable parallel evaluation
Sourcepub fn steps_per_generation(self, steps: usize) -> Self
pub fn steps_per_generation(self, steps: usize) -> Self
Set the number of steps per generation (for statistics)
Sourcepub fn bounds(self, bounds: MultiBounds) -> Self
pub fn bounds(self, bounds: MultiBounds) -> Self
Set the search space bounds
Sourcepub fn selection<NewS>(
self,
selection: NewS,
) -> SteadyStateBuilder<G, F, NewS, C, M, Fit, Term>where
NewS: SelectionOperator<G>,
pub fn selection<NewS>(
self,
selection: NewS,
) -> SteadyStateBuilder<G, F, NewS, C, M, Fit, Term>where
NewS: SelectionOperator<G>,
Set the selection operator
Sourcepub fn crossover<NewC>(
self,
crossover: NewC,
) -> SteadyStateBuilder<G, F, S, NewC, M, Fit, Term>where
NewC: CrossoverOperator<G>,
pub fn crossover<NewC>(
self,
crossover: NewC,
) -> SteadyStateBuilder<G, F, S, NewC, M, Fit, Term>where
NewC: CrossoverOperator<G>,
Set the crossover operator
Sourcepub fn mutation<NewM>(
self,
mutation: NewM,
) -> SteadyStateBuilder<G, F, S, C, NewM, Fit, Term>where
NewM: MutationOperator<G>,
pub fn mutation<NewM>(
self,
mutation: NewM,
) -> SteadyStateBuilder<G, F, S, C, NewM, Fit, Term>where
NewM: MutationOperator<G>,
Set the mutation operator
Sourcepub fn fitness<NewFit>(
self,
fitness: NewFit,
) -> SteadyStateBuilder<G, F, S, C, M, NewFit, Term>where
NewFit: Fitness<Genome = G, Value = F>,
pub fn fitness<NewFit>(
self,
fitness: NewFit,
) -> SteadyStateBuilder<G, F, S, C, M, NewFit, Term>where
NewFit: Fitness<Genome = G, Value = F>,
Set the fitness function
Sourcepub fn termination<NewTerm>(
self,
termination: NewTerm,
) -> SteadyStateBuilder<G, F, S, C, M, Fit, NewTerm>where
NewTerm: TerminationCriterion<G, F>,
pub fn termination<NewTerm>(
self,
termination: NewTerm,
) -> SteadyStateBuilder<G, F, S, C, M, Fit, NewTerm>where
NewTerm: TerminationCriterion<G, F>,
Set the termination criterion
Sourcepub fn max_generations(
self,
max: usize,
) -> SteadyStateBuilder<G, F, S, C, M, Fit, MaxGenerations>
pub fn max_generations( self, max: usize, ) -> SteadyStateBuilder<G, F, S, C, M, Fit, MaxGenerations>
Set max generations (convenience method)
Source§impl<G, F, S, C, M, Fit, Term> SteadyStateBuilder<G, F, S, C, M, Fit, Term>where
G: EvolutionaryGenome + Send + Sync,
F: FitnessValue + Send,
S: SelectionOperator<G>,
C: CrossoverOperator<G>,
M: MutationOperator<G>,
Fit: Fitness<Genome = G, Value = F> + Sync,
Term: TerminationCriterion<G, F>,
impl<G, F, S, C, M, Fit, Term> SteadyStateBuilder<G, F, S, C, M, Fit, Term>where
G: EvolutionaryGenome + Send + Sync,
F: FitnessValue + Send,
S: SelectionOperator<G>,
C: CrossoverOperator<G>,
M: MutationOperator<G>,
Fit: Fitness<Genome = G, Value = F> + Sync,
Term: TerminationCriterion<G, F>,
Sourcepub fn build(
self,
) -> Result<SteadyStateGA<G, F, S, C, M, Fit, Term>, EvolutionError>
pub fn build( self, ) -> Result<SteadyStateGA<G, F, S, C, M, Fit, Term>, EvolutionError>
Build the SteadyStateGA instance
Trait Implementations§
Source§impl<G, F> Default for SteadyStateBuilder<G, F, (), (), (), (), ()>where
G: EvolutionaryGenome,
F: FitnessValue,
impl<G, F> Default for SteadyStateBuilder<G, F, (), (), (), (), ()>where
G: EvolutionaryGenome,
F: FitnessValue,
Auto Trait Implementations§
impl<G, F, S, C, M, Fit, Term> Freeze for SteadyStateBuilder<G, F, S, C, M, Fit, Term>
impl<G, F, S, C, M, Fit, Term> RefUnwindSafe for SteadyStateBuilder<G, F, S, C, M, Fit, Term>where
S: RefUnwindSafe,
C: RefUnwindSafe,
M: RefUnwindSafe,
Fit: RefUnwindSafe,
Term: RefUnwindSafe,
G: RefUnwindSafe,
F: RefUnwindSafe,
impl<G, F, S, C, M, Fit, Term> Send for SteadyStateBuilder<G, F, S, C, M, Fit, Term>
impl<G, F, S, C, M, Fit, Term> Sync for SteadyStateBuilder<G, F, S, C, M, Fit, Term>
impl<G, F, S, C, M, Fit, Term> Unpin for SteadyStateBuilder<G, F, S, C, M, Fit, Term>
impl<G, F, S, C, M, Fit, Term> UnsafeUnpin for SteadyStateBuilder<G, F, S, C, M, Fit, Term>
impl<G, F, S, C, M, Fit, Term> UnwindSafe for SteadyStateBuilder<G, F, S, C, M, Fit, Term>where
S: UnwindSafe,
C: UnwindSafe,
M: UnwindSafe,
Fit: UnwindSafe,
Term: UnwindSafe,
G: UnwindSafe,
F: 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> 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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.