com.lagodiuk.ga
Class Population<C extends Chromosome<C>>
- java.lang.Object
-
- com.lagodiuk.ga.Population<C>
-
- All Implemented Interfaces:
- java.lang.Iterable<C>
public class Population<C extends Chromosome<C>> extends java.lang.Object implements java.lang.Iterable<C>
-
-
Constructor Summary
Constructors Constructor and Description Population()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddChromosome(C chromosome)CgetChromosomeByIndex(int indx)CgetRandomChromosome()intgetSize()java.util.Iterator<C>iterator()voidsortPopulationByFitness(java.util.Comparator<C> chromosomesComparator)voidtrim(int len)shortening population till specific number
-
-
-
Method Detail
-
addChromosome
public void addChromosome(C chromosome)
-
getSize
public int getSize()
-
getRandomChromosome
public C getRandomChromosome()
-
getChromosomeByIndex
public C getChromosomeByIndex(int indx)
-
sortPopulationByFitness
public void sortPopulationByFitness(java.util.Comparator<C> chromosomesComparator)
-
trim
public void trim(int len)
shortening population till specific number
-
iterator
public java.util.Iterator<C> iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable<C extends Chromosome<C>>
-
-
DMelt 3.0 © DataMelt by jWork.ORG