|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.math3.genetics.ListPopulation
org.apache.commons.math3.genetics.ElitisticListPopulation
public class ElitisticListPopulation
Population of chromosomes which uses elitism (certain percentace of the best chromosomes is directly copied to the next generation).
Field Summary | |
---|---|
private double |
elitismRate
percentage of chromosomes copied to the next generation |
Constructor Summary | |
---|---|
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 | |
---|---|
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 |
Field Detail |
---|
private double elitismRate
Constructor Detail |
---|
public ElitisticListPopulation(List<Chromosome> chromosomes, int populationLimit, double elitismRate)
chromosomes
- list of chromosomes in the populationpopulationLimit
- maximal size of the populationelitismRate
- how many best chromosomes will be directly transferred to the
next generation [in %]public ElitisticListPopulation(int populationLimit, double elitismRate)
populationLimit
- maximal size of the populationelitismRate
- how many best chromosomes will be directly transferred to the
next generation [in %]Method Detail |
---|
public Population nextGeneration()
elitismRate
percents of the best chromosomes are directly copied to the next generation.
- Returns:
- the beginnings of the next generation.
public void setElitismRate(double elitismRate)
elitismRate
- 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()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |