|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.math3.genetics.ListPopulation
public abstract class ListPopulation
Population of chromosomes represented by a List
.
Field Summary | |
---|---|
private List<Chromosome> |
chromosomes
List of chromosomes |
private int |
populationLimit
maximal size of the population |
Constructor Summary | |
---|---|
ListPopulation(int populationLimit)
Creates a new ListPopulation instance and initializes its inner chromosome list. |
|
ListPopulation(List<Chromosome> chromosomes,
int populationLimit)
Creates a new ListPopulation instance. |
Method Summary | |
---|---|
void |
addChromosome(Chromosome chromosome)
Add the given chromosome to the population. |
List<Chromosome> |
getChromosomes()
Access the list of chromosomes. |
Chromosome |
getFittestChromosome()
Access the fittest chromosome in this population. |
int |
getPopulationLimit()
Access the maximum population size. |
int |
getPopulationSize()
Access the current population size. |
Iterator<Chromosome> |
iterator()
Chromosome list iterator |
void |
setChromosomes(List<Chromosome> chromosomes)
Sets the list of chromosomes. |
void |
setPopulationLimit(int populationLimit)
Sets the maximal population size. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.apache.commons.math3.genetics.Population |
---|
nextGeneration |
Field Detail |
---|
private List<Chromosome> chromosomes
private int populationLimit
Constructor Detail |
---|
public ListPopulation(List<Chromosome> chromosomes, int populationLimit)
chromosomes
- list of chromosomes in the populationpopulationLimit
- maximal size of the population
NumberIsTooLargeException
- if the list of chromosomes exceeds the population limit
NotPositiveException
- if the population limit is not a positive number (< 1)public ListPopulation(int populationLimit)
populationLimit
- maximal size of the population
NotPositiveException
- if the population limit is not a positive number (< 1)Method Detail |
---|
public void setChromosomes(List<Chromosome> chromosomes)
chromosomes
- the list of chromosomespublic List<Chromosome> getChromosomes()
public void addChromosome(Chromosome chromosome)
addChromosome
in interface Population
chromosome
- the chromosome to add.public Chromosome getFittestChromosome()
getFittestChromosome
in interface Population
public int getPopulationLimit()
getPopulationLimit
in interface Population
public void setPopulationLimit(int populationLimit)
populationLimit
- maximal population size.public int getPopulationSize()
getPopulationSize
in interface Population
public String toString()
toString
in class Object
public Iterator<Chromosome> iterator()
iterator
in interface Iterable<Chromosome>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |