[][src]Trait neat_rs::Gene

pub trait Gene {
    fn empty(inputs: usize, outputs: usize) -> Self;
fn is_same_species_as(&self, other: &Self) -> bool;
fn cross(&self, other: &Self) -> Self;
fn mutate<T: GlobalNeatCounter>(&mut self, neat: &mut T);
fn predict(&self, input: &[f64], activate: fn(_: f64) -> f64) -> Vec<f64>; }

Trait required for a genome to be used by neat

Required methods

fn empty(inputs: usize, outputs: usize) -> Self

returns an empty genome with only input and output nodes and no connections

fn is_same_species_as(&self, other: &Self) -> bool

checks if the other genome is same species as self

fn cross(&self, other: &Self) -> Self

method for cross over of two genomes

fn mutate<T: GlobalNeatCounter>(&mut self, neat: &mut T)

method for mutation of the genome

fn predict(&self, input: &[f64], activate: fn(_: f64) -> f64) -> Vec<f64>

constructs the neural network and returns the output as a vec of floats

Loading content...

Implementors

impl Gene for Genotype[src]

Loading content...