cve
Class FactorRandom

java.lang.Object
  |
  +--ve.Factor
        |
        +--ve.FactorStored
              |
              +--cve.FactorRandom

public class FactorRandom
extends FactorStored

This the the class of factors that have random values.


Inner classes inherited from class ve.FactorStored
FactorStored.Itr
 
Fields inherited from class ve.FactorStored
factorValues
 
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
 
Constructor Summary
FactorRandom(Variable[] vars)
          constructs a factor with the given variables.
FactorRandom(Variable[] vars, int length)
           
 
Method Summary
private static Variable[] prune(Variable[] vars, int length)
           
 void update(int pos, double val)
          updates every stored value corresponding to the rule.
 
Methods inherited from class ve.FactorStored
iterator
 
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
 

Constructor Detail

FactorRandom

public FactorRandom(Variable[] vars)
constructs a factor with the given variables.
Parameters:
vars - the list of variables
initProbs - the initial Probability for each node

FactorRandom

public FactorRandom(Variable[] vars,
                    int length)
Method Detail

prune

private static Variable[] prune(Variable[] vars,
                                int length)

update

public void update(int pos,
                   double val)
updates every stored value corresponding to the rule. This must also update all of the values.
Parameters:
pos - the position in the array to be updated
val - the new value