lio.neighbourhood.bitchain
Class bitChNeighbourGenerator

java.lang.Object
  extended by lio.neighbourhood.bitchain.bitChNeighbourGenerator
All Implemented Interfaces:
LiOResource, Neighbourhood

public class bitChNeighbourGenerator
extends java.lang.Object
implements Neighbourhood

This class allows generating neighbours from a chain of bits by flipping each position.


Constructor Summary
bitChNeighbourGenerator()
           
 
Method Summary
 Individual[] getAllNeighbours(Individual individual)
          Returns the neighbours of one individual in decreasing order.
 Individual[] getBestNeighbours(Individual individual, int numNeighbours)
          Returns the best neighbours of one individual in decreasing order.
 LiOResourceDefinition getDefinition()
          Return a LiOResDescription object with the information of the object.
 Individual getRandomNeighbour(Individual individual)
          Returns the best neighbour of one individual.
static void main(java.lang.String[] args)
          Allows testing the class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

bitChNeighbourGenerator

public bitChNeighbourGenerator()
Method Detail

getBestNeighbours

public Individual[] getBestNeighbours(Individual individual,
                                      int numNeighbours)
Returns the best neighbours of one individual in decreasing order.

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 the best 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.

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 in decreasing order.

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