[][src]Trait radiate::engine::genome::Genome

pub trait Genome<T: ?Sized, E: ?Sized> where
    T: Send + Sync,
    E: Send + Sync
{ fn crossover(
        one: &T,
        two: &T,
        env: &Arc<RwLock<E>>,
        crossover_rate: f32
    ) -> Option<T>
    where
        T: Sized,
        E: Envionment + Sized
;
fn distance(one: &T, two: &T, env: &Arc<RwLock<E>>) -> f32; fn base(_: &mut E) -> T
    where
        T: Sized
, { ... } }

Required methods

fn crossover(
    one: &T,
    two: &T,
    env: &Arc<RwLock<E>>,
    crossover_rate: f32
) -> Option<T> where
    T: Sized,
    E: Envionment + Sized

Crossover is the process of taking two types (T) and returning a new type, this is done through some defined form of mutation using the config type, or through crossover where parts of one type are given to parts of the other and that resulting type is returnd

fn distance(one: &T, two: &T, env: &Arc<RwLock<E>>) -> f32

This is a measure of a evolutionary types structure or topology - depending on what is being evolved. This is needed to split the members in their respective species - essentially it is a measure of how far away two types are from each other in a genetic sense. Think of something like how similar humans are to dolphins, this is a way to quanitfy that.

Loading content...

Provided methods

fn base(_: &mut E) -> T where
    T: Sized

Genome needs to have a base implementation in order for one of the population options to be satisfied

This can probably be iplemented in a generic way for default if the user doesn't want to implement it for their problem.

Loading content...

Implementors

impl Genome<Evtree, TreeEnvionment> for Evtree[src]

fn crossover(
    one: &Evtree,
    two: &Evtree,
    settings: &Arc<RwLock<TreeEnvionment>>,
    crossover_rate: f32
) -> Option<Evtree>
[src]

one should be the more fit Evtree and two should be the less fit Evtree. This function should attemp to produce a Evtree which is no higher than the specified max height of a Evtree.

fn base(settings: &mut TreeEnvionment) -> Evtree[src]

Implement the base trait for the tree This provides a generic way to get a base tree for starting the evolution process Get the base tree type and return a randomly generated base tree created through the tree settings given to it at its new() call

fn distance(
    one: &Evtree,
    two: &Evtree,
    _settings: &Arc<RwLock<TreeEnvionment>>
) -> f32
[src]

takes in a Rc<RefCell<Self in order to make it simpler for the Generation to throw types it already has inside the function by simplmy cloing them. This function will drop the references to the Self traits at the end of this function's scope

impl Genome<Dense, NeatEnvironment> for Dense where
    Dense: Layer
[src]

impl Genome<LSTM, NeatEnvironment> for LSTM where
    LSTM: Layer
[src]

in order for the lstm layer to be evolved along with the rest of the network, Genome must be implemented so that the layer can be crossed over and measured along with other lstm layers

fn crossover(
    child: &LSTM,
    parent_two: &LSTM,
    env: &Arc<RwLock<NeatEnvironment>>,
    crossover_rate: f32
) -> Option<LSTM>
[src]

implement how to crossover two LSTM layers

fn distance(one: &LSTM, two: &LSTM, env: &Arc<RwLock<NeatEnvironment>>) -> f32[src]

get the distance between two LSTM layers of the network

impl Genome<Neat, NeatEnvironment> for Neat[src]

iplement genome for a neat network

Loading content...