|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectBayesNet
public class BayesNet
This class loads a Bayes net from a data file. A description of the topology of the Bayes net is stored in public fields, while the conditional probability tables are accessed using a public method. Internally, variables are identified with the integers 0, 1, 2, ..., up to (but not including) the number of variables. The values that each variable can take are also given as integers in a similar manner.
Field Summary | |
---|---|
int[] |
numParents
The number of parents of each variable. |
int[] |
numValues
The number of values that each variable can take. |
int |
numVariables
The number of variables. |
int[][] |
parents
The parents of each of the variables. |
java.lang.String[][] |
valueNames
The names of the values of each variable. |
java.lang.String[] |
varName
The names of each of the variables. |
Constructor Summary | |
---|---|
BayesNet(java.lang.String filename)
A constructor for constructing a Bayes net by reading in a description from the given data file. |
Method Summary | |
---|---|
double |
getCondProb(int x,
int[] vals)
This method can be used to access the conditional probability table of each of the variables. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public int numVariables
public java.lang.String[] varName
public int[] numValues
public java.lang.String[][] valueNames
public int[] numParents
public int[][] parents
Constructor Detail |
---|
public BayesNet(java.lang.String filename) throws java.io.FileNotFoundException, java.io.IOException
java.io.FileNotFoundException
java.io.IOException
Method Detail |
---|
public double getCondProb(int x, int[] vals)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |