weka.filters.supervised.attribute.gpattributegeneration
Class GeneticOperator
java.lang.Object
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
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 |
GeneticOperator
public GeneticOperator()
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 numbersparentOne
- Parent 1parentTwo
- 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 genomesparent
- The genome to mutatefunctions
- Function set being used in the GP SystemvalidAttributes
- the valid numeric attributes that can be used as part of equations
- Returns:
- A mutated genome