Class BayesEdge
java.lang.Object
de.uka.ipd.sdq.dsexplore.bayesnets.utility.BayesEdge
Contains utilities to make changes to edges of a Bayesian Network.
With this class, you can add, remove or reverse an edge between any
two nodes in the Bayesian Network.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint[][]
addEdge
(int[][] Graph, int FromNode, int ToNode) Adds an edge between node FromNode to node ToNode.static void
int[][]
removeEdge
(int[][] Graph, int FromNode, int ToNode) Removes an edge between node FromNode to node ToNode.int[][]
reverseEdge
(int[][] Graph, int FromNode, int ToNode) Reverses an edge between node FromNode to node ToNode.
-
Constructor Details
-
BayesEdge
public BayesEdge()
-
-
Method Details
-
main
-
addEdge
public int[][] addEdge(int[][] Graph, int FromNode, int ToNode) Adds an edge between node FromNode to node ToNode. Note that the edge is directed and originates from FromNode and goes to ToNode.- Parameters:
int
- [][] Graph - The Bayesian network graph represented as a Adjacency matrix.int
- FromNode - An integer value specifying the originating nodeint
- ToNode - An integer value specifying the target node- Returns:
- The revised int[][] matrix representing the Graph. This is stored in a different memory location than the input int[][] Graph
-
removeEdge
public int[][] removeEdge(int[][] Graph, int FromNode, int ToNode) Removes an edge between node FromNode to node ToNode. Note that this method removes the edge which is directed and originates from FromNode and goes to ToNode. If no such directed edge exists, then the method prints out the appropriate message.- Parameters:
int
- [][] Graph - The Bayesian network graph represented as a Adjacency matrix.int
- FromNode - An integer value specifying the originating nodeint
- ToNode - An integer value specifying the target node- Returns:
- The revised int[][] matrix representing the Graph. This is stored in a different memory location than the input int[][] Graph
-
reverseEdge
public int[][] reverseEdge(int[][] Graph, int FromNode, int ToNode) Reverses an edge between node FromNode to node ToNode. If no such edge exists, then the appropriate message is displayed.- Parameters:
int
- [][] Graph - The Bayesian network graph represented as a Adjacency matrix.int
- FromNode - An integer value specifying the originating nodeint
- ToNode - An integer value specifying the target node- Returns:
- The revised int[][] matrix representing the Graph. This is stored in a different memory location than the input int[][] Graph
-