Package io.jenetics.ext.moea
Class NSGA2Selector<G extends Gene<?,G>,C extends Comparable<? super C>>
- java.lang.Object
-
- io.jenetics.ext.moea.NSGA2Selector<G,C>
-
- All Implemented Interfaces:
Selector<G,C>
public class NSGA2Selector<G extends Gene<?,G>,C extends Comparable<? super C>> extends Object implements Selector<G,C>
This selector selects the firstcountelements of the population, which has been sorted by the Crowded-Comparison Operator, as described in A Fast and Elitist Multiobjective Genetic Algorithm: NSGA-IIReference: K. Deb, A. Pratap, S. Agarwal, and T. Meyarivan. 2002. A fast and elitist multiobjective genetic algorithm: NSGA-II. Trans. Evol. Comp 6, 2 (April 2002), 182-197. DOI= 10.1109/4235.996017
- Since:
- 4.1
- Version:
- 4.1
-
-
Constructor Summary
Constructors Constructor Description NSGA2Selector(Comparator<? super C> dominance, ElementComparator<? super C> comparator, ElementDistance<? super C> distance, ToIntFunction<? super C> dimension)Creates a newNSGA2Selectorwith the functions needed for handling the multi-objective result typeC.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <G extends Gene<?,G>,T,V extends Vec<T>>
NSGA2Selector<G,V>ofVec()Return a new selector for the given result typeV.ISeq<Phenotype<G,C>>select(Seq<Phenotype<G,C>> population, int count, Optimize opt)
-
-
-
Constructor Detail
-
NSGA2Selector
public NSGA2Selector(Comparator<? super C> dominance, ElementComparator<? super C> comparator, ElementDistance<? super C> distance, ToIntFunction<? super C> dimension)
Creates a newNSGA2Selectorwith the functions needed for handling the multi-objective result typeC. For theVecclasses, a selector is created like in the following example:new NSGA2Selector<>( Vec<T>::dominance, Vec<T>::compare, Vec<T>::distance, Vec<T>::length );- Parameters:
dominance- the pareto dominance comparatorcomparator- the vector element comparatordistance- the vector element distancedimension- the dimensionality of vector typeC- See Also:
ofVec()
-
-
Method Detail
-
select
public ISeq<Phenotype<G,C>> select(Seq<Phenotype<G,C>> population, int count, Optimize opt)
-
ofVec
public static <G extends Gene<?,G>,T,V extends Vec<T>> NSGA2Selector<G,V> ofVec()
Return a new selector for the given result typeV. This method is a shortcut fornew NSGA2Selector<>( Vec<T>::dominance, Vec<T>::compare, Vec<T>::distance, Vec<T>::length );- Type Parameters:
G- the gene typeT- the array type, e.g.double[]V- the multi object result type vector- Returns:
- a new selector for the given result type
V
-
-