Class EvolutionStrategyEngine<T>

  • Type Parameters:
    T - The type of entity that is to be evolved.
    All Implemented Interfaces:
    EvolutionEngine<T>

    public class EvolutionStrategyEngine<T>
    extends AbstractEvolutionEngine<T>

    General purpose engine for implementing Evolution Strategies. Both (μ+λ) and (μ,λ) strategies are supported (choose which to use by setting the boolean constructor parameter).

    Though this implementation accepts the eliteCount argument for each of its evolve methods in common with other EvolutionEngine implementations, it has no effect for evolution strategies. Elitism is implicit in a (μ+λ) ES and undesirable for a (μ,λ) ES.

    See Also:
    GenerationalEvolutionEngine, SteadyStateEvolutionEngine
    • Constructor Detail

      • EvolutionStrategyEngine

        public EvolutionStrategyEngine​(CandidateFactory<T> candidateFactory,
                                       EvolutionaryOperator<T> evolutionScheme,
                                       FitnessEvaluator<? super T> fitnessEvaluator,
                                       boolean plusSelection,
                                       int offspringMultiplier,
                                       Random rng)
        Creates a new engine for an evolution strategy.
        Parameters:
        candidateFactory - Factory used to create the initial population that is iteratively evolved.
        evolutionScheme - The combination of evolutionary operators used to evolve the population at each generation.
        fitnessEvaluator - A function for assigning fitness scores to candidate solutions.
        plusSelection - If true this object implements a (μ+λ) evolution strategy rather than (μ,λ). With plus-selection the parents are eligible for survival. With comma-selection only the offspring survive.
        offspringMultiplier - How many offspring to create for each member of the parent population. This parameter effectively defines a multiplier for μ that gives λ. We define λ in this indirect way because we don't know the value of μ until it is passed as an argument to one of the evolve methods. For a 1+1 ES this parameter would be set to one. For other evolution strategies a higher value might be better. Eiben & Smith suggest 7 as a good value.
        rng - The source of randomness used by all stochastic processes (including evolutionary operators and selection strategies).
    • Method Detail

      • nextEvolutionStep

        protected List<EvaluatedCandidate<T>> nextEvolutionStep​(List<EvaluatedCandidate<T>> evaluatedPopulation,
                                                                int eliteCount,
                                                                Random rng)
        This method performs a single step/iteration of the evolutionary process.
        Specified by:
        nextEvolutionStep in class AbstractEvolutionEngine<T>
        Parameters:
        evaluatedPopulation - The population at the beginning of the process.
        eliteCount - Ignored by evolution strategies. Elitism is implicit in a (μ+λ) ES and undesirable for a (μ,λ) ES.
        rng - A source of randomness.
        Returns:
        The updated population after the evolution strategy has advanced.