pub trait SelectionHook: 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
Operation hook for a selection operator.
NOTE: a plain before/after callback, not a [fugue::Handler].
Required Methods§
Sourcefn before_selection(&self, population_size: usize, generation: usize)
fn before_selection(&self, population_size: usize, generation: usize)
Called before selection
Sourcefn after_selection(&self, record: &SelectionRecord)
fn after_selection(&self, record: &SelectionRecord)
Called after selection
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".