|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectParameters.Parameters
public class Parameters
Represents a set of parameters
Nested Class Summary | |
---|---|
class |
Parameters.ParameterException
Exception related to the parameters |
Constructor Summary | |
---|---|
Parameters()
Creates an empty set of parameters |
|
Parameters(java.util.ArrayList<Parameter> params)
Creates a set of parameters containing the given parameters |
Method Summary | |
---|---|
void |
addParameter(Parameter p)
Add a parameter |
void |
addParameters(Parameters pp)
Adds the parameters from another set of parameters |
void |
calculated()
Resets the testfor whether probability matrices need to be recalculalated. |
Parameters |
clone()
|
static Parameters |
fromFile(java.io.File f)
Reads parameters from a file. |
Parameter |
getParam(java.lang.String name)
Gets the parameter with the given name |
double |
getValue(java.lang.String name)
Gets the value of a parameter |
java.util.HashMap<java.lang.String,java.lang.Double> |
getValues()
Gets a map from parameter name to the value of that parameter |
boolean |
hasParam(java.lang.String name)
Checks whether there is a parameter with the given name |
java.util.Iterator<Parameter> |
iterator()
|
int |
numberEstimate()
Gets the number of parameters to be estimated |
boolean |
recalculateMatrix()
Tests whether any parameters that would require recalculation of the probability matrices have been changed since the last call to calculated() |
void |
setValue(Parameter p,
double v)
Sets the value of a parameter |
void |
toFile(java.io.File f)
Writes the parameter values to a file. |
void |
toFile(java.io.File f,
double like)
Writes the parameter values to a file and writes a line labeled likelihood and which gives the likelihood given as input. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Parameters()
public Parameters(java.util.ArrayList<Parameter> params)
params
- A list of parametersMethod Detail |
---|
public Parameters clone()
clone
in class java.lang.Object
public void addParameter(Parameter p)
p
- The parameterpublic void addParameters(Parameters pp)
pp
- The other set of parameterspublic boolean recalculateMatrix()
calculated()
public void calculated()
public void setValue(Parameter p, double v)
p
- The parameterv
- The valuepublic double getValue(java.lang.String name) throws Parameters.ParameterException
name
- The parameters name
Parameters.ParameterException
- Thrown if there is no
parameter with that namepublic Parameter getParam(java.lang.String name) throws Parameters.ParameterException
name
- The name of the parameter
Parameters.ParameterException
- Thrown if there is no
parameter with that namepublic boolean hasParam(java.lang.String name)
name
- The name of the parameter
public java.util.HashMap<java.lang.String,java.lang.Double> getValues()
public int numberEstimate()
public java.lang.String toString()
toString
in class java.lang.Object
public java.util.Iterator<Parameter> iterator()
iterator
in interface java.lang.Iterable<Parameter>
public void toFile(java.io.File f) throws OutputException
Parameter.fromString(java.lang.String)
f
- File to write the parameters to
OutputException
- Thrown if an error occurs writing the filepublic void toFile(java.io.File f, double like) throws OutputException
Parameter.fromString(java.lang.String)
f
- File to write the parameters tolike
- The likelihood value
OutputException
- Thrown if an error occurs writing the filepublic static Parameters fromFile(java.io.File f) throws InputException
Parameter.fromString(java.lang.String)
.
f
- The input file
InputException
- If there is an input error
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |