Struct genetic_planner::genetic::Population
[−]
[src]
pub struct Population<T: 'static> { pub individuals_and_scores: Vec<(Individual<T>, i32)>, pub configuration: PopulationConfiguration<T>, pub generation: usize, }
A set of Individuals
Fields
individuals_and_scores: Vec<(Individual<T>, i32)>
Contains set of Individual and the relative score
configuration: PopulationConfiguration<T>
Contains the configurations used to create the Population
generation: usize
Rappresent the generation of the Population
Methods
impl<T> Population<T> where T: Clone + Rand + Send + Sync + PartialEq + 'static
[src]
fn new_with_vec(vec: Vec<(Individual<T>, i32)>, configuration: PopulationConfiguration<T>, generation: usize) -> Population<T>
Create a new Population from a vector of individuals, a configuration and the number of the generation
fn new(configuration: PopulationConfiguration<T>) -> Population<T>
Create a new random generation accordingly the configuration
fn get_fittest(&self) -> Option<(Individual<T>, i32)>
Get the Individual and the relative score of the Individual with the highest score
fn evolve(&self) -> Population<T>
Create a new Population from the current, using the crossover and mutation operator
Trait Implementations
impl<T: Clone + 'static> Clone for Population<T>
[src]
fn clone(&self) -> Population<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