lio.neighbourhood.permutation
Class permNeighbourGenerator

java.lang.Object
  extended by lio.neighbourhood.permutation.permNeighbourGenerator
All Implemented Interfaces:
LiOResource, Neighbourhood

public class permNeighbourGenerator
extends java.lang.Object
implements Neighbourhood

This class allows generating neighbours from a permutation by swaping each position with other.


Constructor Summary
permNeighbourGenerator()
           
 
Method Summary
 Individual[] getAllNeighbours(Individual individual)
          Returns the neighbours of one individual ordered decreasingly.
 Individual[] getBestNeighbours(Individual individual, int numNeighbours)
          Returns the best neighbours of one individual ordered decreasingly.
 LiOResourceDefinition getDefinition()
          Return a LiOResDescription object with the information of the object.
 Individual getRandomNeighbour(Individual individual)
          Returns a random neighbour of one individual.
 boolean isNonContiguous()
          Getter for property nonContiguous.
static void main(java.lang.String[] args)
          Allows testing the class.
 void setNonContiguous(boolean nonContiguous)
          Setter for property nonContiguous.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

permNeighbourGenerator

public permNeighbourGenerator()
Method Detail

getBestNeighbours

public Individual[] getBestNeighbours(Individual individual,
                                      int numNeighbours)
Returns the best neighbours of one individual ordered decreasingly.

Specified by:
getBestNeighbours in interface Neighbourhood
Parameters:
individual - Individual whose neighbourhood is being returned.
numNeighbours - Number of individuals returned.
Returns:
The best neighbours of one individual..

getRandomNeighbour

public Individual getRandomNeighbour(Individual individual)
Returns a random neighbour of one individual.

Specified by:
getRandomNeighbour in interface Neighbourhood
Parameters:
individual - Individual whose neighbour is being returned.
Returns:
A random neighbour of one individual.

getDefinition

public LiOResourceDefinition getDefinition()
Return a LiOResDescription object with the information of the object. It holds the name and all parameters that describe the object.

Specified by:
getDefinition in interface LiOResource
Returns:
A definition of the object.

isNonContiguous

public boolean isNonContiguous()
Getter for property nonContiguous.

Returns:
Value of property nonContiguous.

setNonContiguous

public void setNonContiguous(boolean nonContiguous)
Setter for property nonContiguous.

Parameters:
nonContiguous - New value of property nonContiguous.

main

public static void main(java.lang.String[] args)
Allows testing the class.

Parameters:
args - the command line arguments

getAllNeighbours

public Individual[] getAllNeighbours(Individual individual)
Returns the neighbours of one individual ordered decreasingly.

Specified by:
getAllNeighbours in interface Neighbourhood
Parameters:
individual - Individual whose neighbourhood is being returned.
Returns:
The all neighbours of one individual..