public class Population<T extends AbstractMutant>
extends java.lang.Object
This class holds a set of AbstractMutants
It is used to represent a set of chromosomes of the GeneticAlgorithm
| Constructor and Description |
|---|
Population() |
| Modifier and Type | Method and Description |
|---|---|
void |
addMutant(T mutant) |
void |
addMutants(java.util.List<T> mutants) |
Population<T> |
copy() |
java.util.List<T> |
getLiveMutants() |
java.util.List<T> |
getMutants() |
java.util.List<T> |
getSubtleMutants() |
static <T extends AbstractMutant> |
newPopulation(java.lang.Class<T> clazz) |
void |
removeMutant(T mutant) |
void |
removeMutants(java.util.List<T> mutants) |
void |
removeNonCompilableMutants()
omits all non compilable mutants from the population
|
void |
setMutants(java.util.List<T> mutants) |
public static <T extends AbstractMutant> Population<T> newPopulation(java.lang.Class<T> clazz)
T - instance of AbstractMutantclazz - type of the Population to be created [must extend AbstractMutant]clazzpublic Population<T> copy()
Populationpublic java.util.List<T> getMutants()
Population's AbstractMutantspublic void addMutants(java.util.List<T> mutants)
mutants - to be added to the Populationpublic void setMutants(java.util.List<T> mutants)
mutants - to be set for the Populationpublic void addMutant(T mutant)
mutant - to be added to the Populationpublic void removeMutant(T mutant)
mutant - to be removed from the Populationpublic void removeMutants(java.util.List<T> mutants)
mutants - to be removed from the Populationpublic java.util.List<T> getSubtleMutants()
Population's AbstractMutants, based on AbstractMutant.isSubtle()HigherOrderMutant.isSubtle()public java.util.List<T> getLiveMutants()
Population's AbstractMutants, based on AbstractMutant.isLive()public void removeNonCompilableMutants()