|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object blog.DependencyModel
public class DependencyModel
Represents dependency statements for functions and number statements for potential object patterns. It consists of a list of clauses the dependency/number statement consists of. Each DependencyModel also has a default value: if none of the clauses are satisfied, then the child variable has the default value with probability 1. The default value is Boolean.FALSE for Boolean functions, null for all other functions, and Integer(0) for POPs.
Function
,
POP
Nested Class Summary | |
---|---|
static class |
DependencyModel.Distrib
Nested class representing a distribution over child values, in the form of a CPD and a list of values for the CPD's arguments. |
Constructor Summary | |
---|---|
DependencyModel(java.util.List cl,
Type childType,
java.lang.Object defaultVal)
|
Method Summary | |
---|---|
boolean |
checkTypesAndScope(Model model,
java.util.Map scope)
|
int |
compile(java.util.LinkedHashSet callStack)
Creates CPD objects for this dependency model, and does any necessary compilation on the conditions and CPD arguments. |
Clause |
getActiveClause(EvalContext context)
Returns the first clause in this dependency model whose condition is satisfied in the given context. |
java.util.List |
getClauseList()
|
int |
getCreationIndex()
Returns an index indicating when this dependency model was defined. |
java.lang.Object |
getDefaultValue()
|
DependencyModel.Distrib |
getDistrib(EvalContext context)
Returns the CPD and argument values for the first satisfied clause in the given context. |
DependencyModel.Distrib |
getDistribWithBinding(EvalContext context,
LogicalVar[] vars,
java.lang.Object[] objs,
java.lang.Object valueWhenArgsDontExist)
Returns the CPD and argument values for the first satisfied clause in the context obtained by binding the given variables to the given objects. |
BasicVar |
getEqualParent(EvalContext context)
If, in the given context, this dependency model specifies that the child is equal to one of its parents, then this method returns that "equal parent". |
void |
print(java.io.PrintStream s)
Prints this dependency model to the given stream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DependencyModel(java.util.List cl, Type childType, java.lang.Object defaultVal)
Method Detail |
---|
public java.util.List getClauseList()
public java.lang.Object getDefaultValue()
public DependencyModel.Distrib getDistribWithBinding(EvalContext context, LogicalVar[] vars, java.lang.Object[] objs, java.lang.Object valueWhenArgsDontExist)
valueWhenArgsDontExist
. If the context is not
complete enough to determine the first satisfied clause and its
argument values, this method returns null.
public DependencyModel.Distrib getDistrib(EvalContext context)
public Clause getActiveClause(EvalContext context)
public BasicVar getEqualParent(EvalContext context)
public void print(java.io.PrintStream s)
public boolean checkTypesAndScope(Model model, java.util.Map scope)
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 int getCreationIndex()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |