|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--edu.stanford.multiagent.gamer.ParameterizedObject
Abstract class that can be extended by any class which needs to use the parameter set-up.
| Field Summary | |
protected edu.stanford.multiagent.gamer.Parameters |
parameters
|
| Constructor Summary | |
protected |
ParameterizedObject()
The consctructor. |
| Method Summary | |
protected abstract void |
checkParameters()
Checks if Parameter values are consistent. |
abstract void |
doGenerate()
Generate a (random) instance of the subclass based on input parameters. |
boolean |
getBooleanParameter(java.lang.String name)
Returns the value of the parameter with the given name as a boolean (assuming the parameter is of type boolean). |
java.lang.String |
getDescription()
Returns description of the class. |
double |
getDoubleParameter(java.lang.String name)
Returns the value of the parameter with the given name as a double (assuming the parameter is of type double). |
abstract java.lang.String |
getHelp()
Return the help screen |
long |
getLongParameter(java.lang.String name)
Returns the value of the parameter with the given name as a long (assuming the parameter is of type long). |
java.lang.String |
getParamDescription(java.lang.String sep)
Constructs a string with all parameter values. |
java.lang.Object |
getParameter(java.lang.String name)
Returns the value of the parameter with the given name as an Object. |
edu.stanford.multiagent.gamer.Parameters |
getParameters()
Returns the Parameters object of the class. |
java.lang.String |
getStringParameter(java.lang.String name)
Returns the value of the parameter with the given name as a String (assuming the parameter is of type String). |
void |
initialize()
Initializes using preset parameter values. |
void |
randomizeParameters()
Sets values of any unset parameters randomly. |
void |
setParameter(java.lang.String name,
java.lang.Object val)
Sets the value of a parameter. |
void |
setParameter(java.lang.String name,
java.lang.Object val,
boolean byUser)
Sets the value of a parameter. |
void |
setParameters(edu.stanford.multiagent.gamer.Parameters p,
boolean randomize)
Sets multiple parameters at once using a Parameters variable. |
void |
setParameters(edu.stanford.multiagent.gamer.ParamParser p,
boolean randomize)
Sets multiple parameters at once using a ParamParser. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected edu.stanford.multiagent.gamer.Parameters parameters
| Constructor Detail |
protected ParameterizedObject()
throws java.lang.Exception
| Method Detail |
public edu.stanford.multiagent.gamer.Parameters getParameters()
public java.lang.Object getParameter(java.lang.String name)
name - parameter to returnpublic long getLongParameter(java.lang.String name)
name - parameter to returnpublic boolean getBooleanParameter(java.lang.String name)
name - parameter to returnpublic double getDoubleParameter(java.lang.String name)
name - parameter to returnpublic java.lang.String getStringParameter(java.lang.String name)
name - parameter to return
public void setParameter(java.lang.String name,
java.lang.Object val)
throws java.lang.Exception
name - parameter to set the value ofval - value to set
java.lang.Exception
public void setParameter(java.lang.String name,
java.lang.Object val,
boolean byUser)
throws java.lang.Exception
name - parameter to set the value ofval - value to setbyUser - should be true if the parameter was set by the
user on the command line
java.lang.Exception
public void setParameters(edu.stanford.multiagent.gamer.ParamParser p,
boolean randomize)
throws java.lang.Exception
p - the ParamParser containing the parameters and
their valuesrandomize - should be set to true if it is desired
that any unset parameters be randomized
java.lang.Exception
public void setParameters(edu.stanford.multiagent.gamer.Parameters p,
boolean randomize)
throws java.lang.Exception
p - the Parameters variable containing the parameters and
their valuesrandomize - should be set to true if it is desired
that any unset parameters be randomized
java.lang.Exception
public void initialize()
throws java.lang.Exception
java.lang.Exceptionpublic void randomizeParameters()
public java.lang.String getParamDescription(java.lang.String sep)
sep - seperator to be placed between parameter valuespublic java.lang.String getDescription()
protected abstract void checkParameters()
throws java.lang.Exception
java.lang.Exception - if anything is wrong with the parameter
valuespublic abstract void doGenerate()
public abstract java.lang.String getHelp()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||