simbad.picoevo.ext.representation
Class Individual_NEATIndividual

java.lang.Object
  extended by simbad.picoevo.core.representation.EvolutionObject
      extended by simbad.picoevo.core.representation.Individual
          extended by simbad.picoevo.ext.representation.Individual_NEATIndividual
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable, EvaluationInterface, InitialisationInterface

public class Individual_NEATIndividual
extends Individual
implements java.lang.Comparable


Field Summary
protected  double amountToSpawn
           
protected  double genomeAdjustedFitness
           
 int genomeID
           
protected  java.util.Vector<Element_NEAT_LGene> genomeLinks
           
protected  int genomeNetDepth
           
protected  java.util.Vector<Element_NEAT_NGene> genomeNeurons
           
protected  double genomeRawFitness
           
 int genomeSpecies
           
protected  java.util.HashMap<java.lang.Integer,java.lang.Integer> iIDToLink
           
protected  java.util.HashMap<java.lang.Integer,java.lang.Integer> iIDToNeuron
           
 int inputs
           
 int outputs
           
 
Fields inherited from class simbad.picoevo.core.representation.Individual
_elementList, _fitness, _isEvaluated, _populationOwner
 
Fields inherited from class simbad.picoevo.core.representation.EvolutionObject
_memoryModule, _name, _variationOperatorList
 
Constructor Summary
Individual_NEATIndividual(Population owner)
           
Individual_NEATIndividual(Population owner, int GID, java.util.Vector<Element_NEAT_NGene> nodes, java.util.Vector<Element_NEAT_LGene> links, int depth, int ins, int outs, int species)
           
Individual_NEATIndividual(java.lang.String __name, Population owner)
           
Individual_NEATIndividual(java.lang.String __name, Population owner, int GID, int depth, int ins, int outs, int species)
           
Individual_NEATIndividual(java.lang.String __name, Population owner, int GID, java.util.Vector<Element_NEAT_NGene> nodes, java.util.Vector<Element_NEAT_LGene> links, int depth, int ins, int outs, int species)
           
 
Method Summary
 void addElement(Element __element)
          It is required to override this by definition but the NEAT implementation will not use this specific function
 void addLink(Element_NEAT_LGene n)
           
 void addNeuron(Element_NEAT_NGene n)
           
 java.lang.Object clone()
           
 int compareTo(Individual_NEATIndividual _o)
           
