com.anji.neat
Class AddConnectionMutationOperator

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

public class AddConnectionMutationOperator
extends MutationOperator
implements Configurable

Implements NEAT add connection mutation inspired by Evolving Neural Networks through Augmenting Topologies . In ANJI, mutation rate refers to the likelihood of any candidate new mutation (i.e., any 2 unconnected nodes, not counting those that would create a loop if recurrency is disabled) occurring. 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_CONN_MUTATE_RATE_KEY
          properties key, add connection mutation rate
static float DEFAULT_MUTATE_RATE
          default mutation rate
 
Constructor Summary
AddConnectionMutationOperator()
           
AddConnectionMutationOperator(float newMutationRate)
           
AddConnectionMutationOperator(float aMutationRate, RecurrencyPolicy aPolicy)
          Creates new operator with specified mutation rate and recurrency policy.
AddConnectionMutationOperator(RecurrencyPolicy aPolicy)
          Creates new operator with specified recurrency policy.
 
Method Summary
 void addSingleConnection(NeatConfiguration config, java.util.List neuronList, java.util.SortedMap conns, java.util.Set allelesToAdd)
          Given the collections of neurons and connections, returns the new connection that should be added.
 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 connection 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_CONN_MUTATE_RATE_KEY

public static final java.lang.String ADD_CONN_MUTATE_RATE_KEY
properties key, add connection 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

AddConnectionMutationOperator

public AddConnectionMutationOperator()
See Also:
AddConnectionMutationOperator(float)

AddConnectionMutationOperator

public AddConnectionMutationOperator(float newMutationRate)
Parameters:
newMutationRate -
See Also:
AddConnectionMutationOperator(float, RecurrencyPolicy)

AddConnectionMutationOperator

public AddConnectionMutationOperator(RecurrencyPolicy aPolicy)
Creates new operator with specified recurrency policy.

Parameters:
aPolicy -
See Also:
RecurrencyPolicy

AddConnectionMutationOperator

public AddConnectionMutationOperator(float aMutationRate,
                                     RecurrencyPolicy aPolicy)
Creates new operator with specified mutation rate and recurrency policy.

Parameters:
aMutationRate -
aPolicy -
See Also:
RecurrencyPolicy
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 connection mutation.

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

addSingleConnection

public void addSingleConnection(NeatConfiguration config,
                                java.util.List neuronList,
                                java.util.SortedMap conns,
                                java.util.Set allelesToAdd)
Given the collections of neurons and connections, returns the new connection that should be added.

Parameters:
config -
neuronList - List contains NeuronAllele objects
conns - SortedMap contains ConnectionAllele objects; contains new connection allele added
allelesToAdd - Set contains Allele objects; contains new connection allele added TOTO - allele (callers)