org.artoflife.gp.genome
Class SwapSubtreeCrossover

java.lang.Object
  |
  +--org.artoflife.gp.genome.SwapSubtreeCrossover
All Implemented Interfaces:
GpCrossover

public class SwapSubtreeCrossover
extends java.lang.Object
implements GpCrossover

Find a random subtree in chromosome to be replaced with a compatible subtree from the other chromosome if one can be found, else no change.

Author:
Steve Meyfroidt

Constructor Summary
SwapSubtreeCrossover()
           
 
Method Summary
 void crossover(GpTreeChromosome chromosome1, GpTreeChromosome chromosome2)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SwapSubtreeCrossover

public SwapSubtreeCrossover()
Method Detail

crossover

public void crossover(GpTreeChromosome chromosome1,
                      GpTreeChromosome chromosome2)
Specified by:
crossover in interface GpCrossover
Parameters:
chromosome1 - the GpTreeChromosome to crossover, so this is changed when the method has returned
chromosome2 - the GpTreeChromosome to crossover with, so this is not changed when the method has returned

artoflife pre0.1.0-dev

Copyright © 2002 the Art Of Life team. All Rights Reserved.