com.cra.bnet.engine
Class GeneratedEngineBase

java.lang.Object
  |
  +--com.cra.bnet.engine.GeneratedEngineBase

public abstract class GeneratedEngineBase
extends Object

Base class for generated inference engines.


Field Summary
protected  double[][] ad
          these five arrays store partial results of belief calculations
protected  double[][] av
          these five arrays store partial results of belief calculations
protected  double[][] b
          b[i][j] = belief for state j of node i
protected  double[][] c
          c[i][j] = conditional probability for configuration j of node i
protected  double[][] e
          e[i][j] = evidence for state j of node i
protected  double[][] ed
          these five arrays store partial results of belief calculations
protected  double[][] md
          these five arrays store partial results of belief calculations
protected  boolean modified
          true when something changed and beliefs need to be recalculated
protected  double[][] mv
          these five arrays store partial results of belief calculations
protected  String[] n
          n[i] = name of node i
protected  String[][] s
          s[i][j] = name of state j of node i
 
Constructor Summary
protected GeneratedEngineBase()
           
 
Method Summary
protected abstract  int[] addNodeLengths()
           
protected abstract  void calculateBeliefs0()
           
 void clearAllEvidence()
           
 void clearEvidence(int variable)
           
protected abstract  double[][] condProbs()
           
 double[] getBeliefs(int variable)
           
 double getConditionalProbability(int variable, int configuration)
           
 double[] getEvidence(int variable)
           
 int getStateCount(int variable)
           
 String[] getStates(int variable)
           
 int getVariable(String name)
           
 int getVariableCount()
           
 String getVariableName(int variable)
           
protected abstract  int[] multiplyNodeLengths()
           
protected abstract  String[] nodeNames()
           
 void setConditionalProbability(int variable, int configuration, double probability)
           
 void setEvidence(int variable, double[] evidence)
           
protected abstract  String[][] stateNames()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

b

protected final double[][] b
b[i][j] = belief for state j of node i


modified

protected boolean modified
true when something changed and beliefs need to be recalculated


mv

protected final double[][] mv
these five arrays store partial results of belief calculations


md

protected final double[][] md
these five arrays store partial results of belief calculations


av

protected final double[][] av
these five arrays store partial results of belief calculations


ad

protected final double[][] ad
these five arrays store partial results of belief calculations


ed

protected final double[][] ed
these five arrays store partial results of belief calculations


e

protected double[][] e
e[i][j] = evidence for state j of node i


c

protected double[][] c
c[i][j] = conditional probability for configuration j of node i


n

protected final String[] n
n[i] = name of node i


s

protected final String[][] s
s[i][j] = name of state j of node i

Constructor Detail

GeneratedEngineBase

protected GeneratedEngineBase()
Method Detail

addNodeLengths

protected abstract int[] addNodeLengths()

multiplyNodeLengths

protected abstract int[] multiplyNodeLengths()

condProbs

protected abstract double[][] condProbs()

stateNames

protected abstract String[][] stateNames()

nodeNames

protected abstract String[] nodeNames()

calculateBeliefs0

protected abstract void calculateBeliefs0()

getBeliefs

public final double[] getBeliefs(int variable)

getEvidence

public final double[] getEvidence(int variable)

setEvidence

public final void setEvidence(int variable,
                              double[] evidence)

clearEvidence

public final void clearEvidence(int variable)

clearAllEvidence

public final void clearAllEvidence()

getConditionalProbability

public final double getConditionalProbability(int variable,
                                              int configuration)

setConditionalProbability

public final void setConditionalProbability(int variable,
                                            int configuration,
                                            double probability)

getVariable

public final int getVariable(String name)

getVariableName

public final String getVariableName(int variable)

getStates

public final String[] getStates(int variable)

getVariableCount

public final int getVariableCount()

getStateCount

public final int getStateCount(int variable)