Class VectorAngleDistanceScalingComparator
java.lang.Object
org.moeaframework.algorithm.single.AbstractAggregateObjectiveComparator
org.moeaframework.algorithm.single.VectorAngleDistanceScalingComparator
- All Implemented Interfaces:
Comparator<Solution>
,AggregateObjectiveComparator
,DominanceComparator
The vector angle distance scaling aggregate function. The distance between the origin and the objective vector is
scaled by the cosine angle between the objective vector and a target vector.
References:
- E. J. Hughes. "Multiple Single Objective Pareto Sampling." 2003 Congress on Evolutionary Computation, pp. 2678-2684.
-
Field Summary
Fields inherited from class org.moeaframework.algorithm.single.AbstractAggregateObjectiveComparator
weights
-
Constructor Summary
ConstructorDescriptionVectorAngleDistanceScalingComparator
(double[] weights) Constructs a new instance of the vector angle distance scaling aggregate function with the given weights.VectorAngleDistanceScalingComparator
(double[] weights, double q) Constructs a new instance of the vector angle distance scaling aggregate function with the given weights. -
Method Summary
Modifier and TypeMethodDescriptiondouble
calculateFitness
(Solution solution) Calculates the aggregate (fitness) value of the solution using this aggregate function.static final double
calculateFitness
(Solution solution, double[] weights, double q) Computes the vector angle distance scaling aggregate fitness of the solution.double
Returns the factor for scaling the effects of the angle.Methods inherited from class org.moeaframework.algorithm.single.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
-
VectorAngleDistanceScalingComparator
public VectorAngleDistanceScalingComparator(double[] weights) Constructs a new instance of the vector angle distance scaling aggregate function with the given weights.- Parameters:
weights
- the weight vector; must have a magnitude of 1.0
-
VectorAngleDistanceScalingComparator
public VectorAngleDistanceScalingComparator(double[] weights, double q) Constructs a new instance of the vector angle distance scaling aggregate function with the given weights.- Parameters:
weights
- the weight vector; must have a magnitude of 1.0q
- factor for scaling the effects of the angle
-
-
Method Details
-
getAngleScalingFactor
public double getAngleScalingFactor()Returns the factor for scaling the effects of the angle.- Returns:
- the factor for scaling the effects of the angle
-
calculateFitness
Description copied from interface:AggregateObjectiveComparator
Calculates the aggregate (fitness) value of the solution using this aggregate function.- Parameters:
solution
- the solution- Returns:
- the aggregate value (smaller is better)
-
calculateFitness
Computes the vector angle distance scaling aggregate fitness of the solution. One weight should be given for each objective.- Parameters:
solution
- the solutionweights
- the weight vectorq
- factor for scaling the effects of the angle- Returns:
- the fitness, where smaller values are preferred
-