Struct calco::Universe
[−]
[src]
pub struct Universe<T: Clone + Mutable + Reproducible + Evaluable> { /* fields omitted */ }
Methods
impl<T: Clone + Mutable + Reproducible + Evaluable> Universe<T>
[src]
fn from_pop(config: Config, pop: Vec<T>) -> Universe<T>
create new populate universe
fn evaluate(&mut self)
call the evaluate method of each individual of the population
fn mutate(&mut self)
for each individual in the population, check if it will mutate. then it call mutate on each.
fn reproduce(&mut self)
will choose two individuals in the population and call the reproduce method of the first with the second in parameter. Put the new childrens in a new population (don't evaluate them). It will keep the first half of the precedent population by fitness-proportinal-popping or minus if the new population exceed population_max value.