edu.ksu.cis.bnj.bbn
Class BBNGraph

java.lang.Object
  extended bysalvo.jesus.graph.GraphImpl
      extended bysalvo.jesus.graph.DirectedGraphImpl
          extended bysalvo.jesus.graph.DirectedAcyclicGraphImpl
              extended byedu.ksu.cis.kdd.util.graph.Graph
                  extended byedu.ksu.cis.bnj.bbn.BBNGraph
All Implemented Interfaces:
salvo.jesus.graph.DirectedAcyclicGraph, salvo.jesus.graph.DirectedGraph, salvo.jesus.graph.Graph, HasProperty, java.io.Serializable
Direct Known Subclasses:
CliqueTree, PRMGraph

public class BBNGraph
extends Graph

A Wrapper for BBN Graph

Author:
Roby Joehanes
See Also:
Serialized Form

Field Summary
static java.lang.String BIF_FORMAT
           
static java.lang.String DSC_FORMAT
           
static java.lang.String DSL_FORMAT
           
static java.lang.String ERGO_FORMAT
           
static java.lang.String HUGIN_FORMAT
           
static java.lang.String LIBB_FORMAT
           
static java.lang.String XBN_FORMAT
           
static java.lang.String XML_FORMAT
           
 
Fields inherited from class edu.ksu.cis.kdd.util.graph.Graph
name, nodeTable, property
 
Fields inherited from class salvo.jesus.graph.GraphImpl
factory, traversal
 
Constructor Summary
BBNGraph()
           
 
Method Summary
 void clearEvidenceNodes()
          Make all evidence nodes lose their evidence value
 java.lang.Object clone()
          Perform a deep clone on the graph.
 boolean equals(java.lang.Object o)
          Equality check.
 java.util.Set getEvidenceNodes()
          Return the set of evidence nodes.
 java.util.Hashtable getEvidenceTable()
          Get a table of node name -> evidence value
 java.util.Set getQueryNodes()
          Return the set of query nodes.
 boolean isModified()
          isModified keeps track of any changes that may have been made to this graph.
static BBNGraph load(java.lang.String filename)
          Convenience function for loading graph out of a file.
static BBNGraph load(java.lang.String filename, java.lang.String format)
          Convenience function for loading graph out of a file.
 void loadEvidence(java.lang.String filename)
          Convenience function to load evidences out of an XEB file.
 void resetNodeCaches()
          Reset all node caches.
 void save(java.lang.String filename)
          Convenience function to save graph to an xmlbif format
 void save(java.lang.String filename, java.lang.String format)
          Convenience function to save graph to a file with a specified format
 void saveEvidence(java.lang.String filename)
          Convenience function to save evidences out to an XEB file.
 void setEvidenceNodes(java.util.Hashtable tbl)
           
 void setEvidenceTable(java.util.Hashtable tbl)
          Set the evidence values based on the table.
 java.lang.String toString()
          For Debugging
 
Methods inherited from class edu.ksu.cis.kdd.util.graph.Graph
add, addEdge, addNode, addNodes, containsNode, getAdjacencyList, getEdges, getError, getName, getNode, getNodeList, getNodeNames, getNodes, getProperty, getProperty, getReverseAdjacencyList, hashCode, putProperty, remove, removeEdge, removeNode, removeProperty, setName, setProperty
 
Methods inherited from class salvo.jesus.graph.DirectedAcyclicGraphImpl
getRoot, reverseTopologicalSort, reverseTopologicalSort, topologicalSort, topologicalSort
 
Methods inherited from class salvo.jesus.graph.DirectedGraphImpl
getEdge, getIncomingAdjacentVertices, getIncomingEdges, getOutgoingAdjacentVertices, getOutgoingEdges, isCycle, isPath
 
Methods inherited from class salvo.jesus.graph.GraphImpl
addEdge, addGraphAddEdgeListener, addGraphAddVertexListener, addGraphRemoveEdgeListener, addGraphRemoveVertexListener, addListener, cloneVertices, containsEdge, containsVertex, forgetConnectedSets, getAdjacentVertices, getAdjacentVertices, getConnectedSet, getConnectedSet, getDegree, getDegree, getEdges, getEdgesCount, getEdgeSet, getGraphFactory, getTraversal, getVertexSet, getVertices, getVerticesCount, getVerticesIterator, isConnected, removeEdge, removeEdges, removeGraphAddEdgeListener, removeGraphAddVertexListener, removeGraphRemoveEdgeListener, removeGraphRemoveVertexListener, removeListener, setGraphFactory, setTraversal, traverse
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface salvo.jesus.graph.DirectedGraph
getEdge, getIncomingAdjacentVertices, getIncomingEdges, getOutgoingAdjacentVertices, getOutgoingEdges, isCycle, isPath
 
