ve
Class FactorDeterministic
java.lang.Object
|
+--ve.Factor
|
+--ve.FactorDeterministic
- public class FactorDeterministic
- extends Factor
This the the class of factors that are determistic (they have only
0-1 probabilities). This is stored much more efficiently as you
only need to store which value has the probability of 1. This is
the class that is returned when we ask for the policy function in
FactorMax
Copyright 2001, David Poole. All rights reserved.
Fields inherited from class ve.Factor |
BY_ASSIGN, BY_CPT, BY_DETERMINISTIC, BY_EXPANDING, BY_GENRULE, BY_MAXIMIZING, BY_MULTIPLYING, BY_NORMALIZING, BY_OBSERVED, BY_PLUS, BY_REORDERING, BY_SAVEIT, BY_SUM_OUT, BY_UNIFORM, BY_UPDATABLE, BY_V_ELIM, howCreatedVal, savingForTracing, thesize, variables |
Methods inherited from class ve.Factor |
allOnes, contains, display, getName, getSavingForTracing, getVariables, howCreated, isRedundant, isRedundant, print, print, printVariables, setSavingForTracing, size, toString |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait |
theAction
private int[] theAction
theParents
private Variable[] theParents
decisionVar
private Variable decisionVar
preSize
private int preSize
postSize
private int postSize
curSize
private int curSize
FactorDeterministic
public FactorDeterministic(Variable[] pars,
Variable var,
int[] actions)
printPolicyFunction
public void printPolicyFunction()
- prints the policy function with no indent.
printPolicyFunction
public void printPolicyFunction(java.lang.String indent)
- prints the policy function with indent inserted at the start
of every line..
iterator
public EltsIterator iterator()
- Description copied from class:
Factor
- Returns an iterator over the values of the factor.
- Overrides:
iterator
in class Factor
update
public void update(int pos,
int val)
- updates the decision function to have a different action at
position pos. This does no error checking.
- Parameters:
pos
- the position in the total ordering of the values of
the parents.val
- the new value at this position (the index into the
domain of the variable.
insert
private static Variable[] insert(Variable var,
Variable[] vars)