[][src]Struct maver::Genetic

pub struct Genetic { /* fields omitted */ }

Methods

impl Genetic[src]

pub fn new(
    population_size: usize,
    network_init: &[usize],
    act_in: Activation,
    act_out: Activation
) -> Genetic
[src]

Create new genetic algorithm implementation population_size: count of organisms in one generation network_init: network topology act_in:: activation function for hidden perceptrons act_out: activation function for output perceptrons

pub fn advanced_evaluation(&mut self, fun: impl FnMut(&mut [Organism]))[src]

Advanced evaluation function:

let mut g = Genetic::new(...);
g.advanced_evaluation(|organisms: &mut [Organism]| {
    // write code there
});

pub fn evaluate(&mut self, env: &mut dyn Environment)[src]

Evaluate current population in env. This code will evaluate organisms in parallel,if you want to evaluate without parallelism use advanced_evaluation function

pub fn get_champion(&self) -> &Organism[src]

Get organism with best fitness in current population

pub fn fittest(&self) -> [usize; 2][src]

Returns indexes of fittest organisms

pub fn evolve(&mut self, learn_params: &LearnParams)[src]

Create offspring by mutation and mating.

Auto Trait Implementations

impl Send for Genetic

impl Unpin for Genetic

impl Sync for Genetic

impl UnwindSafe for Genetic

impl RefUnwindSafe for Genetic

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

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