Struct moonlander_gp::Population [] [src]

pub struct Population<P: Clone + Sync, F: Fitness + Sized + Send> {
    pub population: Vec<P>,
    pub generation: u32,
    pub scores: Vec<F>,
}

Collection of programs

The root of each program is of type P, and fitness structures will be represented by type F.

Fields

Collection of algorithms

Generation index of this population

Collection of fitness scores

Methods

impl<P: Clone + Sync, F: Fitness + Sized + Send> Population<P, F>
[src]

Create a new population with an estimated size.

This does not create programs yet but simply allocates memory.

Add a single program to the population.

Apply a scoring function to the entire population.

Return the best program from the population.

Return the best N programs from the population.