private  void correctOwnership()
           
 RecurrentNeuralNetwork createPhenotype()
           
 void displayInformation()
           
 double getAdjustedFitness()
           
 double getAmountToSpawn()
           
 double getCompatibilityScore(Individual_NEATIndividual genome)
          Calculate the distance between two genomes according to the formula CompatDist = ((c1*#ExcessGenes)/N) + ((c2*#DisjointGenes)/N) + c3*WeightDifference N = number of genes in the larger genome c1,c2,c3 = coefficients to tweak outcome Original Algorithm written by Mat Buckland http://www.ai-junkie.com Ported to this system by Robert Lucas http://www.automatonsadrift.com
 Element getElementAt(int index)
          Specifically to override the getElementAt() function from Individual If the nodes and links were stored in an individual vector we order +
 int getElementListSize()
          Specifically to override the getElementListSize() function from Individual
 int getGenomeID()
           
 Element_NEAT_LGene getLinkAt(int i)
           
 java.util.Vector<Element_NEAT_LGene> getLinks()
           
 int getNetDepth()
           
 Element_NEAT_NGene getNeuronAt(int i)
           
 java.util.Vector<Element_NEAT_NGene> getNeurons()
           
 int getNumLinks()
           
 int getNumNeurons()
           
 double getRawFitness()
           
 int numInputs()
           
 int numOutputs()
           
 void performVariations()
          Specifically to override the performVariations() function from Individual NEAT requires this due to its non standard genome
 void rebuildIIDLookup()
           
 void setAdjustedFitness(double fit)
           
 void setAllLinks(java.util.Vector<Element_NEAT_LGene> links)
           
 void setAllNeurons(java.util.Vector<Element_NEAT_NGene> nodes)
           
 void setAmountToSpawn(double fit)
           
 void setFitness(double d)
          Specifically to override the setFitness() function from Individual
 void setGenomeID(int genomeID)
           
 void setInputsOutputs(int in, int out)
           
 void setNetDepth(int depth)
           
 void setRawFitness(double fit)
           
 void sort()
           
 java.lang.String toString()
           
 void updateFitness(double value)
          Specifically to override the updateFitness() function from Individual
 
Methods inherited from class simbad.picoevo.core.representation.Individual
compareTo, getFitness, getOwner, getTemplate, isEvaluated, performEvaluation, performInitialisation, setEvaluationFlag, setPopulationSpace, trace
 
Methods inherited from class simbad.picoevo.core.representation.EvolutionObject
addOperator, addOperatorList, getDisplayInformation, getName, getVariationOperator, getVariationOperatorList, getVariationOperatorListSize, performLevelVariations, setName
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Field Detail

genomeID

public int genomeID

genomeNeurons

protected java.util.Vector<Element_NEAT_NGene> genomeNeurons

iIDToNeuron

protected java.util.HashMap<java.lang.Integer,java.lang.Integer> iIDToNeuron

genomeLinks

protected java.util.Vector<Element_NEAT_LGene> genomeLinks

iIDToLink

protected java.util.HashMap<java.lang.Integer,java.lang.Integer> iIDToLink

genomeNetDepth

protected int genomeNetDepth

genomeRawFitness

protected double genomeRawFitness

genomeAdjustedFitness

protected double genomeAdjustedFitness

amountToSpawn

protected double amountToSpawn

inputs

public int inputs

outputs

public int outputs

genomeSpecies

public int genomeSpecies
Constructor Detail

Individual_NEATIndividual

public Individual_NEATIndividual(java.lang.String __name,
                                 Population owner)

Individual_NEATIndividual

public Individual_NEATIndividual(Population owner)

Individual_NEATIndividual

public Individual_NEATIndividual(java.lang.String __name,
                                 Population owner,
                                 int GID,
                                 int depth,
                                 int ins,
                                 int outs,
                                 int species)

Individual_NEATIndividual

public Individual_NEATIndividual(java.lang.String __name,
                                 Population owner,
                                 int GID,
                                 java.util.Vector<Element_NEAT_NGene> nodes,
                                 java.util.Vector<Element_NEAT_LGene> links,
                                 int depth,
                                 int ins,
                                 int outs,
                                 int species)

Individual_NEATIndividual

public Individual_NEATIndividual(Population owner,
                                 int GID,
                                 java.util.Vector<Element_NEAT_NGene> nodes,
                                 java.util.Vector<Element_NEAT_LGene> links,
                                 int depth,
                                 int ins,
                                 int outs,
                                 int species)
Method Detail

correctOwnership

private void correctOwnership()

rebuildIIDLookup

public void rebuildIIDLookup()

displayInformation

public void displayInformation()
Overrides:
displayInformation in class EvolutionObject

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

addNeuron

public void addNeuron(Element_NEAT_NGene n)

getNeuronAt

public Element_NEAT_NGene getNeuronAt(int i)

addLink

public void addLink(Element_NEAT_LGene n)

getLinkAt

public Element_NEAT_LGene getLinkAt(int i)

setNetDepth

public void setNetDepth(int depth)

getNetDepth

public int getNetDepth()

setRawFitness

public void setRawFitness(double fit)

getRawFitness

public double getRawFitness()

setAdjustedFitness

public void setAdjustedFitness(double fit)

getAdjustedFitness

public double getAdjustedFitness()

setAmountToSpawn

public void setAmountToSpawn(double fit)

getAmountToSpawn

public double getAmountToSpawn()

setInputsOutputs

public void setInputsOutputs(int in,
                             int out)

numInputs

public int numInputs()

numOutputs

public int numOutputs()

getLinks

public java.util.Vector<Element_NEAT_LGene> getLinks()

setAllLinks

public void setAllLinks(java.util.Vector<Element_NEAT_LGene> links)

getNeurons

public java.util.Vector<Element_NEAT_NGene> getNeurons()

setAllNeurons

public void setAllNeurons(java.util.Vector<Element_NEAT_NGene> nodes)

getNumNeurons

public int getNumNeurons()

getNumLinks

public int getNumLinks()

getGenomeID

public int getGenomeID()

setGenomeID

public void setGenomeID(int genomeID)

getCompatibilityScore

public double getCompatibilityScore(Individual_NEATIndividual genome)
Calculate the distance between two genomes according to the formula CompatDist = ((c1*#ExcessGenes)/N) + ((c2*#DisjointGenes)/N) + c3*WeightDifference N = number of genes in the larger genome c1,c2,c3 = coefficients to tweak outcome Original Algorithm written by Mat Buckland http://www.ai-junkie.com Ported to this system by Robert Lucas http://www.automatonsadrift.com

Parameters:
genome -
Returns:
double

createPhenotype

public RecurrentNeuralNetwork createPhenotype()

performVariations

public void performVariations()
Specifically to override the performVariations() function from Individual NEAT requires this due to its non standard genome

Overrides:
performVariations in class Individual

setFitness

public void setFitness(double d)
Specifically to override the setFitness() function from Individual

Overrides:
setFitness in class Individual

updateFitness

public void updateFitness(double value)
Specifically to override the updateFitness() function from Individual

Overrides:
updateFitness in class Individual

getElementAt

public Element getElementAt(int index)
Specifically to override the getElementAt() function from Individual If the nodes and links were stored in an individual vector we order +

Overrides:
getElementAt in class Individual

getElementListSize

public int getElementListSize()
Specifically to override the getElementListSize() function from Individual

Overrides:
getElementListSize in class Individual

addElement

public void addElement(Element __element)
It is required to override this by definition but the NEAT implementation will not use this specific function

Specified by:
addElement in class Individual

clone

public java.lang.Object clone()
Overrides:
clone in class Individual

sort

public void sort()

compareTo

public int compareTo(Individual_NEATIndividual _o)