com.anji.neat
Class NeuronAllele

java.lang.Object
  extended byorg.jgap.Allele
      extended bycom.anji.neat.NeuronAllele
All Implemented Interfaces:
java.lang.Comparable

public class NeuronAllele
extends Allele

Gene corresponding to NEAT node gene according to Evolving Neural Networks through Augmenting Topologies

Author:
Philip Tucker

Constructor Summary
NeuronAllele(NeuronGene aNeuronGene)
           
 
Method Summary
 Allele cloneAllele()
           
 double distance(Allele aTarget)
           
 ActivationFunctionType getActivationType()
           
 NeuronType getType()
           
 boolean isType(NeuronType aType)
           
 void setToRandomValue(java.util.Random a_numberGenerator)
          Sets the value of this Gene to a random legal value for the implementation.
 
Methods inherited from class org.jgap.Allele
compareTo, equals, getGene, getGenes, getInnovationId, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NeuronAllele

public NeuronAllele(NeuronGene aNeuronGene)
Parameters:
aNeuronGene -
Method Detail

cloneAllele

public Allele cloneAllele()
Specified by:
cloneAllele in class Allele
Returns:
Gene clone of this object
See Also:
Allele.cloneAllele()

setToRandomValue

public void setToRandomValue(java.util.Random a_numberGenerator)
Description copied from class: Allele
Sets the value of this Gene to a random legal value for the implementation. This method exists for the benefit of mutation and other operations that simply desire to randomize the value of a gene.

Specified by:
setToRandomValue in class Allele
Parameters:
a_numberGenerator - The random number generator that should be used to create any random values. It's important to use this generator to maintain the user's flexibility to configure the genetic engine to use the random number generator of their choice.
See Also:
Allele.setToRandomValue(Random)

distance

public double distance(Allele aTarget)
Specified by:
distance in class Allele
Parameters:
aTarget - should be NeuronAllele with same gene TODO - activation type and slope
Returns:
positive distance between genes, where a value closer to 0 represents more similar genes; used in computing distance between chromosomes, which in turn is used to compute speciation compatibility.
See Also:
Allele.distance(org.jgap.Allele)

getType

public NeuronType getType()
Returns:
neuron type
See Also:
NeuronGene#getType()

isType

public boolean isType(NeuronType aType)
Parameters:
aType -
Returns:
true if aType matches
See Also:
NeuronGene#isType(NeuronType)

getActivationType

public ActivationFunctionType getActivationType()
Returns:
activation type
See Also:
NeuronGene#getActivationType()