[][src]Struct oxigen::GeneticExecution

pub struct GeneticExecution<T: PartialEq + Send + Sync, Ind: Genotype<T>> { /* fields omitted */ }

Struct that defines a genetic algorithm execution.

Methods

impl<T: PartialEq + Send + Sync, Ind: Genotype<T>> GeneticExecution<T, Ind>[src]

pub fn new() -> Self[src]

Creates a new default genetic algorithm execution.

pub fn population_size(self, new_pop_size: usize) -> Self[src]

Sets the population size.

pub fn population(self, new_pop: Vec<IndWithFitness<T, Ind>>) -> Self[src]

Sets the initial population individuals. If lower individuals than population_size are received, the rest of population will be generated randomly.

pub fn genotype_size(self, new_size: Ind::ProblemSize) -> Self[src]

Sets the genotype size.

pub fn mutation_rate(self, new_mut: Box<dyn MutationRate>) -> Self[src]

Sets the mutation rate.

pub fn selection_rate(self, new_sel_rate: Box<dyn SelectionRate>) -> Self[src]

Sets the number of tournament stages whose individuals are selected for crossover.

pub fn select_function(self, new_sel: Box<dyn Selection>) -> Self[src]

Sets the selection function of the genetic algorithm.

pub fn age_function(self, new_age: Box<dyn Age>) -> Self[src]

Sets the age function of the genetic algorithm.

pub fn crossover_function(self, new_cross: Box<dyn Crossover<T, Ind>>) -> Self[src]

Sets the crossover function of the genetic algorithm.

pub fn population_refitness_function(
    self,
    new_refit: Box<dyn PopulationRefitness<T, Ind>>
) -> Self
[src]

Sets the population refitness function of the genetic algorithm.

pub fn survival_pressure_function(
    self,
    new_surv: Box<dyn SurvivalPressure<T, Ind>>
) -> Self
[src]

Sets the survival pressure function of the genetic algorithm.

pub fn stop_criterion(self, new_crit: Box<dyn StopCriterion>) -> Self[src]

Sets the stop criterion of the genetic algorithm.

pub fn cache_fitness(self, new_cache: bool) -> Self[src]

Sets the cache fitness flag.

pub fn global_cache(self, new_global_cache: bool) -> Self[src]

Sets the global cache flag. Panics: when trying to put it true without global_cache feature enabled.

pub fn progress_log(self, generations: u64, log_file: File) -> Self[src]

Sets the progress log.

pub fn population_log(self, generations: u64, log_file: File) -> Self[src]

Sets the progress log.

pub fn run(self) -> (Vec<Ind>, u64, f64, Vec<IndWithFitness<T, Ind>>)[src]

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.
  • The entire population in the last generation (useful for resuming the execution).

Trait Implementations

impl<T: PartialEq + Send + Sync, Ind: Genotype<T>> Default for GeneticExecution<T, Ind>[src]

Auto Trait Implementations

impl<T, Ind> !RefUnwindSafe for GeneticExecution<T, Ind>

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> Unpin for GeneticExecution<T, Ind> where
    Ind: Unpin,
    T: Unpin,
    <Ind as Genotype<T>>::ProblemSize: Unpin

impl<T, Ind> !UnwindSafe for GeneticExecution<T, Ind>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,