lio.crossover.permutations
Class OrderCrossover

java.lang.Object
  extended by lio.crossover.permutations.OrderCrossover
All Implemented Interfaces:
LiOResource, Crossover

public class OrderCrossover
extends java.lang.Object
implements Crossover

Implements the order crossover operator for permutations.


Constructor Summary
OrderCrossover()
          Creates a new instance of OrderCrossover with the given points 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 getPoint1()
           
 int getPoint2()
           
 int getSizeOffSpring()
           
static void main(java.lang.String[] args)
          Main class that allows testing the class.
 void setPoint1(int point1)
           
 void setPoint2(int point2)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OrderCrossover

public OrderCrossover()
Creates a new instance of OrderCrossover with the given points of crossover. If these are 0, then they will be choosen randomly.

Parameters:
pPoint1 - First point of crossover.
pPoint2 - Second point of crossover.
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.

getPoint1

public int getPoint1()
Returns:
Returns the point1.

setPoint1

public void setPoint1(int point1)
Parameters:
point1 - The point1 to set.

getPoint2

public int getPoint2()
Returns:
Returns the point2.

setPoint2

public void setPoint2(int point2)
Parameters:
point2 - The point2 to set.

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