com.anji.neat
Class RemoveConnectionMutationOperator
java.lang.Object
org.jgap.MutationOperator
com.anji.neat.RemoveConnectionMutationOperator
- All Implemented Interfaces:
- Configurable
- public class RemoveConnectionMutationOperator
- extends MutationOperator
- implements Configurable
Implements remove connection mutation, using one of 3 strategies:
SKEWED - Probability of connection being removed ranges from 0 (if weight magnitude >= max
weight removed) to mutation rate (if weight is 0)
ALL - All connections have equal likelihood of being removed, regardless of weight.
SMALL - Mutation occurs according to James and Tucker's "A Comparative Analysis of
Simplification and Complexification in the Evolution of Neural Network Topologies" paper for
GECCO 2004 .
- Author:
- Philip Tucker
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
REMOVE_CONN_MAX_WEIGHT_KEY
public static final java.lang.String REMOVE_CONN_MAX_WEIGHT_KEY
- properties key, max weight that can be removed by remove connection mutation
- See Also:
- Constant Field Values
DEFAULT_MAX_WEIGHT_REMOVED
public static final float DEFAULT_MAX_WEIGHT_REMOVED
- default maximum weight a connection can have and still be removed
- See Also:
- Constant Field Values
DEFAULT_MUTATE_RATE
public static final float DEFAULT_MUTATE_RATE
- default mutation rate
- See Also:
- Constant Field Values
RemoveConnectionMutationOperator
public RemoveConnectionMutationOperator()
- See Also:
RemoveConnectionMutationOperator(float)
RemoveConnectionMutationOperator
public RemoveConnectionMutationOperator(float aMutationRate)
- See Also:
MutationOperator.MutationOperator(float)
RemoveConnectionMutationOperator
public RemoveConnectionMutationOperator(float aMutationRate,
float aMaxWeightRemoved)
- Parameters:
aMutationRate
- aMaxWeightRemoved
- weights larger than this can not be removed- See Also:
MutationOperator.MutationOperator(float)
RemoveConnectionMutationOperator
public RemoveConnectionMutationOperator(float aMutationRate,
float aMaxWeightRemoved,
RemoveConnectionMutationOperator.Strategy aStrategy)
- Parameters:
aMutationRate
- aMaxWeightRemoved
- weights larger than this can not be removedaStrategy
- - See Also:
MutationOperator.MutationOperator(float)
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)
- Removes, in ascending order of weight magnitude, those connections whose weight magnitude is
less than the maximum weight to be removed. Maximum number of connections that can be removed
is determined by mutation rate.
- Specified by:
mutate
in class MutationOperator
- Parameters:
jgapConfig
- must be NeatConfiguration
target
- chromosome material to mutateallelesToAdd
- Set
contains Allele
objectsallelesToRemove
- Set
contains Allele
objects- See Also:
MutationOperator.mutate(org.jgap.Configuration, org.jgap.ChromosomeMaterial,
java.util.Set, java.util.Set)
getMaxWeightRemoved
public float getMaxWeightRemoved()
- Returns:
- float threshold above which no weight is removed