Interface SelectionOperator

All Superinterfaces:
Splittable<SelectionOperator>
All Known Implementing Classes:
BiasedFitnessProportionalSelection, BiasedShiftedFitnessProportionalSelection, BiasedShiftedStochasticUniversalSampling, BiasedStochasticUniversalSampling, ExponentialRankSelection, ExponentialRankStochasticUniversalSampling, FitnessProportionalSelection, FitnessShifter, LinearRankSelection, LinearRankStochasticUniversalSampling, RandomSelection, ShiftedFitnessProportionalSelection, ShiftedStochasticUniversalSampling, SigmaScaling, StochasticUniversalSampling, TournamentSelection, TruncationSelection

public interface SelectionOperator extends Splittable<SelectionOperator>
Implement this interface to provide a selection operator for use by genetic algorithms and other forms of evolutionary computation.
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    init(int generations)
    Perform any initialization necessary for the selection operator at the start of the run of the evolutionary algorithm.
    void
    select(PopulationFitnessVector.Double fitnesses, int[] selected)
    Selects a set of members of the population based on fitness.
    void
    select(PopulationFitnessVector.Integer fitnesses, int[] selected)
    Selects a set of members of the population based on fitness.

    Methods inherited from interface org.cicirello.search.concurrent.Splittable

    split
  • Method Details

    • select

      void select(PopulationFitnessVector.Integer fitnesses, int[] selected)
      Selects a set of members of the population based on fitness. Implementations should ensure that the array of indexes of population members is in a random order. For some selection operators, this required behavior is met by definition (e.g., the common fitness proportionate selection will have this behavior as is). But other selection operators may require randomizing the array of indexes after selection. For example, the obvious implementation of stochastic universal sampling will likely have all copies of an individual population member ordered together, and thus will require a shuffling of the array before returning.
      Parameters:
      fitnesses - A vector of fitnesses of the members of the population.
      selected - An array for the result. The selection operator should select selected.length members of the population based on fitnesses, populating selected with the indexes of the chosen members. Note that selected.length may be different than the fitnesses.size().
    • select

      void select(PopulationFitnessVector.Double fitnesses, int[] selected)
      Selects a set of members of the population based on fitness. Implementations should ensure that the array of indexes of population members is in a random order. For some selection operators, this required behavior is met by definition (e.g., the common fitness proportionate selection will have this behavior as is). But other selection operators may require randomizing the array of indexes after selection. For example, the obvious implementation of stochastic universal sampling will likely have all copies of an individual population member ordered together, and thus will require a shuffling of the array before returning.
      Parameters:
      fitnesses - A vector of fitnesses of the members of the population.
      selected - An array for the result. The selection operator should select selected.length members of the population based on fitnesses, populating selected with the indexes of the chosen members. Note that selected.length may be different than the fitnesses.size().
    • init

      default void init(int generations)
      Perform any initialization necessary for the selection operator at the start of the run of the evolutionary algorithm. This method is called by the evolutionary algorithm at the start of a run (i.e., whenever an EA's optimize or reoptimize methods are called. The default implementation of this method does nothing, which is appropriate for most selection operators since the behavior of most standard selection operators is doesn't change during runs. However, some selection operators may adjust behavior during the run, such as Boltzmann selection which adjusts a temperature parameter. The init method enables reinitializing such parameters at the start of runs.
      Parameters:
      generations - The number of generations for the run of the evolutionary algorithm about to commence.