Struct oxigen::GeneticExecution [−][src]
pub struct GeneticExecution<T, Ind: Genotype<T>> { /* fields omitted */ }
Struct that defines a genetic algorithm execution.
Methods
impl<T, Ind: Genotype<T>> GeneticExecution<T, Ind>
[src]
impl<T, Ind: Genotype<T>> GeneticExecution<T, Ind>
pub fn new() -> Self
[src]
pub fn new() -> Self
Creates a new default genetic algorithm execution.
pub fn population_size(self, new_pop: usize) -> Self
[src]
pub fn population_size(self, new_pop: usize) -> Self
Sets the population size.
pub fn genotype_size(self, new_size: Ind::ProblemSize) -> Self
[src]
pub fn genotype_size(self, new_size: Ind::ProblemSize) -> Self
Sets the genotype size.
pub fn mutation_rate(self, new_mut: Box<MutationRate>) -> Self
[src]
pub fn mutation_rate(self, new_mut: Box<MutationRate>) -> Self
Sets the mutation rate.
pub fn selection_rate(self, new_sel_rate: Box<SelectionRate>) -> Self
[src]
pub fn selection_rate(self, new_sel_rate: Box<SelectionRate>) -> Self
Sets the number of tournament stages whose individuals are selected for crossover.
pub fn select_function(self, new_sel: Box<Selection>) -> Self
[src]
pub fn select_function(self, new_sel: Box<Selection>) -> Self
Sets the selection function of the genetic algorithm.
pub fn age_function(self, new_age: Box<Age>) -> Self
[src]
pub fn age_function(self, new_age: Box<Age>) -> Self
Sets the age function of the genetic algorithm.
pub fn crossover_function(self, new_cross: Box<Crossover<T, Ind>>) -> Self
[src]
pub fn crossover_function(self, new_cross: Box<Crossover<T, Ind>>) -> Self
Sets the crossover function of the genetic algorithm.
pub fn survival_pressure_function(
self,
new_surv: Box<SurvivalPressure<T, Ind>>
) -> Self
[src]
pub fn survival_pressure_function(
self,
new_surv: Box<SurvivalPressure<T, Ind>>
) -> Self
Sets the survival pressure function of the genetic algorithm.
pub fn stop_criterion(self, new_crit: Box<StopCriterion>) -> Self
[src]
pub fn stop_criterion(self, new_crit: Box<StopCriterion>) -> Self
Sets the stop criterion of the genetic algorithm.
pub fn cache_fitness(self, new_cache: bool) -> Self
[src]
pub fn cache_fitness(self, new_cache: bool) -> Self
Sets the cache fitness flag.
pub fn progress_log(self, generations: u64, log_file: File) -> Self
[src]
pub fn progress_log(self, generations: u64, log_file: File) -> Self
Sets the progress log.
pub fn population_log(self, generations: u64, log_file: File) -> Self
[src]
pub fn population_log(self, generations: u64, log_file: File) -> Self
Sets the progress log.
pub fn run(self) -> (Vec<Box<Ind>>, u64, f64)
[src]
pub fn run(self) -> (Vec<Box<Ind>>, u64, f64)
Run the genetic algorithm executiion until the stop_criterion
is satisfied.
Returns
- A vector with the individuals of the population that are solution of the problem.
- The number of generations run.
- The average progress in the last generations.
Trait Implementations
impl<T, Ind: Genotype<T>> Default for GeneticExecution<T, Ind>
[src]
impl<T, Ind: Genotype<T>> Default for GeneticExecution<T, Ind>
Auto Trait Implementations
impl<T, Ind> Send for GeneticExecution<T, Ind> where
<Ind as Genotype<T>>::ProblemSize: Send,
impl<T, Ind> Send for GeneticExecution<T, Ind> where
<Ind as Genotype<T>>::ProblemSize: Send,
impl<T, Ind> Sync for GeneticExecution<T, Ind> where
<Ind as Genotype<T>>::ProblemSize: Sync,
impl<T, Ind> Sync for GeneticExecution<T, Ind> where
<Ind as Genotype<T>>::ProblemSize: Sync,