uchicago.src.sim.parameter.rpl
Class RPLParameterSetter

java.lang.Object
  extended by uchicago.src.sim.parameter.AbstractParameterSetter
      extended by uchicago.src.sim.parameter.rpl.RPLParameterSetter
All Implemented Interfaces:
ParameterSetter

public class RPLParameterSetter
extends AbstractParameterSetter

A ParameterSetter for reading and working with rpl format parameter files.

Version:
$Revision: 1.11 $ $Date: 2004/10/19 18:12:55 $

Nested Class Summary
 
Nested classes/interfaces inherited from class uchicago.src.sim.parameter.AbstractParameterSetter
AbstractParameterSetter.ParamName, AbstractParameterSetter.ParamNameIterator
 
Constructor Summary
RPLParameterSetter()
           
 
Method Summary
 java.util.Hashtable getDefaultModelParameters(SimModel model)
          Returns a Hashtable whose keys are parameter names and values are parameter values.
 java.util.ArrayList getDynamicParameterNames()
           
 java.lang.Object getParameterValue(java.lang.String name, SimModel model)
          Gets the current value of a named parameter.
 boolean hasNext()
           
 void init(java.lang.String fileName)
          Initialize the setter using the specified fileName.
 boolean isConstant(java.lang.String name)
          Tests if the named parameter is a constant.
 boolean isParameter(java.lang.String name)
           
 java.util.Iterator parameterNames()
           
 void setModelParameters(SimModel model)
          Sets the parameters for the specified model.
 void setNextModelParameters(SimModel model)
          Increments the parameters in this ParameterSetter and then sets the model's parameters.
 
Methods inherited from class uchicago.src.sim.parameter.AbstractParameterSetter
capitalize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RPLParameterSetter

public RPLParameterSetter()
Method Detail

init

public void init(java.lang.String fileName)
          throws java.io.IOException
Initialize the setter using the specified fileName. ParameterSetters will most often be created using reflection via a no-arg constructor. This init method functions like a proper constructor.

Parameters:
fileName - the name of the parameter file
Throws:
java.io.IOException

setModelParameters

public void setModelParameters(SimModel model)
Sets the parameters for the specified model. Sets the model's parameters to the current values of the parameters contained by this ParameterSetter.

Parameters:
model - the model whose parameters are set

setNextModelParameters

public void setNextModelParameters(SimModel model)
Increments the parameters in this ParameterSetter and then sets the model's parameters.

Parameters:
model - the model whose parameters are set

hasNext

public boolean hasNext()
Returns:
true if the parameter space described by this ParameterSetter has more parameter combinations to be explored; false if not.

getDynamicParameterNames

public java.util.ArrayList getDynamicParameterNames()
Returns:
a list of the names dynamic (non-constant) parameters defined in this ParameterSetter.

isParameter

public boolean isParameter(java.lang.String name)
Parameters:
name - the name of the parameter to test
Returns:
true if the specified name is the name of a parameter in this ParameterSetter; otherwise false.

isConstant

public boolean isConstant(java.lang.String name)
Tests if the named parameter is a constant.

Parameters:
name - the name of the parameter to test
Returns:
true if the specified name is the name of a constant parameter in this ParameterSetter. false if the named parameter is not constant or if the named parameter is not found.

getParameterValue

public java.lang.Object getParameterValue(java.lang.String name,
                                          SimModel model)
Description copied from interface: ParameterSetter
Gets the current value of a named parameter. A reference to the model may be necessary for those ParameterSetters whose formats allow for some interaction with the model.

Parameters:
name - the name of the parameter
model - a reference to the SimModel associated with these parameters
Returns:
the current value of the named parameter. Returns null if the parameter is not found.

parameterNames

public java.util.Iterator parameterNames()
Returns:
An iterator returning the names of the parameters contained in this ParameterSetter.

getDefaultModelParameters

public java.util.Hashtable getDefaultModelParameters(SimModel model)
Returns a Hashtable whose keys are parameter names and values are parameter values. The parameters themselves are those specified by the model in getInitParam with the addition of the random seed and the value is the current parameter file value if the parameter exists in the parameter file. If not, then the value is that of the model.

Parameters:
model - the model whose parameters we want to get
Returns:
a Hashtable whose keys are parameter names and values are parameter values.