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 invalid input: '<'antonio@lcc.uma.es>
See Also:
  • Constructor Details

    • FitnessComparator

      public FitnessComparator()
  • Method Details

    • compare

      public int compare(S solution1, S solution2)
      Compares two solutions.
      Specified by:
      compare in interface Comparator<S extends Solution<?>>
      Parameters:
      solution1 - Object representing the first Solution.
      solution2 - Object representing the second Solution.
      Returns:
      -1, or 0, or 1 if o1 is less than, equal, or greater than o2, respectively.