jmetal.qualityIndicator.util
Class MetricsUtil

java.lang.Object
  extended by jmetal.qualityIndicator.util.MetricsUtil

public class MetricsUtil
extends java.lang.Object

This class provides some utilities to compute quality indicators.


Constructor Summary
MetricsUtil()
           
 
Method Summary
 double distance(double[] a, double[] b)
          This method returns the distance (taken the euclidean distance) between two points given as double []
 double distanceToClosedPoint(double[] point, double[][] front)
          Gets the distance between a point and the nearest one in a given front (the front is given as double [][])
 double distanceToNearestPoint(double[] point, double[][] front)
          Gets the distance between a point and the nearest one in a given front, and this distance is greater than 0.0
 double[] getMaximumValues(double[][] front, int noObjectives)
          Gets the maximum values for each objectives in a given pareto front
 double[] getMinimumValues(double[][] front, int noObjectives)
          Gets the minimum values for each objectives in a given pareto front
 double[][] getNormalizedFront(double[][] front, double[] maximumValue, double[] minimumValue)
          This method receives a pareto front and two points, one whit maximum values and the other with minimum values allowed, and returns a the normalized Pareto front.
 double[] hvContributions(int numberOfobjectives, double[][] front)
          Calculates how much hypervolume each point dominates exclusively.
 double[] hvContributions(SolutionSet[] populations)
          Calculates the hv contribution of different populations.
 double[] hvContributions(SolutionSet archive, SolutionSet[] populations)
          Calculates the hv contribution of different populations.
 double[][] invertedFront(double[][] front)
          This method receives a normalized pareto front and return the inverted one.
 double[][] readFront(java.lang.String path)
          This method reads a Pareto Front for a file.
 SolutionSet readNonDominatedSolutionSet(java.lang.String path)
          Reads a set of non dominated solutions from a file
 void readNonDominatedSolutionSet(java.lang.String path, NonDominatedSolutionList solutionSet)
          Reads a set of non dominated solutions from a file and store it in a existing non dominated solution set
 SolutionSet readSolutionSet(java.lang.String path)
          Reads a set of non dominated solutions from a file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MetricsUtil

public MetricsUtil()
Method Detail

readFront

public double[][] readFront(java.lang.String path)
This method reads a Pareto Front for a file.

Parameters:
path - The path to the file that contains the pareto front
Returns:
double [][] whit the pareto front

getMaximumValues

public double[] getMaximumValues(double[][] front,
                                 int noObjectives)
Gets the maximum values for each objectives in a given pareto front

Parameters:
front - The pareto front
noObjectives - Number of objectives in the pareto front
Returns:
double [] An array of noOjectives values whit the maximun values for each objective

getMinimumValues

public double[] getMinimumValues(double[][] front,
                                 int noObjectives)
Gets the minimum values for each objectives in a given pareto front

Parameters:
front - The pareto front
noObjectives - Number of objectives in the pareto front
Returns:
double [] An array of noOjectives values whit the minimum values for each objective

distance

public double distance(double[] a,
                       double[] b)
This method returns the distance (taken the euclidean distance) between two points given as double []

Parameters:
a - A point
b - A point
Returns:
The euclidean distance between the points

distanceToClosedPoint

public double distanceToClosedPoint(double[] point,
                                    double[][] front)
Gets the distance between a point and the nearest one in a given front (the front is given as double [][])

Parameters:
point - The point
front - The front that contains the other points to calculate the distances
Returns:
The minimun distance between the point and the front

distanceToNearestPoint

public double distanceToNearestPoint(double[] point,
                                     double[][] front)
Gets the distance between a point and the nearest one in a given front, and this distance is greater than 0.0

Parameters:
point - The point
front - The front that contains the other points to calculate the distances
Returns:
The minimun distances greater than zero between the point and the front

getNormalizedFront

public double[][] getNormalizedFront(double[][] front,
                                     double[] maximumValue,
                                     double[] minimumValue)
This method receives a pareto front and two points, one whit maximum values and the other with minimum values allowed, and returns a the normalized Pareto front.

Parameters:
front - A pareto front.
maximumValue - The maximum values allowed
minimumValue - The minimum values allowed
Returns:
the normalized pareto front

invertedFront

public double[][] invertedFront(double[][] front)
This method receives a normalized pareto front and return the inverted one. This operation needed for minimization problems

Parameters:
front - The pareto front to inverse
Returns:
The inverted pareto front

readSolutionSet

public SolutionSet readSolutionSet(java.lang.String path)
Reads a set of non dominated solutions from a file

Parameters:
path - The path of the file containing the data
Returns:
A solution set

readNonDominatedSolutionSet

public SolutionSet readNonDominatedSolutionSet(java.lang.String path)
Reads a set of non dominated solutions from a file

Parameters:
path - The path of the file containing the data
Returns:
A solution set

readNonDominatedSolutionSet

public void readNonDominatedSolutionSet(java.lang.String path,
                                        NonDominatedSolutionList solutionSet)
Reads a set of non dominated solutions from a file and store it in a existing non dominated solution set

Parameters:
path - The path of the file containing the data

hvContributions

public double[] hvContributions(int numberOfobjectives,
                                double[][] front)
Calculates how much hypervolume each point dominates exclusively. The points have to be transformed beforehand, to accommodate the assumptions of Zitzler's hypervolume code.

Parameters:
front - transformed objective values
Returns:
HV contributions

hvContributions

public double[] hvContributions(SolutionSet[] populations)
Calculates the hv contribution of different populations. Receives an array of populations and computes the contribution to HV of the population consisting in the union of all of them

Parameters:
populations, - consisting in all the populatoins
Returns:
HV contributions of each population

hvContributions

public double[] hvContributions(SolutionSet archive,
                                SolutionSet[] populations)
Calculates the hv contribution of different populations. Receives an array of populations and computes the contribution to HV of the population consisting in the union of all of them

Parameters:
populations, - consisting in all the populatoins
Returns:
HV contributions of each population