ReplacementStrategy

Trait ReplacementStrategy 

Source
pub trait ReplacementStrategy<C>: Send + Sync
where C: Chromosome,
{ // Required method fn replace( &self, population: &Population<C>, encoder: Arc<dyn Fn() -> Genotype<C> + Send + Sync>, ) -> Genotype<C>; }
Expand description

Trait for replacement strategies in the algorithms.

This trait defines a method for replacing a member of the Population with a new individual after the current individual has been determined to be invalid. Typically, this is done by replacing the individual with a new one generated by the encoder. But in some cases, it may be desirable to replace the individual in a different way, such as by sampling from the Population.

Required Methods§

Source

fn replace( &self, population: &Population<C>, encoder: Arc<dyn Fn() -> Genotype<C> + Send + Sync>, ) -> Genotype<C>

Implementors§