com.rubecula.darwin.domain.fitness
Class FitnessFunction_

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

public abstract class FitnessFunction_
extends Function_
implements FitnessFunction

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
protected FitnessFunction_()
          TEST
protected FitnessFunction_(com.rubecula.jexpression.Evaluator evaluator)
           
 
Method Summary
 double getFitness(double value, double target, double factor)
          Get the fitness based on the value (usually from one of the traits of a phenotype), the target (usually a value from an eco factor in the environment), and the shape factor (usually determined by the application).
 
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, standardFunction, standardFunctionTokens
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.tostring0.Identifiable
getIdentifier
 

Constructor Detail

FitnessFunction_

protected FitnessFunction_()
TEST


FitnessFunction_

protected FitnessFunction_(com.rubecula.jexpression.Evaluator evaluator)
Parameters:
evaluator - the evaluator (expression engine) used to evaluate the expression.
Method Detail

getFitness

public double getFitness(double value,
                         double target,
                         double factor)
                  throws FitnessException
Get the fitness based on the value (usually from one of the traits of a phenotype), the target (usually a value from an eco factor in the environment), and the shape factor (usually determined by the application).

Specified by:
getFitness in interface FitnessFunction
Parameters:
value - the variate value.
target - usually the mean value of a distribution, if such a concept is meaningful.
factor - usually the standard deviation of a distribution, if such a concept is meaningful.
Returns:
the value of the expression evaluated by the Evaluator or the value returned from Function_.evaluate(Object...) with parameters: VAR_VALUE, value, VAR_TARGET, target, VAR_SHAPE_FACTOR, factor.
Throws:
FitnessException
See Also:
FitnessFunction.getFitness(double, double, double)


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