org.drools.beliefs.bayes
Class JunctionTreeBuilder
java.lang.Object
org.drools.beliefs.bayes.JunctionTreeBuilder
public class JunctionTreeBuilder
- extends Object
|
Method Summary |
JunctionTree |
build()
|
JunctionTree |
build(boolean init)
|
static boolean[][] |
cloneAdjacencyMarix(boolean[][] src)
Clones the provided array |
static void |
connect(boolean[][] adjMatrix,
int v1,
int v2)
|
void |
createClique(int v,
boolean[][] clonedAdjMatrix,
Set<Integer> verticesToUpdate,
boolean[] adjList)
|
int |
createJunctionTreeGraph(SeparatorSet[][] sepGraph,
JunctionTreeClique parent,
JunctionTreeClique[] jtNodes,
JunctionTreeSeparator[] jtSeps,
int i)
|
static void |
disconnect(boolean[][] adjMatrix,
int v1,
int v2)
|
void |
eliminateVertex(PriorityQueue<EliminationCandidate> p,
Map<Integer,EliminationCandidate> elmVertMap,
boolean[][] clonedAdjMatrix,
boolean[] adjList,
Set<Integer> verticesToUpdate,
EliminationCandidate v)
|
boolean[][] |
getAdjacencyMatrix()
|
static List<Integer> |
getAdjacentVertices(boolean[][] adjacencyMatrix,
int i)
|
Graph<BayesVariable> |
getGraph()
|
JunctionTree |
junctionTree(List<OpenBitSet> cliques,
boolean init)
|
void |
mapNodeToCliqueFamily(OpenBitSet[] varNodeToCliques,
JunctionTreeClique[] jtNodes)
Given the set of cliques, mapped via ID in a Bitset, for a given bayes node,
Find the best clique. |
void |
mapVarNodeToCliques(OpenBitSet[] nodeToCliques,
int id,
OpenBitSet clique)
Maps each Bayes node to cliques it's in. |
void |
mergeGraphs(SeparatorSet[][][] graphs,
SeparatorSet separatorSet)
|
void |
moralize()
|
void |
moralize(GraphNode<BayesVariable> v,
GraphNode v1)
|
List<OpenBitSet> |
triangulate()
|
static void |
updateCliques(List<OpenBitSet> cliques,
OpenBitSet newClique)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JunctionTreeBuilder
public JunctionTreeBuilder(Graph<BayesVariable> graph)
getGraph
public Graph<BayesVariable> getGraph()
build
public JunctionTree build()
build
public JunctionTree build(boolean init)
moralize
public void moralize()
moralize
public void moralize(GraphNode<BayesVariable> v,
GraphNode v1)
connect
public static void connect(boolean[][] adjMatrix,
int v1,
int v2)
disconnect
public static void disconnect(boolean[][] adjMatrix,
int v1,
int v2)
triangulate
public List<OpenBitSet> triangulate()
eliminateVertex
public void eliminateVertex(PriorityQueue<EliminationCandidate> p,
Map<Integer,EliminationCandidate> elmVertMap,
boolean[][] clonedAdjMatrix,
boolean[] adjList,
Set<Integer> verticesToUpdate,
EliminationCandidate v)
createClique
public void createClique(int v,
boolean[][] clonedAdjMatrix,
Set<Integer> verticesToUpdate,
boolean[] adjList)
updateCliques
public static void updateCliques(List<OpenBitSet> cliques,
OpenBitSet newClique)
getAdjacencyMatrix
public boolean[][] getAdjacencyMatrix()
cloneAdjacencyMarix
public static boolean[][] cloneAdjacencyMarix(boolean[][] src)
- Clones the provided array
- Parameters:
src -
- Returns:
- a new clone of the provided array
junctionTree
public JunctionTree junctionTree(List<OpenBitSet> cliques,
boolean init)
mergeGraphs
public void mergeGraphs(SeparatorSet[][][] graphs,
SeparatorSet separatorSet)
createJunctionTreeGraph
public int createJunctionTreeGraph(SeparatorSet[][] sepGraph,
JunctionTreeClique parent,
JunctionTreeClique[] jtNodes,
JunctionTreeSeparator[] jtSeps,
int i)
mapNodeToCliqueFamily
public void mapNodeToCliqueFamily(OpenBitSet[] varNodeToCliques,
JunctionTreeClique[] jtNodes)
- Given the set of cliques, mapped via ID in a Bitset, for a given bayes node,
Find the best clique. Where best clique is one that contains all it's parents
with the smallest number of nodes in that clique. When there are no parents
then simply pick the clique with the smallest number nodes.
- Parameters:
varNodeToCliques - jtNodes -
mapVarNodeToCliques
public void mapVarNodeToCliques(OpenBitSet[] nodeToCliques,
int id,
OpenBitSet clique)
- Maps each Bayes node to cliques it's in.
It uses a BitSet to map the ID of the cliques
- Parameters:
nodeToCliques - id - clique -
getAdjacentVertices
public static List<Integer> getAdjacentVertices(boolean[][] adjacencyMatrix,
int i)
Copyright © 2001-2014 JBoss by Red Hat. All Rights Reserved.