Class EqualSolutionsComparator<S extends Solution<?>>

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

public class EqualSolutionsComparator<S extends Solution<?>> extends Object implements Comparator<S>, Serializable
This class implements a Comparator (a method for comparing Solution objects) based whether all the objective values are equal or not. A dominance test is applied to decide about what solution is the best.
Author:
Antonio J. Nebro <antonio@lcc.uma.es>
See Also:
  • Constructor Details

    • EqualSolutionsComparator

      public EqualSolutionsComparator()
  • Method Details

    • compare

      public int compare(S solution1, S solution2)
      Compares two solutions.
      Specified by:
      compare in interface Comparator<S extends Solution<?>>
      Parameters:
      solution1 - First Solution.
      solution2 - Second Solution.
      Returns:
      -1, or 0, or 1, or 2 if solution1 is dominates solution2, solution1 and solution2 are equals, or solution1 is greater than solution2, respectively.