[−][src]Struct oxigen::GeneticExecution
Struct that defines a genetic algorithm execution.
Implementations
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(mut self: Self, new_pop_size: usize) -> Self
[src]
Sets the population size.
pub fn population(mut self: 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(mut self: Self, new_size: Ind::ProblemSize) -> Self
[src]
Sets the genotype size.
pub fn mutation_rate(mut self: Self, new_mut: Box<dyn MutationRate>) -> Self
[src]
Sets the mutation rate.
pub fn selection_rate(
mut self: Self,
new_sel_rate: Box<dyn SelectionRate>
) -> Self
[src]
mut self: Self,
new_sel_rate: Box<dyn SelectionRate>
) -> Self
Sets the number of tournament stages whose individuals are selected for crossover.
pub fn select_function(mut self: Self, new_sel: Box<dyn Selection>) -> Self
[src]
Sets the selection function of the genetic algorithm.
pub fn age_function(mut self: Self, new_age: Box<dyn Age>) -> Self
[src]
Sets the age function of the genetic algorithm.
pub fn crossover_function(
mut self: Self,
new_cross: Box<dyn Crossover<T, Ind>>
) -> Self
[src]
mut self: Self,
new_cross: Box<dyn Crossover<T, Ind>>
) -> Self
Sets the crossover function of the genetic algorithm.
pub fn population_refitness_function(
mut self: Self,
new_refit: Box<dyn PopulationRefitness<T, Ind>>
) -> Self
[src]
mut self: Self,
new_refit: Box<dyn PopulationRefitness<T, Ind>>
) -> Self
Sets the population refitness function of the genetic algorithm.
pub fn survival_pressure_function(
mut self: Self,
new_surv: Box<dyn SurvivalPressure<T, Ind>>
) -> Self
[src]
mut self: Self,
new_surv: Box<dyn SurvivalPressure<T, Ind>>
) -> Self
Sets the survival pressure function of the genetic algorithm.
pub fn stop_criterion(mut self: Self, new_crit: Box<dyn StopCriterion>) -> Self
[src]
Sets the stop criterion of the genetic algorithm.
pub fn cache_fitness(mut self: Self, new_cache: bool) -> Self
[src]
Sets the cache fitness flag.
pub fn global_cache(mut self: 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(mut self: Self, generations: u64, log_file: File) -> Self
[src]
Sets the progress log.
pub fn population_log(mut self: Self, generations: u64, log_file: File) -> Self
[src]
Sets the progress log.
pub fn run(mut self: 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
Auto Trait Implementations
impl<T, Ind> !RefUnwindSafe for GeneticExecution<T, Ind>
[src]
impl<T, Ind> Send for GeneticExecution<T, Ind> where
<Ind as Genotype<T>>::ProblemSize: Send,
[src]
<Ind as Genotype<T>>::ProblemSize: Send,
impl<T, Ind> Sync for GeneticExecution<T, Ind> where
<Ind as Genotype<T>>::ProblemSize: Sync,
[src]
<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,
[src]
Ind: Unpin,
T: Unpin,
<Ind as Genotype<T>>::ProblemSize: Unpin,
impl<T, Ind> !UnwindSafe for GeneticExecution<T, Ind>
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,