Class MinMaxObjectiveComparator
java.lang.Object
org.moeaframework.core.comparator.AbstractAggregateObjectiveComparator
org.moeaframework.core.comparator.MinMaxObjectiveComparator
- All Implemented Interfaces:
Comparator<Solution>
,AggregateObjectiveComparator
,DominanceComparator
Weighted min-max aggregate function. By default, all weights are assumed to be equal.
- See Also:
-
Field Summary
Fields inherited from class org.moeaframework.core.comparator.AbstractAggregateObjectiveComparator
weights
-
Constructor Summary
ConstructorDescriptionMinMaxObjectiveComparator
(double... weights) Constructs a new comparator using a weighted min-max aggregate function. -
Method Summary
Methods inherited from class org.moeaframework.core.comparator.AbstractAggregateObjectiveComparator
compare, getWeights
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, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
MinMaxObjectiveComparator
public MinMaxObjectiveComparator(double... weights) Constructs a new comparator using a weighted min-max aggregate function.- Parameters:
weights
- the weight vector
-
-
Method Details
-
calculate
Description copied from interface:AggregateObjectiveComparator
Calculates the aggregate value of the solution using this aggregate function.- Parameters:
solution
- the solution- Returns:
- the aggregate value (smaller is better)
-
calculate
Computes the weighted min-max aggregate value of the solution. One weight should be given for each objective; if fewer weights are provided, the last weight is repeated for the remaining objectives.- Parameters:
solution
- the solutionweights
- the weight vector- Returns:
- the fitness, where smaller values are preferred
-