com.anji.neat
Class NeatConfiguration

java.lang.Object
  extended byorg.jgap.Configuration
      extended bycom.anji.neat.NeatConfiguration
All Implemented Interfaces:
java.io.Serializable

public class NeatConfiguration
extends Configuration

Extension of JGAP configuration with NEAT-specific features added.

Author:
Philip Tucker
See Also:
Serialized Form

Field Summary
static java.lang.String CHROM_COMPAT_COMMON_COEFF_KEY
          properties key, speciation chromosome compatibility common coefficient
static java.lang.String CHROM_COMPAT_DISJOINT_COEFF_KEY
          properties key, speciation chromosome compatibility disjoint coefficient
static java.lang.String CHROM_COMPAT_EXCESS_COEFF_KEY
          properties key, speciation chromosome compatibility excess coefficient
static int DEFAULT_POPUL_SIZE
          default population size
static float DEFAULT_SURVIVAL_RATE
          default survival rate
static java.lang.String ELITISM_KEY
          properties key, elitism enabled
static java.lang.String ELITISM_MIN_SPECIE_SIZE_KEY
          properties key, minimum size a specie must be to produce an elite member
static java.lang.String ID_FACTORY_KEY
          properties key, file in which unique ID sequence number is stored
static java.lang.String INITIAL_TOPOLOGY_ACTIVATION_INPUT_KEY
          properties key, activation function type of input neurons
static java.lang.String INITIAL_TOPOLOGY_ACTIVATION_KEY
          properties key, activation function type of neurons
static java.lang.String INITIAL_TOPOLOGY_ACTIVATION_OUTPUT_KEY
          properties key, activation function type of output neurons
static java.lang.String INITIAL_TOPOLOGY_FULLY_CONNECTED_KEY
          properties key, enable fully connected initial topologies
static java.lang.String INITIAL_TOPOLOGY_NUM_HIDDEN_NEURONS_KEY
          properties key, number of hidden neurons in initial topology
static java.lang.String POPUL_SIZE_KEY
          properties key, population size
static java.lang.String RESPONSE_SIZE_KEY
          properties key, dimension of neural net response
static java.lang.String SPECIATION_THRESHOLD_KEY
          properties key, speciation threshold
static java.lang.String STIMULUS_SIZE_KEY
          properties key, dimension of neural net stimulus
static java.lang.String SURVIVAL_RATE_KEY
          properties key, survival rate
static java.lang.String TOPOLOGY_MUTATION_CLASSIC_KEY
          properties key, topology mutation type; if true, use "classic" method where at most a single topological mutation occurs per generation per individual
static java.lang.String WEIGHT_MAX_KEY
          properties key, maximum connection weight
static java.lang.String WEIGHT_MIN_KEY
          properties key, minimum connection weight
static java.lang.String WEIGHTED_SELECTOR_KEY
          properties key, enable weighted selection process
 
Constructor Summary
NeatConfiguration(Properties newProps)
          See Parameter Details for specific property settings.
 
Method Summary
 CloneReproductionOperator getCloneOperator()
           
 NeatCrossoverReproductionOperator getCrossoverOperator()
           
 double getMaxConnectionWeight()
           
 double getMinConnectionWeight()
           
 void load()
          Load from persistence.
 void logIdMaps(org.apache.log4j.Logger aLogger, org.apache.log4j.Priority pri)
          log stats for id maps
 ConnectionAllele newConnectionAllele(java.lang.Long srcNeuronId, java.lang.Long destNeuronId)
          factory method to construct new connection allele from neuron srcNeuronId to neuron destNeuronId according to NEAT add connection mutation; if a previous mutation has occurred adding a connection between srcNeuronId and destNeuronId, returns connection with that id; otherwise, new innovation id
 NeuronAllele newNeuronAllele(java.lang.Long connectionId)
          Factory method to construct new neuron allele which has replaced connection connectionId according to NEAT add neuron mutation.
 NeuronAllele newNeuronAllele(NeuronType type)
          factory method to construct new neuron allele with unique innovation ID of specified type
 void store()
          Store to persistence.
 
Methods inherited from class org.jgap.Configuration
addMutationOperator, addReproductionOperator, getBulkFitnessFunction, getEventManager, getFitnessFunction, getIdFactory, getMutationOperators, getNaturalSelector, getPopulationSize, getRandomGenerator, getReproductionOperators, getSampleChromosomeMaterial, getSpeciationParms, isLocked, lockSettings, nextChromosomeId, nextInnovationId, setBulkFitnessFunction, setEventManager, setFitnessFunction, setIdFactory, setNaturalSelector, setPopulationSize, setRandomGenerator, setSampleChromosomeMaterial, verifyChangesAllowed, verifyStateIsValid
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ID_FACTORY_KEY

public static final java.lang.String ID_FACTORY_KEY
properties key, file in which unique ID sequence number is stored

See Also:
Constant Field Values

DEFAULT_SURVIVAL_RATE

public static final float DEFAULT_SURVIVAL_RATE
default survival rate

See Also:
Constant Field Values

DEFAULT_POPUL_SIZE

public static final int DEFAULT_POPUL_SIZE
default population size

See Also:
Constant Field Values

STIMULUS_SIZE_KEY

public static final java.lang.String STIMULUS_SIZE_KEY
properties key, dimension of neural net stimulus

See Also:
Constant Field Values

RESPONSE_SIZE_KEY

public static final java.lang.String RESPONSE_SIZE_KEY
properties key, dimension of neural net response

See Also:
Constant Field Values

SURVIVAL_RATE_KEY

public static final java.lang.String SURVIVAL_RATE_KEY
properties key, survival rate

See Also:
Constant Field Values

TOPOLOGY_MUTATION_CLASSIC_KEY

