jmetal.util
Class DistanceNode

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

public class DistanceNode
extends java.lang.Object

This is an auxiliar class for calculating the SPEA2 environmental selection. Each instance of DistanceNode contains two parameter called reference_ and distance_. reference_ indicates one Solution in a SolutionSet and distance_ represents the distance_ to this solution.


Constructor Summary
DistanceNode(double distance, int reference)
          Constructor.
 
Method Summary
 double getDistance()
          Gets the distance
 int getReference()
          Gets the reference
 void setDistance(double distance)
          Sets the distance to a Solution
 void setReferece(int reference)
          Sets the reference to a Solution
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DistanceNode

public DistanceNode(double distance,
                    int reference)
Constructor.

Parameters:
distance - The distance to a Solution.
reference - The position of the Solution.
Method Detail

setDistance

public void setDistance(double distance)
Sets the distance to a Solution

Parameters:
distance - The distance

setReferece

public void setReferece(int reference)
Sets the reference to a Solution

Parameters:
reference - The reference

getDistance

public double getDistance()
Gets the distance

Returns:
the distance

getReference

public int getReference()
Gets the reference

Returns:
the reference