com.anji.neat
Class ConnectionAllele

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

public class ConnectionAllele
extends Allele

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

Author:
Philip Tucker

Field Summary
static double DEFAULT_WEIGHT
          default connection weight
 
Constructor Summary
ConnectionAllele(ConnectionGene aConnectionGene)
           
 
Method Summary
 Allele cloneAllele()
           
 double distance(Allele target)
           
 java.lang.Long getDestNeuronId()
           
 java.lang.Long getSrcNeuronId()
           
 double getWeight()
           
 void setToRandomValue(java.util.Random a_numberGenerator)
          set weight to random value distributed uniformly between MIN_INIT_WEIGHT and MAX_INIT_WEIGHT
 void setWeight(double aWeight)
           
 java.lang.String toString()
           
 
Methods inherited from class org.jgap.Allele
compareTo, equals, getGene, getGenes, getInnovationId, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_WEIGHT

public static final double DEFAULT_WEIGHT
default connection weight

See Also:
Constant Field Values
Constructor Detail

ConnectionAllele

public ConnectionAllele(ConnectionGene aConnectionGene)
Parameters:
aConnectionGene -
Method Detail

toString

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

cloneAllele

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

distance

public double distance(Allele target)
Specified by:
distance in class Allele
Parameters:
target - should be ConnectionAllele with same gene
Returns:
double compatibility distance based on weight; always positive
See Also:
Allele.distance(Allele)

setToRandomValue

public void setToRandomValue(java.util.Random a_numberGenerator)
set weight to random value distributed uniformly between MIN_INIT_WEIGHT and MAX_INIT_WEIGHT

Specified by:
setToRandomValue in class Allele
Parameters:
a_numberGenerator -

getWeight

public double getWeight()
Returns:
connection weight

setWeight

public void setWeight(double aWeight)
Parameters:
aWeight - new connection weight

getSrcNeuronId

public java.lang.Long getSrcNeuronId()
Returns:
src neuron ID
See Also:
ConnectionGene.getSrcNeuronId()

getDestNeuronId

public java.lang.Long getDestNeuronId()
Returns:
dest neuron ID
See Also:
ConnectionGene.getDestNeuronId()