Package org.opt4j.optimizer.ea
Interface Selector
- All Known Implementing Classes:
AlternativeNsga2
,ElitismSelector
,Nsga2
,ScalingNsga2
,SelectorDefault
,Spea2
public interface Selector
The interface
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.-
Method Summary
Modifier and TypeMethodDescriptiongetLames
(int lambda, Collection<Individual> population) getParents
(int mu, Collection<Individual> population) Selects a subset ofIndividual
s and returns it as a newCollection
.void
init
(int maxsize) Sets the maximal number ofIndividual
s.
-
Method Details
-
getParents
Selects a subset ofIndividual
s and returns it as a newCollection
. These so called parents can be used to form the next generation.- Parameters:
mu
- the number of parents to selectpopulation
- the list of individuals- Returns:
- the parents
-
getLames
Selects a subset oflambda
Individual
s and returns it as a newCollection
. These individuals can be erased in the next generation.- Parameters:
lambda
- the number of lames to selectpopulation
- the list of individuals- Returns:
- the worst
lambda
individuals
-
init
void init(int maxsize) Sets the maximal number ofIndividual
s.- Parameters:
maxsize
- the number of individuals
-