Interface PopulationCandidates<T>

Type Parameters:
T - the representation of population members
All Superinterfaces:
PopulationFitnessVector
All Known Subinterfaces:
PopulationCandidates.DoubleFitness<T>, PopulationCandidates.IntegerFitness<T>

public interface PopulationCandidates<T> extends PopulationFitnessVector
An interface to candidates for the next generation's population, which can be the current members of the population or the children derived from it, depending upon the context. This interface is used as a parameter to the ReplacementStrategy interface.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    An interface to the candidates for the next generation's population, which can be the current members of the population or the children derived from it, depending upon the context.
    static interface 
    An interface to the candidates for the next generation's population, which can be the current members of the population or the children derived from it, depending upon the context.
  • Method Summary

    Modifier and Type
    Method
    Description
    candidate(int i)
    Accesses the i-th candidate.

    Methods inherited from interface PopulationFitnessVector

    fitnessAsDouble, size
  • Method Details

    • candidate

      T candidate(int i)
      Accesses the i-th candidate. Implementations of ReplacementStrategy must not mutate the state of the candidate here. By the time they get to this point, the candidates have already been crossed, mutated, etc as necessary, and fitness has already been computed. If you change the state of a candidate here, the behavior of the evolutionary algorithm may be unexpected. Deliberately not returning an independent copy since some representations may be large and complex.
      Parameters:
      i - the index of the candidate, which begins at 0
      Returns:
      the i-th candidate
      Throws:
      IndexOutOfBoundsException - if i is negative or if i is greater than or equal to size()