|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object blog.Clause
public class Clause
Represents a clause in dependency statements and number statements. Each clause has a predicate, a conditional probability distribution (CPD), and a list of arguments to this conditional probability distribution. Each argument is assumed to be of class ArgSpec. If the condition is checked and turns out to be true, then the arguments are evaluated and the CPD is used to sample a value for these arguments.
Constructor Summary | |
---|---|
Clause(Formula cond,
java.lang.Class cpdClass,
java.util.List cpdParams,
java.util.List cpdArgs)
Creates a new clause. |
|
Clause(Formula cond,
CondProbDistrib cpd,
java.util.List cpdArgs)
Creates a new clause using the given CondProbDistrib object. |
Method Summary | |
---|---|
boolean |
checkTypesAndScope(Model model,
java.util.Map scope,
Type childType)
|
int |
compile(java.util.LinkedHashSet callStack)
Creates the CPD object for this clause (if it doesn't already exist), and does any necessary compilation on the condition and CPD arguments. |
java.util.List |
getArgs()
|
Formula |
getCond()
|
CondProbDistrib |
getCPD()
|
java.lang.Class |
getCPDClass()
|
DependencyModel.Distrib |
getDistrib(EvalContext context)
Returns this clause's CPD, and the values of this clause's arguments evaluated in the given context. |
BasicVar |
getEqualParent(EvalContext context)
If, in the given context, this clause specifies that the child is equal to one of its parents, then this method returns that "equal parent". |
java.lang.Object |
getLocation()
Returns the object specified by the last call to setLocation. |
void |
setLocation(java.lang.Object loc)
Sets the location of this clause, for instance, the file name and line number where it appears. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Clause(Formula cond, java.lang.Class cpdClass, java.util.List cpdParams, java.util.List cpdArgs)
cond
- the condition under which this clause appliescpdClass
- the class of the conditional probability distribution
used in this clausecpdParams
- List of ArgSpec objects representing CPD parameters.
These must be non-random and must contain no free
variables.cpdArgs
- List of ArgSpec objects whose denotations will be
passed to the CPD each time it is invokedpublic Clause(Formula cond, CondProbDistrib cpd, java.util.List cpdArgs)
cond
- the condition under which this clause appliescpd
- conditional probability distribution for this clausecpdArgs
- List of ArgSpec objects whose denotations will be
passed to the CPD each time it is invokedMethod Detail |
---|
public Formula getCond()
public java.lang.Class getCPDClass()
public CondProbDistrib getCPD()
public java.util.List getArgs()
public DependencyModel.Distrib getDistrib(EvalContext context)
public BasicVar getEqualParent(EvalContext context)
public boolean checkTypesAndScope(Model model, java.util.Map scope, Type childType)
public int compile(java.util.LinkedHashSet callStack)
callStack
- Set of objects whose compile methods are parents
of this method invocation. Ordered by invocation
order. Used to detect cycles.public void setLocation(java.lang.Object loc)
public java.lang.Object getLocation()
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 |