radiate_rust::engines::genetic_engine_params

Struct GeneticEngineParams

Source
pub struct GeneticEngineParams<'a, G, A, T>
where G: Gene<G, A>, T: Clone,
{ 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>
where G: Gene<G, A>, T: Clone,

Source

pub fn new() -> Self

Source

pub fn population_size(self, population_size: usize) -> Self

Source

pub fn max_age(self, max_age: i32) -> Self

Source

pub fn offspring_fraction(self, offspring_fraction: f32) -> Self

Source

pub fn codex(self, codex: &'a impl Codex<G, A, T>) -> Self

Source

pub fn population(self, population: Population<G, A>) -> Self

Source

pub fn fitness_fn(self, fitness_func: impl Fn(&T) -> Score + 'static) -> Self

Source

pub fn survivor_selector(self, selector: Selector) -> Self

Source

pub fn offspring_selector(self, selector: Selector) -> Self

Source

pub fn alterer(self, alterers: Vec<Alterer<G, A>>) -> Self

Source

pub fn minimizing(self) -> Self

Source

pub fn maximizing(self) -> Self

Source

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>
where A: Unpin, G: Unpin,

§

impl<'a, G, A, T> !UnwindSafe for GeneticEngineParams<'a, G, A, T>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V