com.anji.polebalance
Class DoublePoleBalanceFitnessFunction

java.lang.Object
  extended bycom.anji.polebalance.DoublePoleBalanceFitnessFunction
All Implemented Interfaces:
BulkFitnessFunction, Configurable, java.io.Serializable

public class DoublePoleBalanceFitnessFunction
extends java.lang.Object
implements BulkFitnessFunction, Configurable

This code is a port from Colin Green's SharpNEAT pole balancing code, which in turn is a port from Ken Stanley's NEAT code.

Author:
Derek James
See Also:
Serialized Form

Constructor Summary
DoublePoleBalanceFitnessFunction()
           
 
Method Summary
 void enableDisplay()
          enable GUI display of pole balancing
 void evaluate(Chromosome c)
          Evaluate chromosome and set fitness.
 void evaluate(java.util.List genotypes)
          Calculates and sets the fitness values on each of the given Chromosomes via their setFitnessValue() method.
 int getMaxFitnessValue()
           
 void init(Properties props)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DoublePoleBalanceFitnessFunction

public DoublePoleBalanceFitnessFunction()
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)

evaluate

public void evaluate(java.util.List genotypes)
Description copied from interface: BulkFitnessFunction
Calculates and sets the fitness values on each of the given Chromosomes via their setFitnessValue() method.

Specified by:
evaluate in interface BulkFitnessFunction
Parameters:
genotypes - List contains Chromosome objects for which the fitness values must be computed and set.
See Also:
BulkFitnessFunction.evaluate(java.util.List), IdentifyImageFitnessFunction.evaluate(Chromosome)

evaluate

public void evaluate(Chromosome c)
Evaluate chromosome and set fitness.

Parameters:
c -

getMaxFitnessValue

public int getMaxFitnessValue()
Specified by:
getMaxFitnessValue in interface BulkFitnessFunction
Returns:
int maximum possible fitness value this function will return
See Also:
BulkFitnessFunction.getMaxFitnessValue()

enableDisplay

public void enableDisplay()
enable GUI display of pole balancing