|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectuchicago.src.sim.parameter.ParameterUtility
public class ParameterUtility
Some utility methods for working with parameters. All parameter queries should now go through this class. This class is a singleton. The single instance can be retrieved with ParameterUtility.getInstance(). Before using this single instance, it must be created. All the controllers that come with repast do this in their constructors.
Various methods of ParameterUtility refer to default parameters. These are the parameters that are loaded via an external parameter file.
| Method Summary | |
|---|---|
static void |
createInstance()
Creates an instance of a ParameterUtility. |
static void |
createInstance(ParameterSetter params)
Creates an instance of a ParameterUtility. |
ParameterSetter |
createParameters(java.lang.Object o,
java.lang.String[] properties)
Creates a Vector of Parameters based on the current property values of Object o. |
java.util.Hashtable |
getDefaultParameters(SimModel model)
Returns a Hashtable whose keys are the names of the default parameters and whose values are the values of the parameters. |
java.util.ArrayList |
getDynamicParameterNames()
Returns a list of the names of the dynamic default parameters associated with this ParameterUtility. |
static ParameterUtility |
getInstance()
Returns the single instance of this ParameterUtility. |
java.util.Hashtable |
getModelProperties(SimModel model)
Returns a Hashtable of all the current property name and value pairs for the specified model. |
java.lang.String |
getPropertyNamesHeader(SimModel model)
|
java.lang.String |
getPropertyValues(SimModel model)
|
boolean |
isConstantDefaultParam(java.lang.String name)
Returns true if the named parameter is a default parameter and is a constant parameter. |
boolean |
isDefaultParam(java.lang.String name)
Returns true if the named parameter is a default parameter. |
void |
makeParameterFileFromCurVals(java.lang.Object o,
java.lang.String[] props,
java.lang.String fileName)
Creates and writes a parameter file for the specified properties of the specified object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static void createInstance(ParameterSetter params)
params - a list of Parameter objects. These are the default
parameters for this ParameterUtility instance.public static void createInstance()
public static ParameterUtility getInstance()
public boolean isDefaultParam(java.lang.String name)
name - the name of the parameter to checkpublic boolean isConstantDefaultParam(java.lang.String name)
name - the name of the parameter to check.public java.util.ArrayList getDynamicParameterNames()
public java.util.Hashtable getDefaultParameters(SimModel model)
throws java.beans.IntrospectionException,
java.lang.reflect.InvocationTargetException,
java.lang.IllegalAccessException
model - the model whose parameters we want to get
java.beans.IntrospectionException
java.lang.reflect.InvocationTargetException
java.lang.IllegalAccessException
public ParameterSetter createParameters(java.lang.Object o,
java.lang.String[] properties)
throws java.beans.IntrospectionException,
java.lang.IllegalAccessException,
java.lang.reflect.InvocationTargetException
o - the Object whose properties should become the parametersproperties - the array of properties to create parameters from
java.beans.IntrospectionException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
public java.util.Hashtable getModelProperties(SimModel model)
throws java.beans.IntrospectionException,
java.lang.IllegalAccessException,
java.lang.reflect.InvocationTargetException
model - the model whose properties we want to get.
java.beans.IntrospectionException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
public void makeParameterFileFromCurVals(java.lang.Object o,
java.lang.String[] props,
java.lang.String fileName)
throws java.beans.IntrospectionException,
java.lang.IllegalAccessException,
java.lang.reflect.InvocationTargetException,
RepastException,
java.io.IOException
o - the object whose properties we want to writeprops - the names of the properties to writefileName - the name of the file to write the properties to
java.beans.IntrospectionException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
RepastException
java.io.IOExceptionpublic java.lang.String getPropertyNamesHeader(SimModel model)
public java.lang.String getPropertyValues(SimModel model)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||