Struct darwin_rs::simulation_builder::SimulationBuilder [] [src]

pub struct SimulationBuilder<T: Individual + Send + Sync> { /* fields omitted */ }

This is a helper struct in order to build (configure) a valid simulation. See builder pattern: https://en.wikipedia.org/wiki/Builder_pattern

Maybe use phantom types, see https://github.com/willi-kappler/darwin-rs/issues/9

Methods

impl<T: Individual + Send + Sync> SimulationBuilder<T>
[src]

This implementation contains all the helper method to build (configure) a valid simulation.

Start with this method, it must always be called as the first one. It creates a default simulation with some dummy (but invalid) values.

Set the total number of iterations for the simulation and thus sets the simulation type to EndIteration. (Only usefull in combination with EndIteration).

Set the improvement factor stop criteria for the simulation and thus sets the simulation type to EndFactor. (Only usefull in combination with EndFactor).

Set the minimum fitness stop criteria for the simulation and thus sets the simulation type to EndFitness. (Only usefull in combination with EndFactor).

Sets the number of threads in order to speed up the simulation.

Add a population to the simulation.

Add multiple populations to the simulation.

If this option is enabled (default: off), then the fittest individual of all populations is shared between all populations.

This checks the configuration of the simulation and returns an error or Ok if no errors where found.