[][src]Struct ai_graph::Gene

pub struct Gene { /* fields omitted */ }

Gene stores the "graph". Different graphs will form different output.

Methods

impl Gene[src]

pub fn breed(first_gene: &Self, second_gene: &Self) -> Self[src]

This function merges two genes together to find an avarage genes. Lines and Nodes that can't be merged to an avarage are randomly selected.

impl Gene[src]

pub fn mutate(&self, mutation_type: &Type, mutation_level: i8) -> Self[src]

impl Gene[src]

pub fn new_gene() -> Self[src]

pub fn new_random_gene() -> Self[src]

pub fn new_random_basic_gene(depth: u8, hight: u8) -> Self[src]

impl Gene[src]

pub fn output(self, input: &[i32]) -> Vec<f64>[src]

This function calculats an output using a set of inputs and a gene. If this function takes hard coded values it can be heavily optimised.

impl Gene[src]

pub fn validate(&self) -> bool[src]

pub fn validate_two(first_gene: &Self, second_gene: &Self) -> bool[src]

Trait Implementations

impl Clone for Gene[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Gene[src]

Auto Trait Implementations

impl Send for Gene

impl Sync for Gene

Blanket Implementations

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

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

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

The type returned in the event of a conversion error.