com.rubecula.darwin.domain.fitness
Class FitnessFunction_Normal

java.lang.Object
  extended by com.rubecula.darwin.foundation.Function_
      extended by com.rubecula.darwin.domain.fitness.FitnessFunction_
          extended by com.rubecula.darwin.domain.fitness.FitnessFunction_Normal
All Implemented Interfaces:
FitnessFunction, Function, com.rubecula.jexpression.EvalExpression, com.rubecula.jexpression.EvalExpressionMutable, com.rubecula.jexpression.Valuable, net.sf.tostring0.Identifiable

public class FitnessFunction_Normal
extends FitnessFunction_

Lifespan: permanent. This class implements an approximate normal distribution. An alternative implementation requires the use of the Apache commons math library.

Author:
Robin Hillyard

Field Summary
 
Fields inherited from class com.rubecula.darwin.foundation.Function_
evaluator, LOG
 
Fields inherited from interface com.rubecula.darwin.domain.helper.FitnessFunction
PREFIX_VAR_RPN, VAR_SHAPE_FACTOR, VAR_TARGET, VAR_VALUE
 
Constructor Summary
FitnessFunction_Normal()
           
FitnessFunction_Normal(com.rubecula.jexpression.Evaluator evaluator)
           
 
Method Summary
 java.lang.String getIdentifier()
           
protected  double standardFunction(java.lang.Object... arguments)
           
protected  java.lang.CharSequence[] standardFunctionTokens(com.rubecula.jexpression.Notation notation)
           
 
Methods inherited from class com.rubecula.darwin.domain.fitness.FitnessFunction_
getFitness
 
Methods inherited from class com.rubecula.darwin.foundation.Function_
addListener, addSymbol, equals, evaluate, getErrorInfo, getEvaluator, getExpression, getExpressionMap, getExpressionTerms, getValue, hashCode, isDifferent, isMutable, normalDistributionDensityFunction, normalDistributionDensityFunctionScaled, onFunctionChange, removeVariable, reset, setEvaluator, setExpression, setExpression
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FitnessFunction_Normal

public FitnessFunction_Normal()

FitnessFunction_Normal

public FitnessFunction_Normal(com.rubecula.jexpression.Evaluator evaluator)
Parameters:
evaluator -
Method Detail

getIdentifier

public java.lang.String getIdentifier()
Returns:
"Fitness function: normal distribution"
See Also:
Identifiable.getIdentifier()

standardFunction

protected double standardFunction(java.lang.Object... arguments)
                           throws FunctionException
Specified by:
standardFunction in class Function_
Parameters:
arguments - these arguments must be, in order,
  1. Double: value
  2. Double: mean
  3. Double: standard deviation

Note that we do not protect against cast exceptions.
Returns:
result of invoking Function_.normalDistributionDensityFunction(double, double, double) .
Throws:
FunctionException - XXX
See Also:
Function_.standardFunction(Object[])

standardFunctionTokens

protected java.lang.CharSequence[] standardFunctionTokens(com.rubecula.jexpression.Notation notation)
Specified by:
standardFunctionTokens in class Function_
Parameters:
notation - the notation type used by the evaluator.
Returns:
the sequence of tokens that corresponds to the Function_.standardFunction(Object...). This is called by Function_.reset().
See Also:
Function_.standardFunctionTokens(Notation)


Copyright © 2010 Rubecula Software, LLC. All Rights Reserved.