edu.stanford.multiagent.gamer.functions
Class TableFunction

java.lang.Object
  |
  +--edu.stanford.multiagent.gamer.ParameterizedObject
        |
        +--edu.stanford.multiagent.gamer.functions.Function
              |
              +--edu.stanford.multiagent.gamer.functions.TableFunction
Direct Known Subclasses:
IncreasingTableFunction

public class TableFunction
extends Function

Class implements a table lookup function for truly random table functions.


Field Summary
protected static Parameters.ParamInfo pMax
           
protected static Parameters.ParamInfo pMin
           
protected static Parameters.ParamInfo pPoints
           
protected  double[] table
           
protected static Parameters.ParamInfo[] tfParam
           
 
Fields inherited from class edu.stanford.multiagent.gamer.functions.Function
dMax, dMin
 
Fields inherited from class edu.stanford.multiagent.gamer.ParameterizedObject
parameters
 
Constructor Summary
TableFunction()
           
 
Method Summary
protected  void checkParameters()
          Checks if Parameter values are consistent.
 void doGenerate()
          Generates the table.
 double eval(double x)
          Evaluates the table, by finding nearest point.
protected  java.lang.String getFunctionHelp()
          Returns a help string describing the function and the parameters taken by the function
 void initialize()
          Calls initialize in the super class ParemeterizedObject which checks parameters
static void main(java.lang.String[] args)
          Used only for testings
 void randomizeParameters()
          Randomizes things
 
Methods inherited from class edu.stanford.multiagent.gamer.functions.Function
getDMax, getDMin, getHelp, setDomain
 
Methods inherited from class edu.stanford.multiagent.gamer.ParameterizedObject
getBooleanParameter, getDescription, getDoubleParameter, getLongParameter, getParamDescription, getParameter, getParameters, getStringParameter, setParameter, setParameter, setParameters, setParameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pMin

protected static Parameters.ParamInfo pMin

pMax

protected static Parameters.ParamInfo pMax

pPoints

protected static Parameters.ParamInfo pPoints

tfParam

protected static Parameters.ParamInfo[] tfParam

table

protected double[] table
Constructor Detail

TableFunction

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

getFunctionHelp

protected java.lang.String getFunctionHelp()
Description copied from class: Function
Returns a help string describing the function and the parameters taken by the function

Specified by:
getFunctionHelp in class Function

initialize

public void initialize()
                throws java.lang.Exception
Description copied from class: Function
Calls initialize in the super class ParemeterizedObject which checks parameters

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

checkParameters

protected void checkParameters()
                        throws java.lang.Exception
Description copied from class: ParameterizedObject
Checks if Parameter values are consistent. Must be implemented by every non-abstract subclass of ParameterizedObject.

Specified by:
checkParameters in class ParameterizedObject
Throws:
java.lang.Exception - if anything is wrong with the parameter values

randomizeParameters

public void randomizeParameters()
Randomizes things

Overrides:
randomizeParameters in class ParameterizedObject

doGenerate

public void doGenerate()
Generates the table.

Specified by:
doGenerate in class ParameterizedObject

eval

public double eval(double x)
Evaluates the table, by finding nearest point.

Specified by:
eval in class Function
Parameters:
x - the point at which to evaluate the function

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Used only for testings

java.lang.Exception