|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectparameters.ParameterSet
ParameterSet.java This class stores a set of Parameter objects, along with variables that might be associated with such a set. The associated variables, called value fields, often include a score, a number of function calls, a group number and tag for sets from an output file. They can also include other variables as output from an iterator, each with its own unique tag. See the ParameterSetArray and the Iterator classes for more information on including additional variables (called Value Fields).
You can use this class in two ways, with or without a prototype class. If you pass a prototype ParameterSet to the constructor, then only parameters which are in that prototype set will be added to this set. Others are ignored. Without a prototype set, any parameter sent to this set will be added (provided it exists in the model - see Parameter class). If a prototype is used, this class will look up the names for additional variables in that prototype class and will only store the values locally. Otherwise, this parameter set will ignore additional variables unless its load() or addOutputTag() functions are explicitly called.
Parameter
Field Summary | |
int |
numParams
Note that not all params below numParams neccesarily exist. |
Parameter[] |
params
Get the position of a parameter in this array using the getPosition function |
protected java.lang.String |
tag
|
Constructor Summary | |
ParameterSet()
|
|
ParameterSet(ParameterSet prototype)
|
|
ParameterSet(ParameterSet prototype,
int group_num,
java.lang.String tag)
|
|
ParameterSet(java.lang.String str)
If you call a constructor with a prototype set, the only parameters that can be added to this set are those that are in the prototype. |
Method Summary | |
void |
addParameter(Parameter par)
If there is a prototype, this function tries to find the new parameter's name in the prototype. |
void |
addParameter(java.lang.String name,
float value,
float min,
float max,
int type)
If any of the passed in values are < 0, then the defaults are used (which come from the currently loaded model, via the Parameter constructor. |
void |
addValueField(java.lang.String name,
java.lang.String type)
|
boolean |
areParametersGood(float[] params,
int mode)
|
void |
arrangeParametersByModel()
Rearranges the parameters in this set so that the position in set corresponds to the position of the parameter in Affector. |
ParameterSet |
copy()
|
void |
copyValueFieldNames(ParameterSet ps)
|
boolean |
didPass()
|
void |
draw(java.awt.Graphics g,
int xcen,
int ycen,
int rad,
double[] cosThetas,
double[] sinThetas)
ParameterSet objects can draw themselves as cam's using this draw command. |
java.lang.String |
getFieldName(int pos)
|
int |
getFieldPos(java.lang.String name)
|
float |
getFieldValue(int pos)
|
float |
getFieldValue(java.lang.String name)
|
float |
getFuzzyParametersScore(float[] params)
|
int |
getGroupNum()
|
float |
getLowerBound(int i)
|
float[] |
getLowerBounds()
|
void |
getModel()
|
java.lang.String |
getName(int pos)
|
int |
getNumFuncCalls()
|
int |
getNumParams()
|
int |
getNumValueFields()
|
Parameter |
getParameter(int i)
|
float[] |
getParVals()
This is for setting an Iterator's internal parameter vector p |
int |
getPosition(java.lang.String name)
Gets the position of a parameter called "name" in this sets params array. |
ParameterSet |
getPrototype()
|
float |
getScore()
|
java.lang.String |
getTag()
|
float |
getUpperBound(int i)
|
float[] |
getUpperBounds()
|
float |
getValue(int pos)
|
int |
getVariationMode(int pos)
|
void |
loadParameters(BetterTokenizer tokenizer)
This function loads a parameter set from an output file, tagged with the FPARS tag. |
void |
loadParameterValues(BetterTokenizer tokenizer,
boolean need_all)
Loads a set of parameters from a stream. |
void |
loadValueFieldNames(BetterTokenizer tokenizer)
Value Fields |
boolean |
makeNewPoint(int mode)
|
boolean |
makeNewPoint(int mode,
ParameterSet nochange)
|
void |
removeParameter(java.lang.String name)
|
void |
setArrangeByModel(boolean arrange)
Set to true if parameters should be put into the same order in this parameter set as they are in the model. |
void |
setFieldValue(int pos,
float value)
|
void |
setFieldValue(java.lang.String name,
float value)
|
void |
setFrom(float[] vals)
And this is for setting par values from the same vector. |
void |
setFrom(ParameterSet set)
Sets parameters in this set from the set that's passed in, for all parameters that appear in both |
void |
setGroupNum(int num)
|
void |
setLowerBound(int pos,
float val)
|
void |
setModel()
Sets the currently loaded model according to the parameters in this parameter set. |
void |
setNumFuncCalls(int num)
|
void |
setParameter(Parameter par,
int pos)
|
void |
setPass(boolean pass)
|
void |
setScore(float score)
|
void |
setTag(java.lang.String tag)
|
void |
setUpperBound(int pos,
float val)
|
void |
setValue(int pos,
float val)
|
void |
setVariationMode(int pos,
int mode)
|
java.lang.String |
toString()
|
void |
toString(java.io.PrintWriter ps,
java.lang.String indent)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public Parameter[] params
public int numParams
protected java.lang.String tag
Constructor Detail |
public ParameterSet()
public ParameterSet(java.lang.String str)
public ParameterSet(ParameterSet prototype)
public ParameterSet(ParameterSet prototype, int group_num, java.lang.String tag)
Method Detail |
public ParameterSet copy()
public void addParameter(java.lang.String name, float value, float min, float max, int type) throws java.lang.Exception
java.lang.Exception
public void addParameter(Parameter par)
public void removeParameter(java.lang.String name)
public int getPosition(java.lang.String name) throws java.lang.Exception
java.lang.Exception
public void setFrom(ParameterSet set)
public float[] getParVals()
public void setFrom(float[] vals)
public boolean areParametersGood(float[] params, int mode)
public float getFuzzyParametersScore(float[] params)
public ParameterSet getPrototype()
public float getScore()
public void setScore(float score)
public int getGroupNum()
public void setGroupNum(int num)
public java.lang.String getTag()
public void setTag(java.lang.String tag)
public int getNumFuncCalls()
public void setNumFuncCalls(int num)
public int getVariationMode(int pos)
public void setVariationMode(int pos, int mode)
public boolean didPass()
public void setPass(boolean pass)
public Parameter getParameter(int i)
public void setParameter(Parameter par, int pos)
public java.lang.String getName(int pos)
public float getValue(int pos)
public void setValue(int pos, float val)
public float getUpperBound(int i)
public void setUpperBound(int pos, float val)
public float getLowerBound(int i)
public void setLowerBound(int pos, float val)
public float[] getUpperBounds()
public float[] getLowerBounds()
public int getNumParams()
public void getModel()
public void setModel()
public boolean makeNewPoint(int mode, ParameterSet nochange)
public boolean makeNewPoint(int mode)
public void loadParameters(BetterTokenizer tokenizer) throws java.lang.Exception
To load from an input file, call loadParameterValues directly (with need_all = true for model files).
java.lang.Exception
public void loadParameterValues(BetterTokenizer tokenizer, boolean need_all) throws java.lang.Exception
need_all
- Gets passed into the Parameter objects loadParameters function.
java.lang.Exception
public void arrangeParametersByModel()
public void setArrangeByModel(boolean arrange)
public void loadValueFieldNames(BetterTokenizer tokenizer) throws java.lang.Exception
java.lang.Exception
public void copyValueFieldNames(ParameterSet ps)
public void addValueField(java.lang.String name, java.lang.String type)
public int getNumValueFields()
public float getFieldValue(int pos)
public float getFieldValue(java.lang.String name)
public void setFieldValue(int pos, float value)
public void setFieldValue(java.lang.String name, float value)
public java.lang.String getFieldName(int pos)
public int getFieldPos(java.lang.String name)
public void draw(java.awt.Graphics g, int xcen, int ycen, int rad, double[] cosThetas, double[] sinThetas)
public java.lang.String toString()
public void toString(java.io.PrintWriter ps, java.lang.String indent)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |