Class Query

java.lang.Object
  extended by Query

public class Query
extends java.lang.Object

This class can be used for reading in queries either from files or from standard input. The query itself is stored in public fields.


Field Summary
 int[] evidence
          An array specifying the settings of the evidence variables.
 int queryVar
          The variable whose value is being queried.
 
Constructor Summary
Query(BayesNet bn)
          Use this constructor to read a query from standard input.
Query(BayesNet bn, java.lang.String filename)
          Use this constructor to read a query from a data file.
 
Method Summary
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

queryVar

public int queryVar
The variable whose value is being queried.


evidence

public int[] evidence
An array specifying the settings of the evidence variables. More specifically, evidence[i] gives the value that variable i is to be set to if it is one of the evidence variables for this query; otherwise, if variable i is not an evidence variable, then evidence[i] is set to -1.

Constructor Detail

Query

public Query(BayesNet bn)
      throws java.io.IOException
Use this constructor to read a query from standard input.

Throws:
java.io.IOException

Query

public Query(BayesNet bn,
             java.lang.String filename)
      throws java.io.FileNotFoundException,
             java.io.IOException
Use this constructor to read a query from a data file.

Throws:
java.io.FileNotFoundException
java.io.IOException