Package org.uma.jmetal.util.comparator
Class DoubleVariableComparator
java.lang.Object
org.uma.jmetal.util.comparator.DoubleVariableComparator
- All Implemented Interfaces:
Comparator<DoubleSolution>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcompare(DoubleSolution solution1, DoubleSolution solution2) Compares two double solutions according to a variable valueMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
DoubleVariableComparator
public DoubleVariableComparator() -
DoubleVariableComparator
public DoubleVariableComparator(int variableIndex)
-
-
Method Details
-
compare
Compares two double solutions according to a variable value- Specified by:
comparein interfaceComparator<DoubleSolution>- Parameters:
solution1- Object representing the firstSolution.solution2- Object representing the secondSolution.- Returns:
- -1, or 0, or 1 if o1 is less than, equal, or greater than o2, respectively.
-