Package org.uma.jmetal.util.comparator
Class FitnessComparator<S extends Solution<?>>
java.lang.Object
org.uma.jmetal.util.comparator.FitnessComparator<S>
- All Implemented Interfaces:
Serializable,Comparator<S>
public class FitnessComparator<S extends Solution<?>>
extends Object
implements Comparator<S>, Serializable
This class implements a
Comparator (a method for comparing
Solution objects) based on the fitness value returned by the
method getFitness.- Author:
- Antonio J. Nebro
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Methods 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
-
FitnessComparator
public FitnessComparator()
-
-
Method Details
-
compare
Compares two solutions.- Specified by:
comparein interfaceComparator<S extends Solution<?>>- 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.
-