blog
Class FormulaQuery

java.lang.Object
  extended by blog.AbstractQuery
      extended by blog.ArgSpecQuery
          extended by blog.FormulaQuery
All Implemented Interfaces:
Query

public class FormulaQuery
extends ArgSpecQuery


Field Summary
 
Fields inherited from class blog.ArgSpecQuery
argSpec, histogram, outputFile, outputFiles, variable
 
Constructor Summary
FormulaQuery(Formula formula)
           
 
Method Summary
 Formula formula()
           
 Histogram getHistogram()
           
 void logResults(int numSamples)
          If a log file has been specified, prints the results so far to that file.
 void printResults(java.io.PrintStream s)
          Prints the results of this query to the given stream.
 void printVarianceResults(java.io.PrintStream s)
          Prints across-run statistics.
 void setPosterior(ve.Factor posterior)
          Throws an UnsupportedOperationException.
 void updateStats(PartialWorld world, double weight)
          Updates the within-run statistics for this query to reflect the given world sampled with the given weight.
 void zeroOut()
          Ends the current run, records across-run statistics for it, and clears the within-run statistics.
 
Methods inherited from class blog.ArgSpecQuery
argSpec, checkTypesAndScope, compile, getLocation, getVariables, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FormulaQuery

public FormulaQuery(Formula formula)
Method Detail

formula

public Formula formula()

printResults

public void printResults(java.io.PrintStream s)
Description copied from interface: Query
Prints the results of this query to the given stream.

Specified by:
printResults in interface Query
Overrides:
printResults in class ArgSpecQuery

logResults

public void logResults(int numSamples)
Description copied from class: AbstractQuery
If a log file has been specified, prints the results so far to that file.

This default implementation does nothing.

Specified by:
logResults in interface Query
Overrides:
logResults in class ArgSpecQuery
Parameters:
numSamples - the number of samples taken by the inference engine so far (can be set to zero for non-sampling inference engines)

updateStats

public void updateStats(PartialWorld world,
                        double weight)
Description copied from interface: Query
Updates the within-run statistics for this query to reflect the given world sampled with the given weight. The world must be complete enough to define values for all the variables returned by getVariables.

The effects of calling both updateStats and setPosterior in the same run are not defined.

Specified by:
updateStats in interface Query
Overrides:
updateStats in class ArgSpecQuery

setPosterior

public void setPosterior(ve.Factor posterior)
Description copied from class: AbstractQuery
Throws an UnsupportedOperationException.

Specified by:
setPosterior in interface Query
Overrides:
setPosterior in class ArgSpecQuery
Parameters:
posterior - factor whose set of variables is the same as the collection returned by getVariables, and whose entries sum to 1

zeroOut

public void zeroOut()
Description copied from interface: Query
Ends the current run, records across-run statistics for it, and clears the within-run statistics.

Specified by:
zeroOut in interface Query
Overrides:
zeroOut in class ArgSpecQuery

printVarianceResults

public void printVarianceResults(java.io.PrintStream s)
Description copied from interface: Query
Prints across-run statistics.

Specified by:
printVarianceResults in interface Query
Overrides:
printVarianceResults in class ArgSpecQuery

getHistogram

public Histogram getHistogram()
Overrides:
getHistogram in class ArgSpecQuery