edu.ucla.belief.inference
Class JoinTreeInferenceEngineImpl

Object
  extended by AbstractInferenceEngine
      extended by JoinTreeInferenceEngineImpl
All Implemented Interfaces:
EvidenceChangeListener, JoinTreeInferenceEngine, InferenceEngine, PartialDerivativeEngine, ChangeListener

public class JoinTreeInferenceEngineImpl
extends AbstractInferenceEngine
implements JoinTreeInferenceEngine, PartialDerivativeEngine


Field Summary
 
Fields inherited from class AbstractInferenceEngine
DESCRIBE_CONDITIONAL, STR_CONSOLE_MESSAGE_COMP_MEM, STR_CONSOLE_MESSAGE_COMP_TIME, STR_CONSOLE_MESSAGE_PROP_TIME
 
Constructor Summary
JoinTreeInferenceEngineImpl(BeliefCompilation comp, Dynamator dyn)
          Constructs a new JoinTreeInferenceEngineImpl that wraps a BeliefCompilation.
 
Method Summary
 Table conditional(FiniteVariable var)
          Returns P(var | observations).
 void die()
           
 void evidenceChanged(EvidenceChangeEvent ECE)
          For interface EvidenceChangeListener
 Table familyConditional(FiniteVariable var)
          Returns P(Family(var) | evidence) where Family(var) is the set containing var and its parents.
 Table familyJoint(FiniteVariable var)
          Returns P(Family(var),evidence) where Family(var) is the set containing var and its parents.
 Table familyPartial(FiniteVariable var)
          Returns the partial derivatives of the probability function with respect to the family table of var.
 int getCacheHits()
           
 JoinTreeStats.StatsSource getJoinTreeStats()
           
 double getValue()
           
 InferenceEngine handledClone(QuantitativeDependencyHandler handler)
           
 boolean isExhaustive()
           
 Table joint(FiniteVariable var)
          Returns P(var,observations).
 Table partial(FiniteVariable var)
          Returns the partial derivatives of the probability function with respect to the variable var.
 void printInfoCompilation(PrintWriter stream)
           
 void printInfoPropagation(PrintWriter stream)
           
 void printTables(PrintWriter stream)
           
 double probability()
           
 void setCPT(FiniteVariable var)
          Sets the CPT associated with var to the values in vals.
 BeliefCompilation underlyingCompilation()
           
 Set variables()
          Returns the set of all of the variables.
 void warning(EvidenceChangeEvent ece)
          For interface EvidenceChangeListener
 
Methods inherited from class AbstractInferenceEngine
canonical, compilationStatus, conditionals, describeConditionals, equals, getControlPanel, getDynamator, getEffectiveCPTData, getQuantitativeDependencyHandler, getValid, hashCode, isQuantitativeDependencyHandled, max, notoriousEdges, printTables, probabilityDisplayOperatorUnicode, probabilitySupported, random, setControlPanel, setDynamator, setQuantitativeDependencyHandler, settingChanged, setValid, test
 
Methods inherited from class Object
getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface InferenceEngine
canonical, compilationStatus, conditionals, describeConditionals, getControlPanel, getDynamator, getQuantitativeDependencyHandler, getValid, isQuantitativeDependencyHandled, max, notoriousEdges, probabilityDisplayOperatorUnicode, probabilitySupported, random, setControlPanel, setDynamator, setQuantitativeDependencyHandler, setValid
 
Methods inherited from interface ChangeListener
settingChanged
 

Constructor Detail

JoinTreeInferenceEngineImpl

public JoinTreeInferenceEngineImpl(BeliefCompilation comp,
                                   Dynamator dyn)
Constructs a new JoinTreeInferenceEngineImpl that wraps a BeliefCompilation. It is intended to provide a convinient wrapper for BeliefCompilation which allows most of the common functions to be performed in a straight forward way. A given BeliefCompilation must be used with only one JoinTreeInferenceEngineImpl since the inference engine modifies the state of the BeliefCompilation in the process of performing queries. Multiple engines would conflict and produce incorrect results.

Method Detail

die

public void die()
Specified by:
die in interface InferenceEngine
Overrides:
die in class AbstractInferenceEngine
Since:
20060321

printInfoCompilation

public void printInfoCompilation(PrintWriter stream)
Specified by:
printInfoCompilation in interface InferenceEngine
Overrides:
printInfoCompilation in class AbstractInferenceEngine

printInfoPropagation

public void printInfoPropagation(PrintWriter stream)
Specified by:
printInfoPropagation in interface InferenceEngine
Overrides:
printInfoPropagation in class AbstractInferenceEngine

printTables

public void printTables(PrintWriter stream)
Specified by:
printTables in interface InferenceEngine
Since:
061504

handledClone

public InferenceEngine handledClone(QuantitativeDependencyHandler handler)
Specified by:
handledClone in interface InferenceEngine
Since:
061404

getJoinTreeStats

public JoinTreeStats.StatsSource getJoinTreeStats()
Specified by:
getJoinTreeStats in interface JoinTreeInferenceEngine

underlyingCompilation

public BeliefCompilation underlyingCompilation()
Since:
011703

warning

public void warning(EvidenceChangeEvent ece)
For interface EvidenceChangeListener

Specified by:
warning in interface EvidenceChangeListener
Since:
071003

evidenceChanged

public void evidenceChanged(EvidenceChangeEvent ECE)
For interface EvidenceChangeListener

Specified by:
evidenceChanged in interface EvidenceChangeListener
Since:
071902

setCPT

public void setCPT(FiniteVariable var)
Sets the CPT associated with var to the values in vals. The ordering of vars must be consistent with the ordering returned by getCPT(var).

Specified by:
setCPT in interface InferenceEngine
Parameters:
var - The variable whose CPT we want to set.
vals - The values of the entries in the cpt.

probability

public double probability()
Specified by:
probability in interface InferenceEngine
Since:
102902

joint

public Table joint(FiniteVariable var)
Returns P(var,observations).

Specified by:
joint in interface InferenceEngine

conditional

public Table conditional(FiniteVariable var)
Returns P(var | observations).

Specified by:
conditional in interface InferenceEngine

getCacheHits

public int getCacheHits()
Since:
082002

familyJoint

public Table familyJoint(FiniteVariable var)
Returns P(Family(var),evidence) where Family(var) is the set containing var and its parents.

Specified by:
familyJoint in interface InferenceEngine

familyConditional

public Table familyConditional(FiniteVariable var)
Returns P(Family(var) | evidence) where Family(var) is the set containing var and its parents.

Specified by:
familyConditional in interface InferenceEngine

partial

public Table partial(FiniteVariable var)
Returns the partial derivatives of the probability function with respect to the variable var.

Specified by:
partial in interface PartialDerivativeEngine

familyPartial

public Table familyPartial(FiniteVariable var)
Returns the partial derivatives of the probability function with respect to the family table of var.

Specified by:
familyPartial in interface PartialDerivativeEngine

getValue

public double getValue()

variables

public Set variables()
Returns the set of all of the variables.

Specified by:
variables in interface InferenceEngine

isExhaustive

public boolean isExhaustive()
Specified by:
isExhaustive in interface InferenceEngine


Copyright 2010 UCLA Automated Reasoning Group