edu.stanford.multiagent.gamer.functions
Class DecreasingWrapper

java.lang.Object
  |
  +--edu.stanford.multiagent.gamer.ParameterizedObject
        |
        +--edu.stanford.multiagent.gamer.functions.Function
              |
              +--edu.stanford.multiagent.gamer.functions.DecreasingWrapper

public class DecreasingWrapper
extends Function

A Wrapper that takes an arbitrary increasing function, and turns it into a decreasing one (by negating)


Field Summary
 
Fields inherited from class edu.stanford.multiagent.gamer.functions.Function
dMax, dMin
 
Fields inherited from class edu.stanford.multiagent.gamer.ParameterizedObject
parameters
 
Constructor Summary
DecreasingWrapper()
           
 
Method Summary
protected  void checkParameters()
          Checks if Parameter values are consistent.
 void doGenerate()
          Computes the additive constant to satisfy the min parameter.
 double eval(double x)
          Evaluates the function at a single point and return the value
 java.lang.String getDescription()
          Returns description of the class.
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
 void randomizeParameters()
          Randomize things
 void setParameters(edu.stanford.multiagent.gamer.ParamParser p, boolean randomize)
          Sets multiple parameters at once using a ParamParser.
 
Methods inherited from class edu.stanford.multiagent.gamer.functions.Function
getDMax, getDMin, getHelp, setDomain
 
Methods inherited from class edu.stanford.multiagent.gamer.ParameterizedObject
getBooleanParameter, getDoubleParameter, getLongParameter, getParamDescription, getParameter, getParameters, getStringParameter, setParameter, setParameter, setParameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DecreasingWrapper

public DecreasingWrapper()
                  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

setParameters

public void setParameters(edu.stanford.multiagent.gamer.ParamParser p,
                          boolean randomize)
                   throws java.lang.Exception
Description copied from class: ParameterizedObject
Sets multiple parameters at once using a ParamParser.

Overrides:
setParameters in class ParameterizedObject
Parameters:
p - the ParamParser containing the parameters and their values
randomize - should be set to true if it is desired that any unset parameters be randomized
Throws:
java.lang.Exception

randomizeParameters

public void randomizeParameters()
Randomize things

Overrides:
randomizeParameters in class ParameterizedObject

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

doGenerate

public void doGenerate()
Computes the additive constant to satisfy the min parameter.

Specified by:
doGenerate in class ParameterizedObject

eval

public double eval(double x)
Description copied from class: Function
Evaluates the function at a single point and return the value

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

getDescription

public java.lang.String getDescription()
Description copied from class: ParameterizedObject
Returns description of the class. Subclasses should override.

Overrides:
getDescription in class ParameterizedObject