Package org.opt4j.optimizer.ea
Class Hypervolume
- java.lang.Object
-
- org.opt4j.optimizer.ea.Hypervolume
-
- All Implemented Interfaces:
FrontDensityIndicator
public class Hypervolume extends Object implements FrontDensityIndicator
TheHypervolumeis aFrontDensityIndicatorbased on determination of the hypervolume contribution. The calculation is based on a normalization between 0 and 1 in each dimension and a transformation to a maximization problem. Additionally an offset values (default 1) is added to each dimension.- See Also:
SMSModule, "Zitzler, E., and Thiele, L. (1998): Multiobjective Optimization Using Evolutionary Algorithms - A Comparative Case Study. Parallel Problem Solving from Nature (PPSN-V), 292-301."
-
-
Field Summary
Fields Modifier and Type Field Description protected doubleoffset
-
Constructor Summary
Constructors Constructor Description Hypervolume(double offset)Constructs aHypervolume.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected doublecalculateHypervolume(List<double[]> front, int nObjectives)Implements the hypervolume calculations as proposed by Zitzler, E., and Thiele, L.protected Map<Individual,Double>calculateHypervolumeContribution2D(List<Individual> individuals, double offset)Calculates the hypervolume contribution for two dimensions.protected Map<Individual,Double>calculateHypervolumeContributionN(List<Individual> individuals, double offset)Calculates the hypervolume contribution for n dimensions.protected booleandominates(double[] p1, double[] p2, int nObjectives)protected List<double[]>filterNondominatedSet(List<double[]> front, int nObjectives)Map<Individual,Double>getDensityValues(Collection<Individual> individuals)Returns the density values for a collection onIndividuals.protected Map<Individual,Double>getDensityValues(Collection<Individual> individuals, double offset)Calculates the density values for a front of non-dominated individuals based on the contribution of the hypervolume.protected List<double[]>getMinValues(List<Individual> individuals)Transforms the non-dominated individuals to a front where each objective is to be minimized.protected List<double[]>invert(List<double[]> front, double offset)Inverts (from a minimization to a maximization problem) a front of solutions and adds an offset value to each dimension.protected List<double[]>normalize(List<double[]> front)Normalizes a front of non-dominated solutions to values between 0 and 1.protected List<double[]>reduceNondominatedSet(List<double[]> front, int objective, double threshold)protected doublesurfaceUnchangedTo(List<double[]> front, int objective)
-
-
-
Method Detail
-
getDensityValues
public Map<Individual,Double> getDensityValues(Collection<Individual> individuals)
Description copied from interface:FrontDensityIndicatorReturns the density values for a collection onIndividuals.- Specified by:
getDensityValuesin interfaceFrontDensityIndicator- Parameters:
individuals- the individuals- Returns:
- a map of each individual to its density value
-
getDensityValues
protected Map<Individual,Double> getDensityValues(Collection<Individual> individuals, double offset)
Calculates the density values for a front of non-dominated individuals based on the contribution of the hypervolume. A special approach for two dimension exists as well as a general approach for n dimensions.- Parameters:
individuals- the individualsoffset- the offset- Returns:
- the map of density values
-
calculateHypervolumeContributionN
protected Map<Individual,Double> calculateHypervolumeContributionN(List<Individual> individuals, double offset)
Calculates the hypervolume contribution for n dimensions.- Parameters:
individuals- the individualsoffset- the offset- Returns:
- the map of density values
-
calculateHypervolumeContribution2D
protected Map<Individual,Double> calculateHypervolumeContribution2D(List<Individual> individuals, double offset)
Calculates the hypervolume contribution for two dimensions.- Parameters:
individuals- the individualsoffset- the offset- Returns:
- the map of density values
-
getMinValues
protected List<double[]> getMinValues(List<Individual> individuals)
Transforms the non-dominated individuals to a front where each objective is to be minimized.- Parameters:
individuals- the individuals- Returns:
- the front of vectors that is minimized
-
normalize
protected List<double[]> normalize(List<double[]> front)
Normalizes a front of non-dominated solutions to values between 0 and 1.- Parameters:
front- the front of non-dominated solutions- Returns:
- the normalized front
-
invert
protected List<double[]> invert(List<double[]> front, double offset)
Inverts (from a minimization to a maximization problem) a front of solutions and adds an offset value to each dimension.- Parameters:
front- the front of non-dominated solutionsoffset- the offset- Returns:
- the inverted front
-
calculateHypervolume
protected double calculateHypervolume(List<double[]> front, int nObjectives)
Implements the hypervolume calculations as proposed by Zitzler, E., and Thiele, L. (1998). All points have positive values in all dimensions and the hypervolume is calculated from 0.- Parameters:
front- the front of non-dominated solutionsnObjectives- the number of objectives- Returns:
- the hypervolume
-
filterNondominatedSet
protected List<double[]> filterNondominatedSet(List<double[]> front, int nObjectives)
-
dominates
protected boolean dominates(double[] p1, double[] p2, int nObjectives)
-
surfaceUnchangedTo
protected double surfaceUnchangedTo(List<double[]> front, int objective)
-
-