public class ElitisticListPopulation extends ListPopulation
Constructor and Description |
---|
ElitisticListPopulation(int populationLimit,
double elitismRateIn)
Creates a new
ElitisticListPopulation instance and initializes its inner chromosome list. |
ElitisticListPopulation(List<Chromosome> chromosomes,
int populationLimit,
double elitismRateIn)
Creates a new
ElitisticListPopulation instance. |
Modifier and Type | Method and Description |
---|---|
double |
getElitismRate()
Access the elitism rate.
|
Population |
nextGeneration()
Start the population for the next generation.
|
void |
setElitismRate(double elitismRateIn)
Sets the elitism rate, i.e.
|
addChromosome, addChromosomes, getChromosomeList, getChromosomes, getFittestChromosome, getPopulationLimit, getPopulationSize, iterator, setPopulationLimit, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public ElitisticListPopulation(List<Chromosome> chromosomes, int populationLimit, double elitismRateIn)
ElitisticListPopulation
instance.chromosomes
- list of chromosomes in the populationpopulationLimit
- maximal size of the populationelitismRateIn
- how many best chromosomes will be directly transferred to the next generation [in %]NullArgumentException
- if the list of chromosomes is null
NotPositiveException
- if the population limit is not a positive number (< 1)NumberIsTooLargeException
- if the list of chromosomes exceeds the population limitOutOfRangeException
- if the elitism rate is outside the [0, 1] rangepublic ElitisticListPopulation(int populationLimit, double elitismRateIn)
ElitisticListPopulation
instance and initializes its inner chromosome list.populationLimit
- maximal size of the populationelitismRateIn
- how many best chromosomes will be directly transferred to the next generation [in %]NotPositiveException
- if the population limit is not a positive number (< 1)OutOfRangeException
- if the elitism rate is outside the [0, 1] rangepublic Population nextGeneration()
elitismRate
percents of the best
chromosomes are directly copied to the next generation.public void setElitismRate(double elitismRateIn)
elitismRateIn
- how many best chromosomes will be directly transferred to the next generation [in %]OutOfRangeException
- if the elitism rate is outside the [0, 1] rangepublic double getElitismRate()
Copyright © 2018 CNES. All Rights Reserved.