com.anji.neat
Class AddNeuronMutationOperator

java.lang.Object
  extended byorg.jgap.MutationOperator
      extended bycom.anji.neat.AddNeuronMutationOperator
All Implemented Interfaces:
Configurable

public class AddNeuronMutationOperator
extends MutationOperator
implements Configurable

Implements NEAT add node mutation inspired by Evolving Neural Networks through Augmenting Topologies . In ANJI, mutation rate refers to the likelihood of a new node being created on any existing connection. In traditional NEAT, it is the likelihood of a chromosome experiencing a mutation, and each chromosome can not have more than one topological mutation per generation.

Author:
Philip Tucker

Field Summary
static java.lang.String ADD_NEURON_MUTATE_RATE_KEY
          properties key, add neuron mutation rate
static float DEFAULT_MUTATE_RATE
          default mutation rate
 
Constructor Summary
AddNeuronMutationOperator()
           
AddNeuronMutationOperator(float newMutationRate)
           
 
Method Summary
 boolean addNeuronAtConnection(NeatConfiguration config, java.util.Map neurons, ConnectionAllele oldConnectAllele, java.util.Set allelesToAdd, java.util.Set allelesToRemove)
           
 void init(Properties props)
           
protected  void mutate(Configuration jgapConfig, ChromosomeMaterial target, java.util.Set allelesToAdd, java.util.Set allelesToRemove)
          Adds connections according to NEAT add node mutation.
 
Methods inherited from class org.jgap.MutationOperator
doesMutationOccur, doesMutationOccur, getMutationRate, mutate, numMutations, setMutationRate, updateMaterial
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ADD_NEURON_MUTATE_RATE_KEY

public static final java.lang.String ADD_NEURON_MUTATE_RATE_KEY
properties key, add neuron mutation rate

See Also:
Constant Field Values

DEFAULT_MUTATE_RATE

public static final float DEFAULT_MUTATE_RATE
default mutation rate

See Also:
Constant Field Values
Constructor Detail

AddNeuronMutationOperator

public AddNeuronMutationOperator()
See Also:
AddNeuronMutationOperator(float)

AddNeuronMutationOperator

public AddNeuronMutationOperator(float newMutationRate)
See Also:
MutationOperator.MutationOperator(float)
Method Detail

init

public void init(Properties props)
          throws java.lang.Exception
Specified by:
init in interface Configurable
Parameters:
props - configuration parameters
Throws:
java.lang.Exception
See Also:
Configurable.init(com.anji.util.Properties)

mutate

protected void mutate(Configuration jgapConfig,
                      ChromosomeMaterial target,
                      java.util.Set allelesToAdd,
                      java.util.Set allelesToRemove)
Adds connections according to NEAT add node mutation.

Specified by:
mutate in class MutationOperator
Parameters:
jgapConfig -
target - chromosome material before mutation
allelesToAdd - alleles added by this mutation, Set contains Allele objects
allelesToRemove - alleles removed by this mutation, Set contains Allele objects
See Also:
MutationOperator.mutate(org.jgap.Configuration, org.jgap.ChromosomeMaterial, java.util.Set, java.util.Set)

addNeuronAtConnection

public boolean addNeuronAtConnection(NeatConfiguration config,
                                     java.util.Map neurons,
                                     ConnectionAllele oldConnectAllele,
                                     java.util.Set allelesToAdd,
                                     java.util.Set allelesToRemove)
Parameters:
config -
neurons - Map contains NeuronAllele objects
oldConnectAllele - connection allele to be replaced by neuron
allelesToAdd - Set contains Allele objects
allelesToRemove - Set contains Allele objects
Returns:
true iff neuron added