Class AggregateConstraintComparator
java.lang.Object
org.moeaframework.core.comparator.AggregateConstraintComparator
- All Implemented Interfaces:
 Comparator<Solution>,DominanceComparator
public class AggregateConstraintComparator
extends Object
implements DominanceComparator, Comparator<Solution>
Compares solutions based on their magnitude of constraint violations.  Absolute values of constraints are used,
 so only the magnitude of the constraint violation is important.
- 
Constructor Summary
ConstructorsConstructorDescriptionConstructs an aggregate constraint comparator. - 
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong 
- 
Constructor Details
- 
AggregateConstraintComparator
public AggregateConstraintComparator()Constructs an aggregate constraint comparator. 
 - 
 - 
Method Details
- 
compare
Description copied from interface:DominanceComparatorCompares the two solutions using a dominance relation, returning-1ifsolution1dominatessolution2,1ifsolution2dominatessolution1, and0if the solutions are non-dominated.- Specified by:
 comparein interfaceComparator<Solution>- Specified by:
 comparein interfaceDominanceComparator- Parameters:
 solution1- the first solutionsolution2- the second solution- Returns:
 -1ifsolution1dominatessolution2,1ifsolution2dominatessolution1, and0if the solutions are non-dominated
 
 -