lio.crossover.bitchain
Class OnePointCrossover

java.lang.Object
  extended by lio.crossover.bitchain.OnePointCrossover
All Implemented Interfaces:
LiOResource, Crossover

public class OnePointCrossover
extends java.lang.Object
implements Crossover

Implements the one point crossover operator for chains of bits.


Constructor Summary
OnePointCrossover()
          Creates a new instance of OnePointCrossover
OnePointCrossover(int pPoint)
          Creates a new instance of OnePointCrossover with a given point of crossover
 
Method Summary
 Individual[] cross(Individual parent1, Individual parent2)
          Crosses two individuals.
 LiOResourceDefinition getDefinition()
          Return a LiOResDescription object which holds the name and all parameters that describe the resource.
 int getPoint()
          Returns the point of crossover.
 int getSizeOffSpring()
           
static void main(java.lang.String[] args)
          Main class that allows testing the class.
 void setPoint(int pPoint)
          Sets the point of crossover.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OnePointCrossover

public OnePointCrossover()
Creates a new instance of OnePointCrossover


OnePointCrossover

public OnePointCrossover(int pPoint)
Creates a new instance of OnePointCrossover with a given point of crossover

Parameters:
pPoint -
Method Detail

getSizeOffSpring

public int getSizeOffSpring()
Specified by:
getSizeOffSpring in interface Crossover
Returns:
The size of the offspring produced by the operator.

getDefinition

public LiOResourceDefinition getDefinition()
Return a LiOResDescription object which holds the name and all parameters that describe the resource.

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

setPoint

public void setPoint(int pPoint)
Sets the point of crossover.

Parameters:
pPoint - point of crossover.

getPoint

public int getPoint()
Returns the point of crossover.

Returns:
Point of crossover

cross

public Individual[] cross(Individual parent1,
                          Individual parent2)
Crosses two individuals.

Specified by:
cross in interface Crossover
Parameters:
parent1 - First parent
parent2 - Second parent
Returns:
An array of individuals containing the offspring.

main

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

Parameters:
args - Arguments passed by command line