|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object blog.AbstractQuery blog.ArgSpecQuery
public class ArgSpecQuery
Field Summary | |
---|---|
protected ArgSpec |
argSpec
|
protected Histogram |
histogram
|
protected java.io.PrintStream |
outputFile
|
protected java.util.Map |
outputFiles
|
protected int |
trialNum
|
protected BayesNetVar |
variable
|
Constructor Summary | |
---|---|
ArgSpecQuery(ArgSpec argSpec)
|
Method Summary | |
---|---|
ArgSpec |
argSpec()
|
boolean |
checkTypesAndScope(Model model)
Returns true if this query satisfies type and scope constraints. |
int |
compile()
Compiles the underlying ArgSpec, and initializes the variable corresponding to this query. |
Histogram |
getHistogram()
|
java.lang.Object |
getLocation()
Returns an object whose toString method yields a description of the location where this query occurred in an input file. |
java.util.Collection<? extends BayesNetVar> |
getVariables()
Returns a collection of (basic or derived) random variables such that the result of this query depends only on the posterior joint distribution for these variables. |
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. |
java.lang.String |
toString()
|
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 java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected ArgSpec argSpec
protected BayesNetVar variable
protected Histogram histogram
protected int trialNum
protected java.util.Map outputFiles
protected java.io.PrintStream outputFile
Constructor Detail |
---|
public ArgSpecQuery(ArgSpec argSpec)
Method Detail |
---|
public ArgSpec argSpec()
public void printResults(java.io.PrintStream s)
Query
public void logResults(int numSamples)
AbstractQuery
This default implementation does nothing.
logResults
in interface Query
logResults
in class AbstractQuery
numSamples
- the number of samples taken by the inference
engine so far (can be set to zero for
non-sampling inference engines)public java.util.Collection<? extends BayesNetVar> getVariables()
Query
public boolean checkTypesAndScope(Model model)
Query
public int compile()
public void updateStats(PartialWorld world, double weight)
Query
getVariables
.
The effects of calling both updateStats
and
setPosterior
in the same run are not defined.
public void setPosterior(ve.Factor posterior)
AbstractQuery
setPosterior
in interface Query
setPosterior
in class AbstractQuery
posterior
- factor whose set of variables is the same
as the collection returned by getVariables,
and whose entries sum to 1public void zeroOut()
Query
public void printVarianceResults(java.io.PrintStream s)
Query
public Histogram getHistogram()
public java.lang.Object getLocation()
AbstractQuery
This default implementation returns a string indicating that this query was generated internally, rather than from an input file.
getLocation
in interface Query
getLocation
in class AbstractQuery
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |