pub struct GeneticEngineParams<'a, G, A, T>{
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 population: Option<Population<G, A>>,
pub codex: Option<Arc<&'a dyn Codex<G, A, T>>>,
pub fitness_fn: Option<Arc<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>>
§population: Option<Population<G, A>>
§codex: Option<Arc<&'a dyn Codex<G, A, T>>>
§fitness_fn: Option<Arc<dyn Fn(&T) -> Score>>
Implementations§
Source§impl<'a, G, A, T> GeneticEngineParams<'a, G, A, T>
impl<'a, G, A, T> GeneticEngineParams<'a, 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: &'a impl 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<'a, G, A, T>
Auto Trait Implementations§
impl<'a, G, A, T> Freeze for GeneticEngineParams<'a, G, A, T>
impl<'a, G, A, T> !RefUnwindSafe for GeneticEngineParams<'a, G, A, T>
impl<'a, G, A, T> !Send for GeneticEngineParams<'a, G, A, T>
impl<'a, G, A, T> !Sync for GeneticEngineParams<'a, G, A, T>
impl<'a, G, A, T> Unpin for GeneticEngineParams<'a, G, A, T>
impl<'a, G, A, T> !UnwindSafe for GeneticEngineParams<'a, 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