org.apache.commons.math3.genetics

## 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 percentace of the best chromosomes is directly copied to the next generation).
  Since:
    2.0
  Version:
    $Id: ElitisticListPopulation.java 1244107 2012-02-14 16:17:55Z erans $

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ElitisticListPopulation(int populationLimit, double elitismRate)` Creates a new ListPopulation instance and initializes its inner chromosome list.
    `ElitisticListPopulation(List<Chromosome> chromosomes, int populationLimit, double elitismRate)` Creates a new ElitisticListPopulation instance.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `double` | `getElitismRate()` Access the elitism rate.
    `Population` | `nextGeneration()` Start the population for the next generation.
    `void` | `setElitismRate(double elitismRate)` Sets the elitism rate, i.e.

    - ### Methods inherited from class org.apache.commons.math3.genetics.ListPopulation

      `addChromosome, getChromosomes, getFittestChromosome, getPopulationLimit, getPopulationSize, iterator, setChromosomes, setPopulationLimit, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### ElitisticListPopulation

          public ElitisticListPopulation(List<Chromosome> chromosomes,
                                 int populationLimit,
                                 double elitismRate)

      Creates a new ElitisticListPopulation instance.
      Parameters:
        `chromosomes` - list of chromosomes in the population
        `populationLimit` - maximal size of the population
        `elitismRate` - how many best chromosomes will be directly transferred to the next generation [in %]

    - #### ElitisticListPopulation

          public ElitisticListPopulation(int populationLimit,
                                 double elitismRate)

      Creates a new ListPopulation instance and initializes its inner chromosome list.
      Parameters:
        `populationLimit` - maximal size of the population
        `elitismRate` - how many best chromosomes will be directly transferred to the next generation [in %]

  - ### Method Detail

    - #### 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)

      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

Copyright © 2003-2012 The Apache Software Foundation. All Rights Reserved.