jmetal.util.comparators
Class EqualSolutions

java.lang.Object
  extended by jmetal.util.comparators.EqualSolutions
All Implemented Interfaces:
java.util.Comparator

public class EqualSolutions
extends java.lang.Object
implements java.util.Comparator

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.


Constructor Summary
EqualSolutions()
           
 
Method Summary
 int compare(java.lang.Object object1, java.lang.Object object2)
          Compares two solutions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

EqualSolutions

public EqualSolutions()
Method Detail

compare

public int compare(java.lang.Object object1,
                   java.lang.Object object2)
Compares two solutions.

Specified by:
compare in interface java.util.Comparator
Parameters:
solution1 - Object representing the first Solution.
solution2 - Object representing the 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.