jmetal.util
Class Neighborhood

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

public class Neighborhood
extends java.lang.Object

Class representing neighborhoods for a Solution into a SolutionSet.


Constructor Summary
Neighborhood(int solutionSetSize)
          Constructor.
 
Method Summary
 SolutionSet getEightNeighbors(SolutionSet population, int individual)
          Returns a SolutionSet with the North, Sout, East, West, North-West, South-West, North-East and South-East neighbors solutions of ratio 0 of a given location into a given SolutionSet.
 SolutionSet getFourNeighbors(SolutionSet solutionSet, int location)
          Returns a SolutionSet with the North, Sout, East and West neighbors solutions of ratio 0 of a given location into a given SolutionSet.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Neighborhood

public Neighborhood(int solutionSetSize)
Constructor. Defines a neighborhood of a given size.

Parameters:
solutionSetSize - The size.
Method Detail

getFourNeighbors

public SolutionSet getFourNeighbors(SolutionSet solutionSet,
                                    int location)
Returns a SolutionSet with the North, Sout, East and West neighbors solutions of ratio 0 of a given location into a given SolutionSet.

Parameters:
solutionSet - The SolutionSet.
location - The location.
Returns:
a SolutionSet with the neighbors.

getEightNeighbors

public SolutionSet getEightNeighbors(SolutionSet population,
                                     int individual)
Returns a SolutionSet with the North, Sout, East, West, North-West, South-West, North-East and South-East neighbors solutions of ratio 0 of a given location into a given SolutionSet. solutions of a given location into a given SolutionSet.

Parameters:
population - The SolutionSet.
individual - The individual.
Returns:
a SolutionSet with the neighbors.