Skip to main content

SelectionHandler

Trait SelectionHandler 

Source
pub trait SelectionHandler: Send + Sync {
    // Required methods
    fn before_selection(&self, population_size: usize, generation: usize);
    fn after_selection(&self, record: &SelectionRecord);

    // Provided method
    fn modify_probabilities(&self, probabilities: Vec<f64>) -> Vec<f64> { ... }
}
Expand description

Effect handler trait for selection operations

Required Methods§

Source

fn before_selection(&self, population_size: usize, generation: usize)

Called before selection

Source

fn after_selection(&self, record: &SelectionRecord)

Called after selection

Provided Methods§

Source

fn modify_probabilities(&self, probabilities: Vec<f64>) -> Vec<f64>

Optionally modify selection probabilities

Implementors§