Struct genetic_planner::genetic::Individual [] [src]

pub struct Individual<T: 'static> {
    pub genes: Vec<T>,
}

Rappresent a candidate solution for the problem

Fields

genes: Vec<T>

Methods

impl<T> Individual<T> where T: Clone + Rand + Send + Sync + PartialEq + 'static
[src]

fn new(genenumber: usize) -> Individual<T>

Create a new individual which contains a vector of genenumber of random initiliazed T

fn new_with_vec(v: Vec<T>) -> Individual<T>

Create a new individual from a vector of T

fn crossover(&self, i2: Individual<T>, uniform_rate: f32) -> Individual<T>

Return an Individual which is the result of the crossover operation between self and the second Individual, accordingly the uniform_rate parameter

fn mutate(&self, mutation_rate: f32) -> Individual<T>

Return an Individual which is the result of the mutate operation, accordingly the mutation_rate parameter

Trait Implementations

impl<T: PartialEq + 'static> PartialEq for Individual<T>
[src]

fn eq(&self, __arg_0: &Individual<T>) -> bool

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, __arg_0: &Individual<T>) -> bool

This method tests for !=.

impl<T: Clone + 'static> Clone for Individual<T>
[src]

fn clone(&self) -> Individual<T>

Returns a copy of the value. Read more

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

Performs copy-assignment from source. Read more

impl<T: Debug + 'static> Debug for Individual<T>
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.