com.anji.neat
Class WeightMutationOperator

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

public class WeightMutationOperator
extends MutationOperator
implements Configurable

Implements NEAT perturb connection weight mutation according to Evolving Neural Networks through Augmenting Topologies .

Author:
Philip Tucker

Field Summary
static float DEFAULT_MUTATE_RATE
          default mutation rate
static float DEFAULT_STD_DEV
          default standard deviation for weight delta
 
Constructor Summary
WeightMutationOperator()
           
WeightMutationOperator(float newMutationRate)
           
WeightMutationOperator(float newMutationRate, float newStdDev)
           
 
Method Summary
 float getStdDev()
           
 void init(Properties props)
           
protected  void mutate(Configuration jgapConfig, ChromosomeMaterial target, java.util.Set genesToAdd, java.util.Set genesToRemove)
          Removes from genesToAdd and adds to genesToRemove all connection genes that are modified.
 
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

DEFAULT_MUTATE_RATE

public static final float DEFAULT_MUTATE_RATE
default mutation rate

See Also:
Constant Field Values

DEFAULT_STD_DEV

public static final float DEFAULT_STD_DEV
default standard deviation for weight delta

See Also:
Constant Field Values
Constructor Detail

WeightMutationOperator

public WeightMutationOperator()
See Also:
MutationOperator.MutationOperator(float)

WeightMutationOperator

public WeightMutationOperator(float newMutationRate)
Parameters:
newMutationRate -
See Also:
WeightMutationOperator(float, float)

WeightMutationOperator

public WeightMutationOperator(float newMutationRate,
                              float newStdDev)
Parameters:
newMutationRate -
newStdDev -
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 genesToAdd,
                      java.util.Set genesToRemove)
Removes from genesToAdd and adds to genesToRemove all connection genes that are modified.

Specified by:
mutate in class MutationOperator
Parameters:
jgapConfig - The current active genetic configuration.
target - chromosome material to mutate
genesToAdd - Set contains Gene objects
genesToRemove - Set contains Gene objects

getStdDev

public float getStdDev()
Returns:
standard deviation for weight delta