public interface Selector
Selector
is used to select a certain subset of
Individual
s 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 Individual
s 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 Individual
s
that can be removed from the given individual list in order to form the next
generation.Modifier and Type | Method and Description |
---|---|
java.util.Collection<org.opt4j.core.Individual> |
getLames(int lambda,
java.util.Collection<org.opt4j.core.Individual> population)
Selects a subset of
lambda Individual s and returns it as
a new Collection . |
java.util.Collection<org.opt4j.core.Individual> |
getParents(int mu,
java.util.Collection<org.opt4j.core.Individual> population)
Selects a subset of
Individual s and returns it as a new
Collection . |
void |
init(int maxsize)
Sets the maximal number of
Individual s. |
java.util.Collection<org.opt4j.core.Individual> getParents(int mu, java.util.Collection<org.opt4j.core.Individual> population)
Individual
s 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 individualsjava.util.Collection<org.opt4j.core.Individual> getLames(int lambda, java.util.Collection<org.opt4j.core.Individual> population)
lambda
Individual
s 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)
Individual
s.maxsize
- the number of individuals