edu.ucla.belief.inference
Class RandomInferenceEngine

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

public class RandomInferenceEngine
extends AbstractInferenceEngine
implements PartialDerivativeEngine

An inference engine that does no computation, instead returns random answers, for the purpose of testing.

Since:
20060201
Author:
Keith Cascio

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
RandomInferenceEngine(BeliefNetwork bn, Dynamator dyn)
           
 
Method Summary
 Table conditional(FiniteVariable var)
          Returns P(var | observations).
 void die()
           
 void evidenceChanged(EvidenceChangeEvent ece)
          Invoked when there is an evidence change.
 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.
 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 out)
           
 double probability()
           
 void setCPT(FiniteVariable var)
          Sets the CPT associated with var to the values in vals.
 Set variables()
          Returns the set of all of the variables.
 void warning(EvidenceChangeEvent ece)
          warning() means: a real evidence change is about to happen - get ready!
 
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
 

Constructor Detail

RandomInferenceEngine

public RandomInferenceEngine(BeliefNetwork bn,
                             Dynamator dyn)
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 out)
Specified by:
printTables in interface InferenceEngine

handledClone

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

warning

public void warning(EvidenceChangeEvent ece)
Description copied from interface: EvidenceChangeListener
warning() means: a real evidence change is about to happen - get ready!

Specified by:
warning in interface EvidenceChangeListener

evidenceChanged

public void evidenceChanged(EvidenceChangeEvent ece)
Description copied from interface: EvidenceChangeListener
Invoked when there is an evidence change.

Specified by:
evidenceChanged in interface EvidenceChangeListener

setCPT

public void setCPT(FiniteVariable var)
Description copied from interface: InferenceEngine
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.

probability

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

joint

public Table joint(FiniteVariable var)
Description copied from interface: InferenceEngine
Returns P(var,observations).

Specified by:
joint in interface InferenceEngine

conditional

public Table conditional(FiniteVariable var)
Description copied from interface: InferenceEngine
Returns P(var | observations).

Specified by:
conditional in interface InferenceEngine

familyJoint

public Table familyJoint(FiniteVariable var)
Description copied from interface: InferenceEngine
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)
Description copied from interface: InferenceEngine
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)
Description copied from interface: PartialDerivativeEngine
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)
Description copied from interface: PartialDerivativeEngine
Returns the partial derivatives of the probability function with respect to the family table of var.

Specified by:
familyPartial in interface PartialDerivativeEngine

variables

public Set variables()
Description copied from interface: InferenceEngine
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