Class RankComparator
java.lang.Object
org.moeaframework.core.comparator.RankComparator
- All Implemented Interfaces:
Comparator<Solution>
,DominanceComparator
Compares solutions using their rank.
-
Constructor Summary
ConstructorDescriptionConstructs a dominance comparator for comparing solutions using their rank. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
RankComparator
public RankComparator()Constructs a dominance comparator for comparing solutions using their rank.
-
-
Method Details
-
compare
Description copied from interface:DominanceComparator
Compares the two solutions using a dominance relation, returning-1
ifsolution1
dominatessolution2
,1
ifsolution2
dominatessolution1
, and0
if the solutions are non-dominated.- Specified by:
compare
in interfaceComparator<Solution>
- Specified by:
compare
in interfaceDominanceComparator
- Parameters:
solution1
- the first solutionsolution2
- the second solution- Returns:
-1
ifsolution1
dominatessolution2
,1
ifsolution2
dominatessolution1
, and0
if the solutions are non-dominated
-