Struct rsgenetic::sim::seq::Simulator [] [src]

pub struct Simulator<T: Phenotype> {
    // some fields omitted
}

A Simulator can run genetic algorithm simulations.

Methods

impl<T: Phenotype> Simulator<T>

fn new(starting_population: Vec<Box<T>>, max_iters: i32, selection_type: SelectionType, fitness_type: FitnessType) -> Simulator<T>

Create a new Simulator.

  • max_iters indicates the maximum number of iterations to run before stopping.

fn run(&mut self)

Run the simulation, according to the settings chosen in the constructor of the Simulator.

fn get(&self) -> Box<T>

Get the best performing organism.