public class Spea2 extends Object implements Selector
The Spea2-Selector is a Java implementation of the SPEA2-MOEA.
The Spea2-Selector will not work properly if the Objectives
are not fixed, i.e., the Objectives of an Individual change
during the optimization process. This caused by the internal caching of
distances, etc. In this case, it is recommended to use the Nsga2.
| Modifier and Type | Method and Description |
|---|---|
Collection<Individual> |
getLames(int lambda,
Collection<Individual> population)
|
Collection<Individual> |
getLamesFromNonDominated(int count)
Returns a specific number of lames from the non-dominated
Individuals. |
Collection<Individual> |
getParents(int mu,
Collection<Individual> population)
Selects a subset of
Individuals and returns it as a new
Collection. |
void |
init(int maxsize)
Sets the maximal number of
Individuals. |
@Inject
public Spea2(int tournament,
Rand random)
tournament - the number of individuals that fight against each other to
become a parentrandom - the random number generatorpublic void init(int maxsize)
SelectorIndividuals.public Collection<Individual> getParents(int mu, Collection<Individual> population)
SelectorIndividuals and returns it as a new
Collection. These so called parents can be used to form the next
generation.getParents in interface Selectormu - the number of parents to selectpopulation - the list of individualspublic Collection<Individual> getLames(int lambda, Collection<Individual> population)
Selectorlambda Individuals and returns it as
a new Collection. These individuals can be erased in the next
generation.public Collection<Individual> getLamesFromNonDominated(int count)
Individuals.count - the specified number