pub struct GeneticEngineParams<G, A, T>where
G: Gene<G, A>,{
pub population_size: usize,
pub max_age: i32,
pub offspring_fraction: f32,
pub optimize: Optimize,
pub survivor_selector: Selector,
pub offspring_selector: Selector,
pub alterer: Option<CompositeAlterer<G, A>>,
pub codex: Option<Codex<G, A, T>>,
pub population: Option<Population<G, A>>,
pub fitness_fn: Option<Box<dyn Fn(&T) -> Score>>,
}Fields§
§population_size: usize§max_age: i32§offspring_fraction: f32§optimize: Optimize§survivor_selector: Selector§offspring_selector: Selector§alterer: Option<CompositeAlterer<G, A>>§codex: Option<Codex<G, A, T>>§population: Option<Population<G, A>>§fitness_fn: Option<Box<dyn Fn(&T) -> Score>>Implementations§
source§impl<G: Gene<G, A>, A, T> GeneticEngineParams<G, A, T>
impl<G: Gene<G, A>, A, T> GeneticEngineParams<G, A, T>
pub fn new() -> Self
pub fn population_size(self, population_size: usize) -> Self
pub fn max_age(self, max_age: i32) -> Self
pub fn offspring_fraction(self, offspring_fraction: f32) -> Self
pub fn codex(self, codex: Codex<G, A, T>) -> Self
pub fn population(self, population: Population<G, A>) -> Self
pub fn fitness_fn(self, fitness_func: impl Fn(&T) -> Score + 'static) -> Self
pub fn survivor_selector(self, selector: Selector) -> Self
pub fn offspring_selector(self, selector: Selector) -> Self
pub fn alterer(self, alterers: Vec<Alterer<G, A>>) -> Self
pub fn minimizing(self) -> Self
pub fn maximizing(self) -> Self
pub fn build(self) -> GeneticEngine<G, A, T>
Auto Trait Implementations§
impl<G, A, T> Freeze for GeneticEngineParams<G, A, T>
impl<G, A, T> !RefUnwindSafe for GeneticEngineParams<G, A, T>
impl<G, A, T> !Send for GeneticEngineParams<G, A, T>
impl<G, A, T> !Sync for GeneticEngineParams<G, A, T>
impl<G, A, T> Unpin for GeneticEngineParams<G, A, T>
impl<G, A, T> !UnwindSafe for GeneticEngineParams<G, A, T>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more