dLife Home Page

dlife.ga
Class OnePointCrossover

java.lang.Object
  extended by dlife.ga.OnePointCrossover
All Implemented Interfaces:
CrossoverOperator, Serializable

public class OnePointCrossover
extends Object
implements CrossoverOperator

An implementation of one point crossover. The crossover occurs by selecting a parent and a crossover point. The offspring is produced by copying the Genes of the selected parent upto, but not including, the crossover point and then copying the Genes from the crossover point on, from the other parent. Note that it is possible for either parent to contribute all of its Genes to the offspring.

Version:
Jan 7, 2007
Author:
Grant Braught, Dickinson College
See Also:
Serialized Form

Constructor Summary
OnePointCrossover()
           
 
Method Summary
 Individual crossover(Individual p1, Individual p2)
          Crossover the two parent Individuals provided to produce a single offspring Individual.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OnePointCrossover

public OnePointCrossover()
Method Detail

crossover

public Individual crossover(Individual p1,
                            Individual p2)
Crossover the two parent Individuals provided to produce a single offspring Individual.

Specified by:
crossover in interface CrossoverOperator
Parameters:
p1 - one parent.
p2 - the other parent.
Returns:
an offspring Individual produced from p1 and p2 via crossover.

dLife Home Page