org.encog.neural.neat.training
Class NEATGenome

java.lang.Object
  extended by org.encog.ml.ea.genome.BasicGenome
      extended by org.encog.neural.neat.training.NEATGenome
All Implemented Interfaces:
Serializable, Cloneable, Genome, MLMethod
Direct Known Subclasses:
HyperNEATGenome

public class NEATGenome
extends BasicGenome
implements Cloneable, Serializable

Implements a NEAT genome. This is a "blueprint" for creating a neural network. ----------------------------------------------------------------------------- http://www.cs.ucf.edu/~kstanley/ Encog's NEAT implementation was drawn from the following three Journal Articles. For more complete BibTeX sources, see NEATNetwork.java. Evolving Neural Networks Through Augmenting Topologies Generating Large-Scale Neural Networks Through Discovering Geometric Regularities Automatic feature selection in neuroevolution

See Also:
Serialized Form

Constructor Summary
NEATGenome()
          Empty constructor for persistence.
NEATGenome(List<NEATNeuronGene> neurons, List<NEATLinkGene> links, int inputCount, int outputCount)
          Create a NEAT gnome.
NEATGenome(NEATGenome other)
          Construct a genome by copying another.
NEATGenome(Random rnd, NEATPopulation pop, int inputCount, int outputCount, double connectionDensity)
          Create a new genome with the specified connection density.
 
Method Summary
 void copy(Genome source)
          Copy from the specified genome into this one.
 NEATNeuronGene findNeuron(long nodeID)
          Find the neuron with the specified nodeID.
 int getInputCount()
           
 List<NEATLinkGene> getLinksChromosome()
           
 int getNetworkDepth()
           
 List<NEATNeuronGene> getNeuronsChromosome()
           
 int getNumGenes()
           
 int getOutputCount()
           
 void setInputCount(int inputCount)
           
 void setNetworkDepth(int networkDepth)
           
 void setOutputCount(int outputCount)
           
 int size()
          
 void sortGenes()
          Sort the genes.
 String toString()
          
 void validate()
          Validate the structure of this genome.
 
Methods inherited from class org.encog.ml.ea.genome.BasicGenome
getAdjustedScore, getBirthGeneration, getPopulation, getScore, getSpecies, setAdjustedScore, setBirthGeneration, setPopulation, setScore, setSpecies
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NEATGenome

public NEATGenome(NEATGenome other)
Construct a genome by copying another.

Parameters:
other - The other genome.

NEATGenome

public NEATGenome(List<NEATNeuronGene> neurons,
                  List<NEATLinkGene> links,
                  int inputCount,
                  int outputCount)
Create a NEAT gnome. Neuron genes will be added by reference, links will be copied.

Parameters:
neurons - The neurons to create.
links - The links to create.
inputCount - The input count.
outputCount - The output count.

NEATGenome

public NEATGenome(Random rnd,
                  NEATPopulation pop,
                  int inputCount,
                  int outputCount,
                  double connectionDensity)
Create a new genome with the specified connection density. This constructor is typically used to create the initial population.

Parameters:
rnd - Random number generator.
pop - The population.
inputCount - The input count.
outputCount - The output count.
connectionDensity - The connection density.

NEATGenome

public NEATGenome()
Empty constructor for persistence.

Method Detail

getInputCount

public int getInputCount()
Returns:
The number of input neurons.

getNetworkDepth

public int getNetworkDepth()
Returns:
The network depth.

getNumGenes

public int getNumGenes()
Returns:
The number of genes in the links chromosome.

getOutputCount

public int getOutputCount()
Returns:
The output count.

setNetworkDepth

public void setNetworkDepth(int networkDepth)
Parameters:
networkDepth - the networkDepth to set

sortGenes

public void sortGenes()
Sort the genes.


getLinksChromosome

public List<NEATLinkGene> getLinksChromosome()
Returns:
the linksChromosome

getNeuronsChromosome

public List<NEATNeuronGene> getNeuronsChromosome()
Returns:
the neuronsChromosome

setInputCount

public void setInputCount(int inputCount)
Parameters:
inputCount - the inputCount to set

setOutputCount

public void setOutputCount(int outputCount)
Parameters:
outputCount - the outputCount to set

validate

public void validate()
Validate the structure of this genome.


copy

public void copy(Genome source)
Copy from the specified genome into this one.

Specified by:
copy in interface Genome
Parameters:
source - The source genome.

size

public int size()

Specified by:
size in interface Genome
Returns:
Return the size of this genome. This size is a relative number that indicates the complexity of the genome.

findNeuron

public NEATNeuronGene findNeuron(long nodeID)
Find the neuron with the specified nodeID.

Parameters:
nodeID - The nodeID to look for.
Returns:
The neuron, if found, otherwise null.

toString

public String toString()
Description copied from class: BasicGenome

Overrides:
toString in class BasicGenome


Copyright © 2014. All Rights Reserved.