Struct radiate_rust::engines::genetic_engine::GeneticEngine

source ·
pub struct GeneticEngine<G, A, T>
where G: Gene<G, A>,
{ pub params: GeneticEngineParams<G, A, T>, }

Fields§

§params: GeneticEngineParams<G, A, T>

Implementations§

source§

impl<G, A, T> GeneticEngine<G, A, T>
where G: Gene<G, A>,

source

pub fn new(params: GeneticEngineParams<G, A, T>) -> Self

source

pub fn from_codex(codex: Codex<G, A, T>) -> GeneticEngineParams<G, A, T>

source

pub fn evaluate(&self, handle: &mut EngineContext<G, A, T>)

source

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

source

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

source

pub fn alter(&self, population: &mut Population<G, A>, generation: i32)

source

pub fn filter(&self, population: &mut Population<G, A>, generation: i32)

source

pub fn recombine( &self, handle: &mut EngineContext<G, A, T>, survivors: Population<G, A>, offspring: Population<G, A>, )

source

pub fn audit(&self, output: &mut EngineContext<G, A, T>)

source

pub fn survivor_selector(&self) -> &impl Select<G, A>

source

pub fn offspring_selector(&self) -> &impl Select<G, A>

source

pub fn alterer(&self) -> &impl Alter<G, A>

source

pub fn codex(&self) -> &Codex<G, A, T>

source

pub fn fitness_fn(&self) -> &impl Fn(&T) -> Score

source

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

source

pub fn optimize(&self) -> &Optimize

source

pub fn survivor_count(&self) -> usize

source

pub fn offspring_count(&self) -> usize

Trait Implementations§

source§

impl<G: Gene<G, A>, A, T: Clone> Engine<G, A, T> for GeneticEngine<G, A, T>

source§

fn fit<F: Fn(&EngineContext<G, A, T>) -> bool>( &self, limit: F, ) -> EngineContext<G, A, T>

source§

fn start(&self) -> EngineContext<G, A, T>

source§

fn stop(&self, output: &mut EngineContext<G, A, T>) -> EngineContext<G, A, T>

Auto Trait Implementations§

§

impl<G, A, T> Freeze for GeneticEngine<G, A, T>

§

impl<G, A, T> !RefUnwindSafe for GeneticEngine<G, A, T>

§

impl<G, A, T> !Send for GeneticEngine<G, A, T>

§

impl<G, A, T> !Sync for GeneticEngine<G, A, T>

§

impl<G, A, T> Unpin for GeneticEngine<G, A, T>
where A: Unpin, G: Unpin,

§

impl<G, A, T> !UnwindSafe for GeneticEngine<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>,

§

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>,

§

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