public static final java.lang.String TOPOLOGY_MUTATION_CLASSIC_KEY
properties key, topology mutation type; if true, use "classic" method where at most a single topological mutation occurs per generation per individual

See Also:
Constant Field Values

WEIGHT_MAX_KEY

public static final java.lang.String WEIGHT_MAX_KEY
properties key, maximum connection weight

See Also:
Constant Field Values

WEIGHT_MIN_KEY

public static final java.lang.String WEIGHT_MIN_KEY
properties key, minimum connection weight

See Also:
Constant Field Values

POPUL_SIZE_KEY

public static final java.lang.String POPUL_SIZE_KEY
properties key, population size

See Also:
Constant Field Values

CHROM_COMPAT_EXCESS_COEFF_KEY

public static final java.lang.String CHROM_COMPAT_EXCESS_COEFF_KEY
properties key, speciation chromosome compatibility excess coefficient

See Also:
Constant Field Values

CHROM_COMPAT_DISJOINT_COEFF_KEY

public static final java.lang.String CHROM_COMPAT_DISJOINT_COEFF_KEY
properties key, speciation chromosome compatibility disjoint coefficient

See Also:
Constant Field Values

CHROM_COMPAT_COMMON_COEFF_KEY

public static final java.lang.String CHROM_COMPAT_COMMON_COEFF_KEY
properties key, speciation chromosome compatibility common coefficient

See Also:
Constant Field Values

SPECIATION_THRESHOLD_KEY

public static final java.lang.String SPECIATION_THRESHOLD_KEY
properties key, speciation threshold

See Also:
Constant Field Values

ELITISM_KEY

public static final java.lang.String ELITISM_KEY
properties key, elitism enabled

See Also:
Constant Field Values

ELITISM_MIN_SPECIE_SIZE_KEY

public static final java.lang.String ELITISM_MIN_SPECIE_SIZE_KEY
properties key, minimum size a specie must be to produce an elite member

See Also:
Constant Field Values

WEIGHTED_SELECTOR_KEY

public static final java.lang.String WEIGHTED_SELECTOR_KEY
properties key, enable weighted selection process

See Also:
Constant Field Values

INITIAL_TOPOLOGY_FULLY_CONNECTED_KEY

public static final java.lang.String INITIAL_TOPOLOGY_FULLY_CONNECTED_KEY
properties key, enable fully connected initial topologies

See Also:
Constant Field Values

INITIAL_TOPOLOGY_NUM_HIDDEN_NEURONS_KEY

public static final java.lang.String INITIAL_TOPOLOGY_NUM_HIDDEN_NEURONS_KEY
properties key, number of hidden neurons in initial topology

See Also:
Constant Field Values

INITIAL_TOPOLOGY_ACTIVATION_KEY

public static final java.lang.String INITIAL_TOPOLOGY_ACTIVATION_KEY
properties key, activation function type of neurons

See Also:
Constant Field Values

INITIAL_TOPOLOGY_ACTIVATION_INPUT_KEY

public static final java.lang.String INITIAL_TOPOLOGY_ACTIVATION_INPUT_KEY
properties key, activation function type of input neurons

See Also:
Constant Field Values

INITIAL_TOPOLOGY_ACTIVATION_OUTPUT_KEY

public static final java.lang.String INITIAL_TOPOLOGY_ACTIVATION_OUTPUT_KEY
properties key, activation function type of output neurons

See Also:
Constant Field Values
Constructor Detail

NeatConfiguration

public NeatConfiguration(Properties newProps)
                  throws InvalidConfigurationException
See Parameter Details for specific property settings.

Parameters:
newProps -
Throws:
InvalidConfigurationException
See Also:
NeatConfiguration#init(Properties)
Method Detail

newNeuronAllele

public NeuronAllele newNeuronAllele(NeuronType type)
factory method to construct new neuron allele with unique innovation ID of specified type

Parameters:
type -
Returns:
NeuronAllele

newNeuronAllele

public NeuronAllele newNeuronAllele(java.lang.Long connectionId)
Factory method to construct new neuron allele which has replaced connection connectionId according to NEAT add neuron mutation. If a previous mutation has occurred adding a neuron on connection connectionId, returns a neuron with that id - otherwise, a new id.

Parameters:
connectionId -
Returns:
NeuronAllele

newConnectionAllele

public ConnectionAllele newConnectionAllele(java.lang.Long srcNeuronId,
                                            java.lang.Long destNeuronId)
factory method to construct new connection allele from neuron srcNeuronId to neuron destNeuronId according to NEAT add connection mutation; if a previous mutation has occurred adding a connection between srcNeuronId and destNeuronId, returns connection with that id; otherwise, new innovation id

Parameters:
srcNeuronId -
destNeuronId -
Returns:
ConnectionAllele

getCloneOperator

public CloneReproductionOperator getCloneOperator()
Returns:
clone reproduction operator used to create mutated asexual offspring

getCrossoverOperator

public NeatCrossoverReproductionOperator getCrossoverOperator()
Returns:
crossover reproduction operator used to create mutated sexual offspring

getMaxConnectionWeight

public double getMaxConnectionWeight()
Returns:
maximum conneciton weight

getMinConnectionWeight

public double getMinConnectionWeight()
Returns:
minimum conneciton weight

load

public void load()
          throws InvalidConfigurationException
Load from persistence.

Throws:
InvalidConfigurationException

store

public void store()
           throws InvalidConfigurationException
Store to persistence.

Throws:
InvalidConfigurationException

logIdMaps

public void logIdMaps(org.apache.log4j.Logger aLogger,
                      org.apache.log4j.Priority pri)
log stats for id maps

Parameters:
aLogger -
pri - priority