com.anji.integration
Class ErrorFunction

java.lang.Object
  extended bycom.anji.integration.ErrorFunction

public class ErrorFunction
extends java.lang.Object

Author:
Philip Tucker

Method Summary
 double calculateError(double[][] targets, double[][] responses, boolean sumOfSquares)
          Calculate the sum of differences between responses and target values.
static ErrorFunction getInstance()
           
 double getMaxError(int responseCount, double minMaxRange, boolean sumOfSquares)
           
protected  double getTargetRange()
           
 void init(Properties props)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static ErrorFunction getInstance()
Returns:
singleton instance

init

public void init(Properties props)
Parameters:
props -
See Also:
Configurable.init(com.anji.util.Properties)

getMaxError

public double getMaxError(int responseCount,
                          double minMaxRange,
                          boolean sumOfSquares)
Parameters:
responseCount -
minMaxRange -
sumOfSquares -
Returns:
maximum error given the number and range of responses

calculateError

public double calculateError(double[][] targets,
                             double[][] responses,
                             boolean sumOfSquares)
Calculate the sum of differences between responses and target values.

Parameters:
targets -
responses - values to compare to target.
sumOfSquares - if true, square each diff before summing
Returns:
total sum of differences

getTargetRange

protected double getTargetRange()
Returns:
if response is within this range of the target, error is 0