com.anji.neat
Class NeatTargetFitnessFunction

java.lang.Object
  extended bycom.anji.integration.TargetFitnessFunction
      extended bycom.anji.neat.NeatTargetFitnessFunction
All Implemented Interfaces:
BulkFitnessFunction, Configurable, java.io.Serializable

public class NeatTargetFitnessFunction
extends TargetFitnessFunction

Fitness function where error is subtracted from max fitness, then squared. Fitness is skewed such that max fitness is MAX_FITNESS. See calculateErrorFitness() for details. This mimics the error function used in Evolving Neural Networks through Augmenting Topologies .

Author:
Philip Tucker
See Also:
TargetFitnessFunction, Serialized Form

Field Summary
 
Fields inherited from class com.anji.integration.TargetFitnessFunction
STIMULI_FILE_NAME_KEY, TARGETS_FILE_NAME_KEY
 
Constructor Summary
NeatTargetFitnessFunction()
           
 
Method Summary
protected  int calculateErrorFitness(double[][] responses, double minResponse, double maxResponse)
          Subtract responses from targets, sum all differences, subtract from max fitness, and square result.
 void init(Properties newProps)
          See Parameter Details for specific property settings.
 
Methods inherited from class com.anji.integration.TargetFitnessFunction
evaluate, getMaxFitnessValue, getStimuli, getTargetRange, getTargets, setMaxFitnessValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NeatTargetFitnessFunction

public NeatTargetFitnessFunction()
Method Detail

init

public void init(Properties newProps)
See Parameter Details for specific property settings.

Specified by:
init in interface Configurable
Overrides:
init in class TargetFitnessFunction
Parameters:
newProps - configuration parameters

calculateErrorFitness

protected int calculateErrorFitness(double[][] responses,
                                    double minResponse,
                                    double maxResponse)
Subtract responses from targets, sum all differences, subtract from max fitness, and square result.

Specified by:
calculateErrorFitness in class TargetFitnessFunction
Parameters:
responses - output top be compared to targets
minResponse -
maxResponse -
Returns:
result of calculation
See Also:
TargetFitnessFunction.evaluate(List)