blog
Class VarWithDistrib

java.lang.Object
  extended by blog.BasicVar
      extended by blog.VarWithDistrib
All Implemented Interfaces:
BayesNetVar, java.lang.Cloneable, java.lang.Comparable
Direct Known Subclasses:
NumberVar, RandFuncAppVar

public abstract class VarWithDistrib
extends BasicVar

Abstract class for variables that have a distribution specified by the BLOG model. This includes number variables and random function application variables.


Field Summary
 
Fields inherited from class blog.BasicVar
args
 
Constructor Summary
protected VarWithDistrib(java.util.List argList)
          Creates a new VarWithDistrib with the given tuple of arguments or generating objects.
protected VarWithDistrib(java.lang.Object[] args)
          Creates a new VarWithDistrib with the given tuple of arguments or generating objects.
protected VarWithDistrib(java.lang.Object[] args, boolean stable)
          Creates a new VarWithDistrib with the given tuple of arguments or generating objects.
 
Method Summary
 void ensureDetAndSupported(InstantiatingEvalContext instantiator)
          Ensures that the partial world underlying the given InstantiatingEvalContext is complete enough to determine the value of this variable and to determine its probability distribution conditional on its parents.
abstract  DependencyModel getDepModel()
          Returns the dependency model for this variable.
abstract  DependencyModel.Distrib getDistrib(EvalContext context)
          Returns the CPD and argument values in the first satisfied clause of this variable's dependency statement in the given context.
 BasicVar getFirstUninstParent(PartialWorld w)
          Returns the first parent of this variable that is uninstantiated in the given partial world.
 java.util.Set getParents(PartialWorld w)
          Returns the set of parents of this variable in the given partial world.
 
Methods inherited from class blog.BasicVar
args, clone, compareTo, ensureStable, getCanonicalTerm, getCanonicalTerm, getOrderingIndex, getType, getValue, isDetermined, timestep
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VarWithDistrib

protected VarWithDistrib(java.lang.Object[] args)
Creates a new VarWithDistrib with the given tuple of arguments or generating objects.


VarWithDistrib

protected VarWithDistrib(java.lang.Object[] args,
                         boolean stable)
Creates a new VarWithDistrib with the given tuple of arguments or generating objects. If stable is true, then the caller guarantees that the given args array will not be modified externally.


VarWithDistrib

protected VarWithDistrib(java.util.List argList)
Creates a new VarWithDistrib with the given tuple of arguments or generating objects.

Method Detail

getDepModel

public abstract DependencyModel getDepModel()
Returns the dependency model for this variable.


getDistrib

public abstract DependencyModel.Distrib getDistrib(EvalContext context)
Returns the CPD and argument values in the first satisfied clause of this variable's dependency statement in the given context. Returns null if the partial world in this context is not complete enough to determine the first satisfied clause and its CPD arguments.


getParents

public java.util.Set getParents(PartialWorld w)
Returns the set of parents of this variable in the given partial world. The parents are those random variables which, if they changed, could change the first satisfied clause in this variable's dependency statement or the values of CPD arguments in that clause. This method yields a fatal error if the partial world is not complete enough to determine this variable's parents.

Returns:
Set of BayesNetVar

getFirstUninstParent

public BasicVar getFirstUninstParent(PartialWorld w)
Description copied from interface: BayesNetVar
Returns the first parent of this variable that is uninstantiated in the given partial world. This method uses a decision tree view of the variable's CPD; it walks down the tree until it reaches a node corresponding to an uninstantiated variable. If all of this variable's active parents in the given partial world are instantiated, then this method returns null.


ensureDetAndSupported

public void ensureDetAndSupported(InstantiatingEvalContext instantiator)
Description copied from interface: BayesNetVar
Ensures that the partial world underlying the given InstantiatingEvalContext is complete enough to determine the value of this variable and to determine its probability distribution conditional on its parents.