jmetal.util
Class Distance

java.lang.Object
  extended by jmetal.util.Distance

public class Distance
extends java.lang.Object

This class implements some utilities for calculating distances


Constructor Summary
Distance()
          Constructor.
 
Method Summary
 void crowdingDistanceAssignment(SolutionSet solutionSet, int nObjs)
          Assigns crowding distances to all solutions in a SolutionSet.
 double distanceBetweenObjectives(Solution solutionI, Solution solutionJ)
          Returns the distance between two solutions in objective space.
 double distanceBetweenSolutions(Solution solutionI, Solution solutionJ)
          Returns the distance between two solutions in the search space.
 double[][] distanceMatrix(SolutionSet solutionSet)
          Returns a matrix with distances between solutions in a SolutionSet.
 double distanceToSolutionSetInObjectiveSpace(Solution solution, SolutionSet solutionSet)
          Returns the minimum distance from a Solution to a SolutionSet according to the objective values.
 double distanceToSolutionSetInSolutionSpace(Solution solution, SolutionSet solutionSet)
          Returns the minimum distance from a Solution to a SolutionSet according to the encodings.variable values.
 int indexToNearestSolutionInSolutionSpace(Solution solution, SolutionSet solutionSet)
          Return the index of the nearest solution in the solution set to a given solution
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Distance

public Distance()
Constructor.

Method Detail

distanceMatrix

public double[][] distanceMatrix(SolutionSet solutionSet)
Returns a matrix with distances between solutions in a SolutionSet.

Parameters:
solutionSet - The SolutionSet.
Returns:
a matrix with distances.

distanceToSolutionSetInObjectiveSpace

public double distanceToSolutionSetInObjectiveSpace(Solution solution,
                                                    SolutionSet solutionSet)
                                             throws JMException
Returns the minimum distance from a Solution to a SolutionSet according to the objective values.

Parameters:
solution - The Solution.
solutionSet - The SolutionSet.
Returns:
The minimum distance between solution and the set.
Throws:
JMException

distanceToSolutionSetInSolutionSpace

public double distanceToSolutionSetInSolutionSpace(Solution solution,
                                                   SolutionSet solutionSet)
                                            throws JMException
Returns the minimum distance from a Solution to a SolutionSet according to the encodings.variable values.

Parameters:
solution - The Solution.
solutionSet - The SolutionSet.
Returns:
The minimum distance between solution and the set.
Throws:
JMException

distanceBetweenSolutions

public double distanceBetweenSolutions(Solution solutionI,
                                       Solution solutionJ)
                                throws JMException
Returns the distance between two solutions in the search space.

Parameters:
solutionI - The first Solution.
solutionJ - The second Solution.
Returns:
the distance between solutions.
Throws:
JMException

distanceBetweenObjectives

public double distanceBetweenObjectives(Solution solutionI,
                                        Solution solutionJ)
Returns the distance between two solutions in objective space.

Parameters:
solutionI - The first Solution.
solutionJ - The second Solution.
Returns:
the distance between solutions in objective space.

indexToNearestSolutionInSolutionSpace

public int indexToNearestSolutionInSolutionSpace(Solution solution,
                                                 SolutionSet solutionSet)
Return the index of the nearest solution in the solution set to a given solution

Parameters:
solution -
solutionSet -
Returns:
The index of the nearest solution; -1 if the solutionSet is empty

crowdingDistanceAssignment

public void crowdingDistanceAssignment(SolutionSet solutionSet,
                                       int nObjs)
Assigns crowding distances to all solutions in a SolutionSet.

Parameters:
solutionSet - The SolutionSet.
nObjs - Number of objectives.