Methods inherited from interface salvo.jesus.graph.Graph
addEdge, addGraphAddEdgeListener, addGraphAddVertexListener, addGraphRemoveEdgeListener, addGraphRemoveVertexListener, addListener, cloneVertices, getAdjacentVertices, getAdjacentVertices, getConnectedSet, getConnectedSet, getDegree, getDegree, getEdges, getEdgesCount, getEdgeSet, getGraphFactory, getTraversal, getVertexSet, getVertices, getVerticesCount, getVerticesIterator, isConnected, removeEdge, removeEdges, removeGraphAddEdgeListener, removeGraphAddVertexListener, removeGraphRemoveEdgeListener, removeGraphRemoveVertexListener, removeListener, setGraphFactory, setTraversal, traverse
 

Field Detail

XML_FORMAT

public static final java.lang.String XML_FORMAT
See Also:
Constant Field Values

BIF_FORMAT

public static final java.lang.String BIF_FORMAT
See Also:
Constant Field Values

HUGIN_FORMAT

public static final java.lang.String HUGIN_FORMAT
See Also:
Constant Field Values

XBN_FORMAT

public static final java.lang.String XBN_FORMAT
See Also:
Constant Field Values

DSC_FORMAT

public static final java.lang.String DSC_FORMAT
See Also:
Constant Field Values

DSL_FORMAT

public static final java.lang.String DSL_FORMAT
See Also:
Constant Field Values

LIBB_FORMAT

public static final java.lang.String LIBB_FORMAT
See Also:
Constant Field Values

ERGO_FORMAT

public static final java.lang.String ERGO_FORMAT
See Also:
Constant Field Values
Constructor Detail

BBNGraph

public BBNGraph()
Method Detail

getEvidenceNodes

public java.util.Set getEvidenceNodes()
Return the set of evidence nodes.

Returns:
Set

getEvidenceTable

public java.util.Hashtable getEvidenceTable()
Get a table of node name -> evidence value

Returns:
Hashtable

clearEvidenceNodes

public void clearEvidenceNodes()
Make all evidence nodes lose their evidence value


setEvidenceTable

public void setEvidenceTable(java.util.Hashtable tbl)
Set the evidence values based on the table. The table is from node name -> evidence value.

Parameters:
tbl -

getQueryNodes

public java.util.Set getQueryNodes()
Return the set of query nodes.

Returns:
Set

resetNodeCaches

public void resetNodeCaches()
Reset all node caches.

See Also:
edu.ksu.cis.bnj.bbn.BBNNode#precache

equals

public boolean equals(java.lang.Object o)
Equality check. Simple name and nodes check

Overrides:
equals in class Graph
See Also:
Object.equals(Object)

setEvidenceNodes

public void setEvidenceNodes(java.util.Hashtable tbl)

toString

public java.lang.String toString()
For Debugging

Overrides:
toString in class Graph
See Also:
Object.toString()

load

public static BBNGraph load(java.lang.String filename)
Convenience function for loading graph out of a file.

Parameters:
filename -
Returns:
BBNGraph

load

public static BBNGraph load(java.lang.String filename,
                            java.lang.String format)
Convenience function for loading graph out of a file.

Parameters:
filename -
format - Format string
Returns:
BBNGraph

save

public void save(java.lang.String filename,
                 java.lang.String format)
Convenience function to save graph to a file with a specified format

Parameters:
filename -
format -

save

public void save(java.lang.String filename)
Convenience function to save graph to an xmlbif format

Parameters:
filename -

loadEvidence

public void loadEvidence(java.lang.String filename)
Convenience function to load evidences out of an XEB file.

Parameters:
filename -

saveEvidence

public void saveEvidence(java.lang.String filename)
Convenience function to save evidences out to an XEB file.

Parameters:
filename -

clone

public java.lang.Object clone()
Perform a deep clone on the graph. (Expensive operation)

See Also:
Object.clone()

isModified

public boolean isModified()
isModified keeps track of any changes that may have been made to this graph.