public interface Selector
Selector is used to select a certain subset of
Individuals from a Population by respecting certain metrics
like their fitness. The core methods are getParents(int, java.util.Collection<org.opt4j.core.Individual>), that returns a
set of Individuals that can be used as parents for the next
generation and getLames(int, java.util.Collection<org.opt4j.core.Individual>), that returns a list of Individuals
that can be removed from the given individual list in order to form the next
generation.| Modifier and Type | Method and Description |
|---|---|
Collection<Individual> |
getLames(int lambda,
Collection<Individual> population)
|
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. |
Collection<Individual> getParents(int mu, Collection<Individual> population)
Individuals and returns it as a new
Collection. These so called parents can be used to form the next
generation.mu - the number of parents to selectpopulation - the list of individualsCollection<Individual> getLames(int lambda, Collection<Individual> population)
lambda Individuals and returns it as
a new Collection. These individuals can be erased in the next
generation.lambda - the number of lames to selectpopulation - the list of individualslambda individualsvoid init(int maxsize)
Individuals.maxsize - the number of individuals