Class LinearDominanceComparator
java.lang.Object
org.moeaframework.core.comparator.ChainedComparator
org.moeaframework.core.comparator.LinearDominanceComparator
- All Implemented Interfaces:
 Comparator<Solution>,AggregateObjectiveComparator,DominanceComparator
public class LinearDominanceComparator
extends ChainedComparator
implements AggregateObjectiveComparator
Version of the weighted linear aggregate function that supports constraints.
- 
Field Summary
Fields inherited from class org.moeaframework.core.comparator.ChainedComparator
comparators - 
Constructor Summary
ConstructorsConstructorDescriptionLinearDominanceComparator(double... weights) Constructs a new dominance comparator using a weighted linear aggregate function and constraints. - 
Method Summary
Modifier and TypeMethodDescriptiondoubleCalculates the aggregate value of the solution using this aggregate function.double[]Returns the weights used by this aggregate function.Methods inherited from class org.moeaframework.core.comparator.ChainedComparator
compareMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Comparator
compare, equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLongMethods inherited from interface org.moeaframework.core.comparator.DominanceComparator
compare 
- 
Constructor Details
- 
LinearDominanceComparator
public LinearDominanceComparator(double... weights) Constructs a new dominance comparator using a weighted linear aggregate function and constraints. One weight should be given for each objective; if fewer weights are provided, the last weight is repeated for the remaining objectives. Defaults to weights of1.0if none are provided.- Parameters:
 weights- the weight vector
 
 - 
 - 
Method Details
- 
getWeights
public double[] getWeights()Description copied from interface:AggregateObjectiveComparatorReturns the weights used by this aggregate function.- Specified by:
 getWeightsin interfaceAggregateObjectiveComparator- Returns:
 - the weights
 
 - 
calculate
Description copied from interface:AggregateObjectiveComparatorCalculates the aggregate value of the solution using this aggregate function.- Specified by:
 calculatein interfaceAggregateObjectiveComparator- Parameters:
 solution- the solution- Returns:
 - the aggregate value (smaller is better)
 
 
 -