Package org.opt4j.optimizer.ea
Class Nsga2
java.lang.Object
org.opt4j.optimizer.ea.Nsga2
- All Implemented Interfaces:
Selector
- Direct Known Subclasses:
SelectorDefault
- See Also:
-
Nsga2Module- "A Fast Elitist Non-Dominated Sorting Genetic Algorithm for Multi-Objective Optimization: NSGA-II, K. Deb, Samir Agrawal, Amrit Pratap, and T. Meyarivan, Parallel MockProblem Solving from Nature, 2000"
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final FrontDensityIndicatorprotected final Randomprotected final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfronts(Collection<Individual> individuals) Evaluate the fronts and set the correspondent rank values.getLames(int n, Collection<Individual> population) getParents(int mu, Collection<Individual> population) Selects a subset ofIndividuals and returns it as a newCollection.protected Map<Individual,Integer> getRank(List<List<Individual>> fronts) Determine the ranks of fronts.voidinit(int maxsize) Sets the maximal number ofIndividuals.
-
Field Details
-
random
-
tournament
protected final int tournament -
indicator
-
-
Constructor Details
-
Nsga2
- Parameters:
random- the random number generatortournament- the tournament value
-
-
Method Details
-
init
public void init(int maxsize) Description copied from interface:SelectorSets the maximal number ofIndividuals. -
getParents
Description copied from interface:SelectorSelects a subset ofIndividuals and returns it as a newCollection. These so called parents can be used to form the next generation.- Specified by:
getParentsin interfaceSelector- Parameters:
mu- the number of parents to selectpopulation- the list of individuals- Returns:
- the parents
-
getLames
Description copied from interface:SelectorSelects a subset oflambdaIndividuals and returns it as a newCollection. These individuals can be erased in the next generation. -
getRank
Determine the ranks of fronts.- Parameters:
fronts- the fronts- Returns:
- the ranks
-
fronts
Evaluate the fronts and set the correspondent rank values.- Parameters:
individuals- the individuals- Returns:
- the fronts
-