pub trait Gene {
// Required methods
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>;
}Expand description
Trait required for a genome to be used by neat
Required Methods§
Sourcefn empty(inputs: usize, outputs: usize) -> Self
fn empty(inputs: usize, outputs: usize) -> Self
returns an empty genome with only input and output nodes and no connections
Sourcefn is_same_species_as(&self, other: &Self) -> bool
fn is_same_species_as(&self, other: &Self) -> bool
checks if the other genome is same species as self
Sourcefn mutate<T: GlobalNeatCounter>(&mut self, neat: &mut T)
fn mutate<T: GlobalNeatCounter>(&mut self, neat: &mut T)
method for mutation of the genome
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.