blog
Class OriginVar

java.lang.Object
  extended by blog.OriginVar
All Implemented Interfaces:
BayesNetVar

public class OriginVar
extends java.lang.Object
implements BayesNetVar

A variable whose value is the POP application satisfied by a given object identifier. The POP application is represented as a NumberVar.


Constructor Summary
OriginVar(ObjectIdentifier id)
          Creates a new variable representing the origin of the given object identifier.
 
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.
 boolean equals(java.lang.Object o)
          Two OriginVars are equal if they are for the same object identifier.
 BasicVar getFirstUninstParent(PartialWorld w)
          Returns the first parent of this variable that is uninstantiated in the given partial world.
 ObjectIdentifier getIdentifier()
          Returns the identifier that this OriginVar applies to.
 java.util.Set getParents(PartialWorld w)
          Returns the set of parents of this variable in the given partial world.
 java.lang.Object getValue(PartialWorld w)
          Returns the value of this random variable in the given world.
 int hashCode()
           
 boolean isDetermined(PartialWorld w)
          Returns true if the given world is complete enough to determine the value of this random variable.
 Timestep timestep()
          Returns the timestep that this variable is associated with, or null if it is atemporal.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OriginVar

public OriginVar(ObjectIdentifier id)
Creates a new variable representing the origin of the given object identifier.

Method Detail

getIdentifier

public ObjectIdentifier getIdentifier()
Returns the identifier that this OriginVar applies to.


isDetermined

public boolean isDetermined(PartialWorld w)
Returns true if the given world is complete enough to determine the value of this random variable.

Specified by:
isDetermined in interface BayesNetVar

getValue

public java.lang.Object getValue(PartialWorld w)
Returns the value of this random variable in the given world.

Specified by:
getValue in interface BayesNetVar
Throws:
java.lang.IllegalArgumentException - if the given partial world is not complete enough to determine the value of this variable

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 probability of this variable having a given value. This method yields a fatal error if the partial world is not complete enough to determine this variable's parents.

Specified by:
getParents in interface BayesNetVar
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.

Specified by:
getFirstUninstParent in interface BayesNetVar

ensureDetAndSupported

public 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.

Specified by:
ensureDetAndSupported in interface BayesNetVar

timestep

public Timestep timestep()
Description copied from interface: BayesNetVar
Returns the timestep that this variable is associated with, or null if it is atemporal.

Specified by:
timestep in interface BayesNetVar

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Two OriginVars are equal if they are for the same object identifier.

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object