Operator.Operations.ContextSensitiveOperations
Class SubtreeCrossover

java.lang.Object
  extended by Operator.Operations.CrossoverOperation
      extended by Operator.Operations.ContextSensitiveOperations.SubtreeCrossover
All Implemented Interfaces:
Operation, ParameterI, Stochastic

public class SubtreeCrossover
extends CrossoverOperation

Preform a crossover where the branch of one tree crosses with the branch of another. The two branches must be of the same type so the chromosome's codons will build the same branch on both trees. The crossover chromosome, because it potentially can insert a small unique group of codons into a wrapped chromosome, unwraps the chromosomes as they are crossed-over. This also changes the size of the chromosome, even if no unwrapping occurs, shrinking the chromosome

Author:
eliott bartley

Field Summary
 
Fields inherited from class Operator.Operations.CrossoverOperation
probability, rand
 
Constructor Summary
SubtreeCrossover(double prob, RandomNumberGenerator rng)
           
SubtreeCrossover(RandomNumberGenerator rng, java.util.Properties p)
           
 
Method Summary
 void doOperation(Individual operand)
          Performs the operation on an operand
 void doOperation(java.util.List<Individual> operands)
          Performs the operation on the list passed
 
Methods inherited from class Operator.Operations.CrossoverOperation
getRNG, setProperties, setRNG
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SubtreeCrossover

public SubtreeCrossover(RandomNumberGenerator rng,
                        java.util.Properties p)

SubtreeCrossover

public SubtreeCrossover(double prob,
                        RandomNumberGenerator rng)
Method Detail

doOperation

public void doOperation(java.util.List<Individual> operands)
Description copied from interface: Operation
Performs the operation on the list passed

Specified by:
doOperation in interface Operation
Specified by:
doOperation in class CrossoverOperation
Parameters:
operands - operands to be operated on

doOperation

public void doOperation(Individual operand)
Description copied from interface: Operation
Performs the operation on an operand

Parameters:
operand - operand to perform operation on