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

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

A Builder for the Simulator type.

Methods

impl<T: Phenotype> SimulatorBuilder<T>
[src]

fn set_population(self, pop: &Vec<T>) -> Self

Set the population of the resulting Simulator.

Returns itself for chaining purposes.

fn set_selector(self, sel: Box<Selector<T>>) -> Self

Set the selector of the resulting Simulator.

Returns itself for chaining purposes.

fn set_max_iters(self, i: u64) -> Self

Set the maximum number of iterations of the resulting Simulator.

The Simulator will stop running after this number of iterations.

Returns itself for chaining purposes.

fn set_fitness_type(self, t: FitnessType) -> Self

Set the fitness type of the resulting Simulator, determining whether the Simulator will try to maximize or minimize the fitness values of Phenotypes.

Returns itself for chaining purposes.

fn set_early_stop(self, delta: f64, n_iters: u64) -> Self

Set early stopping. If for n_iters iterations, the change in the highest fitness is smaller than delta, the simulator will stop running.

Returns itself for chaining purposes.

Trait Implementations

impl<T: Phenotype> Builder<Simulator<T>> for SimulatorBuilder<T>
[src]

fn build(self) -> Simulator<T>

Return the result.