Class ElitisticListPopulation

java.lang.Object
org.apache.commons.math3.genetics.ListPopulation
org.apache.commons.math3.genetics.ElitisticListPopulation
All Implemented Interfaces:
Iterable<Chromosome>, Population

public class ElitisticListPopulation extends ListPopulation
Population of chromosomes which uses elitism (certain percentage of the best chromosomes is directly copied to the next generation).
Since:
2.0
  • Constructor Details

  • Method Details

    • nextGeneration

      public Population nextGeneration()
      Start the population for the next generation. The elitismRate percents of the best chromosomes are directly copied to the next generation.
      Returns:
      the beginnings of the next generation.
    • setElitismRate

      public void setElitismRate(double elitismRate) throws OutOfRangeException
      Sets the elitism rate, i.e. how many best chromosomes will be directly transferred to the next generation [in %].
      Parameters:
      elitismRate - how many best chromosomes will be directly transferred to the next generation [in %]
      Throws:
      OutOfRangeException - if the elitism rate is outside the [0, 1] range
    • getElitismRate

      public double getElitismRate()
      Access the elitism rate.
      Returns:
      the elitism rate