Class RankingAndSSDComparator<S extends Solution<?>>

java.lang.Object
org.uma.jmetal.util.comparator.RankingAndSSDComparator<S>
All Implemented Interfaces:
Serializable, Comparator<S>

public class RankingAndSSDComparator<S extends Solution<?>> extends Object implements Comparator<S>, Serializable
Version:
1.0 This class implements a comparator based on the rank of the solutions; if the rank is the same then the crowding distance is used.
Author:
Alejandro Santiago <aurelio.santiago@upalt.edu.mx>
See Also:
  • Constructor Details

    • RankingAndSSDComparator

      public RankingAndSSDComparator()
      Constructor
    • RankingAndSSDComparator

      public RankingAndSSDComparator(Ranking<S> ranking)
  • 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 solution1 is less than, equal, or greater than solution2, respectively.