weka.filters.supervised.attribute.gpattributegeneration
Class GeneticOperator

java.lang.Object
  extended by weka.filters.supervised.attribute.gpattributegeneration.GeneticOperator

public class GeneticOperator
extends java.lang.Object

Class to provide genetic operators. Ported and adapted from Luke Devonshire's C#.

Author:
Colin Noakes & Luke Devonshire

Constructor Summary
GeneticOperator()
           
 
Method Summary
static java.util.ArrayList<Genome<Gene>> crossOver(java.util.Random rand, Genome<Gene> parentOne, Genome<Gene> parentTwo)
          Crossover between two Genomes
static Genome<Gene> pointMutation(java.util.Random rand, Genome<Gene> parent, java.util.ArrayList<java.lang.String> functions, int[] validAttributes)
          Performs random number of point mutations on a genome
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeneticOperator

public GeneticOperator()
Method Detail

crossOver

public static java.util.ArrayList<Genome<Gene>> crossOver(java.util.Random rand,
                                                          Genome<Gene> parentOne,
                                                          Genome<Gene> parentTwo)
Crossover between two Genomes

Parameters:
rand - Random object to use for generating pseudo-random numbers
parentOne - Parent 1
parentTwo - Parent 2
Returns:
Two crossed over genomes

pointMutation

public static Genome<Gene> pointMutation(java.util.Random rand,
                                         Genome<Gene> parent,
                                         java.util.ArrayList<java.lang.String> functions,
                                         int[] validAttributes)
Performs random number of point mutations on a genome

Parameters:
rand - Random object to use for generating genomes
parent - The genome to mutate
functions - Function set being used in the GP System
validAttributes - the valid numeric attributes that can be used as part of equations
Returns:
A mutated genome