|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--techniques.BN.ProbTable
Represents a probability table, and can be thought of as a maintainer of functions of discrete types.
Field Summary | |
double[] |
table
|
Constructor Summary | |
ProbTable(Variable var)
|
|
ProbTable(Variable[] var)
|
Method Summary | |
String |
getCompleteString()
Returns string of variables and data in table |
int |
getNumVariables()
|
double |
getProb(int[] evidence)
Same as getProb(Map) with evidence instead provided as an int array. |
double |
getProb(Map evidence)
Used to get the probability values for the given variable evidence. |
String |
getTableAsString()
|
int |
getTableSize()
Returns size of the underlying table. |
static int |
getTableSize(Variable[] var)
Returns size of the table that would be formed from the given variables |
Variable |
getVariable(int i)
|
Variable[] |
getVariables()
|
Iterator |
getVariablesIterator()
Returns an iterator through a set of all entries (variable-value combinations for the variables) in the table. |
String |
getVarString()
Returns string of variables in table |
void |
setProb(int[] evidence,
double prob)
|
void |
setProb(Map evidence,
double prob)
All values for variables in the table are needed to be in the map for successful completion of the method |
void |
setTableValue(HashMap knownValues,
double inTableValue)
Sets the probability table value given all the values for the parents of the current prob. |
void |
setTableValue(int[] evidence,
double inTableValue)
Sets the probability table value given all the values for the parents of the current prob. |
void |
setTableValues(HashMap knownValues,
double[] inTableValues)
Sets the probability tables values given the first few variable values for the current prob. |
String |
toString()
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public double[] table
Constructor Detail |
public ProbTable(Variable var)
public ProbTable(Variable[] var)
Method Detail |
public int getTableSize()
public static int getTableSize(Variable[] var)
public void setTableValue(HashMap knownValues, double inTableValue)
public void setTableValue(int[] evidence, double inTableValue)
public void setTableValues(HashMap knownValues, double[] inTableValues)
public double getProb(Map evidence)
public void setProb(Map evidence, double prob)
public double getProb(int[] evidence)
evidence
- - evidence in the same order as the variablespublic void setProb(int[] evidence, double prob)
evidence
- - evidence in the same order as the variablespublic Variable[] getVariables()
public Variable getVariable(int i)
public int getNumVariables()
public String getVarString()
public String toString()
toString
in class Object
public String getTableAsString()
public String getCompleteString()
public Iterator getVariablesIterator()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |