public class Population<T extends AbstractMutant>
extends java.lang.Object
This class holds a set of AbstractMutant
s
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 AbstractMutant
clazz
- type of the Population
to be created [must extend AbstractMutant
]clazz
public Population<T> copy()
Population
public java.util.List<T> getMutants()
Population
's AbstractMutant
spublic void addMutants(java.util.List<T> mutants)
mutants
- to be added to the Population
public void setMutants(java.util.List<T> mutants)
mutants
- to be set for the Population
public void addMutant(T mutant)
mutant
- to be added to the Population
public void removeMutant(T mutant)
mutant
- to be removed from the Population
public void removeMutants(java.util.List<T> mutants)
mutants
- to be removed from the Population
public java.util.List<T> getSubtleMutants()
Population
's AbstractMutant
s, based on AbstractMutant.isSubtle()
HigherOrderMutant.isSubtle()
public java.util.List<T> getLiveMutants()
Population
's AbstractMutant
s, based on AbstractMutant.isLive()
public void removeNonCompilableMutants()