jmetal.util.comparators
Class SolutionComparator

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

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

This class implements a Comparator (a method for comparing Solution objects) based on the values of the variables.


Constructor Summary
SolutionComparator()
           
 
Method Summary
 int compare(java.lang.Object o1, java.lang.Object o2)
          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

SolutionComparator

public SolutionComparator()
Method Detail

compare

public int compare(java.lang.Object o1,
                   java.lang.Object o2)
Compares two solutions.

Specified by:
compare in interface java.util.Comparator
Parameters:
o1 - Object representing the first Solution.
o2 - Object representing the second Solution.
Returns:
0, if both solutions are equals with a certain dissimilarity, -1 otherwise.
Throws:
JMException
JMException