Package org.opt4j.optimizer.ea
Interface Selector
-
- All Known Implementing Classes:
AlternativeNsga2,ElitismSelector,Nsga2,ScalingNsga2,SelectorDefault,Spea2
public interface SelectorThe interfaceSelectoris used to select a certain subset ofIndividuals from aPopulationby respecting certain metrics like their fitness. The core methods aregetParents(int, java.util.Collection<org.opt4j.core.Individual>), that returns a set ofIndividuals that can be used as parents for the next generation andgetLames(int, java.util.Collection<org.opt4j.core.Individual>), that returns a list ofIndividuals that can be removed from the given individual list in order to form the next generation.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Collection<Individual>getLames(int lambda, Collection<Individual> population)Collection<Individual>getParents(int mu, Collection<Individual> population)Selects a subset ofIndividuals and returns it as a newCollection.voidinit(int maxsize)Sets the maximal number ofIndividuals.
-
-
-
Method Detail
-
getParents
Collection<Individual> getParents(int mu, Collection<Individual> population)
Selects a subset ofIndividuals 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
Collection<Individual> getLames(int lambda, Collection<Individual> population)
Selects a subset oflambdaIndividuals 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
lambdaindividuals
-
init
void init(int maxsize)
Sets the maximal number ofIndividuals.- Parameters:
maxsize- the number of individuals
-
-