|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.filters.supervised.attribute.gpattributegeneration.Genome<T>
public class Genome<T>
An individual genome for the GP system, made up of nodes. Adapted from Luke Devonshire's C# project
Constructor Summary | |
---|---|
Genome()
Creates an empty Genome |
|
Genome(GeneNode<Gene> genotype)
Constructs a Genome given a genotype |
|
Genome(Genome<T> genome)
Constructor to allow for a deep copy of a genome. |
|
Genome(java.util.Random rand,
EnumGenerationMethod generationMethod,
int maxDepth,
java.util.ArrayList<java.lang.String> funcSet,
int[] validAttributes)
Constructor to generate a random genome given the relevant parameters. |
|
Genome(java.lang.String prefixGenome)
Create a genome from a PREFIX string, with nodes separated by a space |
Method Summary | |
---|---|
void |
Clear()
Clears the genome of all its properties |
int |
compareTo(Genome<T> o)
Implements comparison method from 'Comparable'. |
boolean |
equals(java.lang.Object obj)
Equates this genome with the given parameter genome. |
java.util.ArrayList<GeneNode<Gene>> |
getChildren()
Returns the children of the genome's root node |
double |
getCrowdingDistance()
Gets crowding distance of the genome |
int |
getDominationRank()
Returns the domination rank of the genome |
GeneNode<Gene> |
getGenotype()
Returns genotype |
int |
getLength()
returns the length of the genome |
double |
getTreeAccuracy()
Returns the tree accuracy of the genome. |
int |
getTreeSize()
Get the tree size of the genome |
double |
getVectorFitness()
Calculate Vector fitness (1 is highest; but will never reach this). |
int |
hashCode()
Calculates a hashcode for Genome for use in HashMap |
void |
setCrowdingDistance(double dist)
Sets the crowding distance |
void |
setDominationRank(int rank)
Sets the domination rank of the genome |
void |
setGenotype(GeneNode<Gene> geno)
Sets genotype of genome and re-populates children to make it correct |
void |
setTreeAccuracy(double fitness)
Sets tree accuracy. |
void |
setTreeSize(int treeSize)
Set the tree size of the genome |
java.lang.String |
toString()
A string representation of the genome |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Genome()
public Genome(Genome<T> genome)
genome
- Genome to copypublic Genome(GeneNode<Gene> genotype)
genotype
- Genotype to use for new Genomepublic Genome(java.lang.String prefixGenome)
prefixGenome
- String to turn into a genomepublic Genome(java.util.Random rand, EnumGenerationMethod generationMethod, int maxDepth, java.util.ArrayList<java.lang.String> funcSet, int[] validAttributes)
rand
- Random object to use for generating pseudo-random numbersgenerationMethod
- The generation method to usemaxDepth
- The maximum depth of the tree createdfuncSet
- Available functions to use for creating the treevalidAttributes
- the valid numeric attributes that can be used as part of equationsMethod Detail |
---|
public void Clear()
public double getTreeAccuracy()
public void setTreeAccuracy(double fitness)
fitness
- tree accuracy to give the Genomepublic GeneNode<Gene> getGenotype()
public void setGenotype(GeneNode<Gene> geno)
geno
- Genotype to give to genepublic java.util.ArrayList<GeneNode<Gene>> getChildren()
public int getLength()
public double getVectorFitness()
public int getTreeSize()
public void setTreeSize(int treeSize)
treeSize
- the tree size to setpublic int getDominationRank()
public void setDominationRank(int rank)
rank
- The domination rankpublic double getCrowdingDistance()
public void setCrowdingDistance(double dist)
dist
- The crowding distancepublic java.lang.String toString()
toString
in class java.lang.Object
public int compareTo(Genome<T> o)
compareTo
in interface java.lang.Comparable<Genome<T>>
o
- The genome to compare to
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- Genome to compare to
public int hashCode()
hashCode
in class java.lang.Object
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |