edu.stanford.multiagent.gamer.functions
Class Function

java.lang.Object
  |
  +--edu.stanford.multiagent.gamer.ParameterizedObject
        |
        +--edu.stanford.multiagent.gamer.functions.Function
Direct Known Subclasses:
DecreasingWrapper, ExpFunction, LogFunction, PolyFunction, TableFunction

public abstract class Function
extends ParameterizedObject

An abstract class for single-arity function classes


Field Summary
protected  double dMax
           
protected  double dMin
           
 
Fields inherited from class edu.stanford.multiagent.gamer.ParameterizedObject
parameters
 
Constructor Summary
Function()
           
 
Method Summary
abstract  double eval(double x)
          Evaluates the function at a single point and return the value
 double getDMax()
          Returns the maximum value in the domain.
 double getDMin()
          Returns the minimum value in the domain.
protected abstract  java.lang.String getFunctionHelp()
          Returns a help string describing the function and the parameters taken by the function
 java.lang.String getHelp()
          Return the help screen
 void initialize()
          Calls initialize in the super class ParemeterizedObject which checks parameters
 void setDomain(double min, double max)
          Sets the domain range.
 
Methods inherited from class edu.stanford.multiagent.gamer.ParameterizedObject
checkParameters, doGenerate, getBooleanParameter, getDescription, getDoubleParameter, getLongParameter, getParamDescription, getParameter, getParameters, getStringParameter, randomizeParameters, setParameter, setParameter, setParameters, setParameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dMin

protected double dMin

dMax

protected double dMax
Constructor Detail

Function

public Function()
         throws java.lang.Exception
Method Detail

getHelp

public java.lang.String getHelp()
Return the help screen

Specified by:
getHelp in class ParameterizedObject

getFunctionHelp

protected abstract java.lang.String getFunctionHelp()
Returns a help string describing the function and the parameters taken by the function


eval

public abstract double eval(double x)
Evaluates the function at a single point and return the value

Parameters:
x - the point at which to evaluate the function

initialize

public void initialize()
                throws java.lang.Exception
Calls initialize in the super class ParemeterizedObject which checks parameters

Overrides:
initialize in class ParameterizedObject
Throws:
java.lang.Exception - if there is a problem with the parameters

setDomain

public void setDomain(double min,
                      double max)
Sets the domain range. This range must be set before randomization happens.

Parameters:
min - minimum value in the domain
max - maximum value in the domain

getDMin

public double getDMin()
Returns the minimum value in the domain.


getDMax

public double getDMax()
Returns the maximum value in the domain.