edu.ksu.cis.bnj.bbn.inference.pearl
Class Pearl
java.lang.Object
edu.ksu.cis.bnj.bbn.inference.Inference
edu.ksu.cis.bnj.bbn.inference.ExactInference
edu.ksu.cis.bnj.bbn.inference.pearl.Pearl
- All Implemented Interfaces:
- Optionable
- public class Pearl
- extends ExactInference
Class Pearl : implements pearl algorithm to perform exact inference in polytrees
Main methods : sendPiMessage, sendLambdaMessage, initializeRootPiValues, updateTree
- Author:
- Siddarth Chandak
Method Summary |
InferenceResult |
addProbability()
|
InferenceResult |
addZeroProbability()
|
int |
checkForArity(BBNNode currNode)
|
void |
finishedInstantiation(java.util.Hashtable csValues)
|
java.util.Hashtable |
getJointProbabilityTable()
|
InferenceResult |
getMarginals()
Getting the result of the marginals (i.e. the belief revision) |
java.lang.String |
getName()
|
Info |
getNodeInfo(BBNNode v)
|
int |
getNumberOfChildren(BBNNode currNode)
|
int |
getNumberOfParents(BBNNode currNode)
|
java.util.Vector |
getParentsArity(BBNNode currNode)
|
protected java.util.Set |
getUniqueInstantiation(java.util.LinkedList nodes,
java.util.Hashtable curInst,
java.util.HashSet set)
|
InferenceResult |
inferWithEvidence(java.util.Hashtable csValues,
int indexH)
|
void |
initializeForCutset(BBNGraph g,
java.util.Hashtable nodesWithoutPredecessors,
java.util.Hashtable nodesWithPredecessors,
java.util.List topologicalOrder,
java.util.Hashtable cutsetTable)
|
java.util.Hashtable |
initNodesWithoutPredecessors()
|
InferenceResult |
initNodesWithPredecessors(java.util.Hashtable csValues,
java.util.LinkedList csNodes,
java.util.Hashtable csInfoTable,
int indexH)
|
double |
instantiateNode(BBNNode node,
java.lang.String value)
|
static void |
main(java.lang.String[] args)
|
InferenceResult |
multiplyByWeight(double weight)
|
void |
setCurrNodeChildIndex(BBNNode currNode,
Info nInfo)
|
void |
setCurrNodeParentIndex(BBNNode currNode,
Info nInfo)
|
void |
setCurrNodeValueTable(BBNNode currNode,
Info nInfo)
|
void |
setNodeInfoValues()
|
Methods inherited from class edu.ksu.cis.bnj.bbn.inference.Inference |
execute, getCurrentOptions, getDefaultOptions, getGraph, getMAP, getMarginalsResult, getMPE, getOptionsDialog, getOutputFile, getRunType, load, setGraph, setOption, setOptions, setOutputFile, setRunType |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
infoTable
protected java.util.Hashtable infoTable
order
protected java.util.List order
nodeInfo
protected Info[] nodeInfo
graph
protected BBNGraph graph
evidenceNodes
protected java.util.Hashtable evidenceNodes
cutsetNodes
protected java.util.Hashtable cutsetNodes
hashOfHash
protected java.util.Hashtable[] hashOfHash
jointProbTable
protected java.util.Hashtable jointProbTable
marginalProbabilityTable
protected InferenceResult marginalProbabilityTable
ceTable
protected java.util.Hashtable ceTable
Pearl
public Pearl()
Pearl
public Pearl(BBNGraph g)
instantiateNode
public double instantiateNode(BBNNode node,
java.lang.String value)
initNodesWithPredecessors
public InferenceResult initNodesWithPredecessors(java.util.Hashtable csValues,
java.util.LinkedList csNodes,
java.util.Hashtable csInfoTable,
int indexH)
inferWithEvidence
public InferenceResult inferWithEvidence(java.util.Hashtable csValues,
int indexH)
initializeForCutset
public void initializeForCutset(BBNGraph g,
java.util.Hashtable nodesWithoutPredecessors,
java.util.Hashtable nodesWithPredecessors,
java.util.List topologicalOrder,
java.util.Hashtable cutsetTable)
initNodesWithoutPredecessors
public java.util.Hashtable initNodesWithoutPredecessors()
finishedInstantiation
public void finishedInstantiation(java.util.Hashtable csValues)
getJointProbabilityTable
public java.util.Hashtable getJointProbabilityTable()
getNodeInfo
public Info getNodeInfo(BBNNode v)
getNumberOfChildren
public int getNumberOfChildren(BBNNode currNode)
getNumberOfParents
public int getNumberOfParents(BBNNode currNode)
checkForArity
public int checkForArity(BBNNode currNode)
getParentsArity
public java.util.Vector getParentsArity(BBNNode currNode)
setCurrNodeValueTable
public void setCurrNodeValueTable(BBNNode currNode,
Info nInfo)
setCurrNodeParentIndex
public void setCurrNodeParentIndex(BBNNode currNode,
Info nInfo)
setCurrNodeChildIndex
public void setCurrNodeChildIndex(BBNNode currNode,
Info nInfo)
addZeroProbability
public InferenceResult addZeroProbability()
addProbability
public InferenceResult addProbability()
setNodeInfoValues
public void setNodeInfoValues()
multiplyByWeight
public InferenceResult multiplyByWeight(double weight)
getUniqueInstantiation
protected java.util.Set getUniqueInstantiation(java.util.LinkedList nodes,
java.util.Hashtable curInst,
java.util.HashSet set)
getName
public java.lang.String getName()
- Specified by:
getName
in class Inference
getMarginals
public InferenceResult getMarginals()
- Description copied from class:
Inference
- Getting the result of the marginals (i.e. the belief revision)
- Specified by:
getMarginals
in class Inference
- Returns:
- InferenceResult The marginals
main
public static void main(java.lang.String[] args)