Package net.sf.tweety.logics.bpm.syntax
Class BpmnModel
- java.lang.Object
-
- net.sf.tweety.logics.bpm.syntax.BpmnModel
-
- All Implemented Interfaces:
java.lang.Iterable<BpmnNode>,BeliefBase,Graph<BpmnNode>
public class BpmnModel extends java.lang.Object implements Graph<BpmnNode>, BeliefBase
-
-
Field Summary
-
Fields inherited from interface net.sf.tweety.graphs.Graph
IGNORE_SELFLOOPS, INVERT_SELFLOOPS, REMOVE_SELFLOOPS
-
-
Constructor Summary
Constructors Constructor Description BpmnModel()
-
Method Summary
Modifier and Type Method Description booleanadd(Edge<BpmnNode> edge)Adds the given edge to this graph.booleanadd(BpmnNode node)Adds the given node to this graph.booleanareAdjacent(BpmnNode a, BpmnNode b)Returns "true" iff the two nodes are connected by a directed edge from a to b or an undirected edge.booleancontains(java.lang.Object obj)Returns "true" when this graph contains the given node or edge.booleanexistsDirectedPath(BpmnNode node1, BpmnNode node2)Checks whether there is a (directed) path from node1 to node2.MatrixgetAdjacencyMatrix()Returns the adjacency matrix of this graph (the order of the nodes is the same as returned by "iterator()").java.util.Collection<BpmnNode>getChildren(Node node)Returns the set of children (node connected via an undirected edge or a directed edge where the given node is the parent) of the given node.Graph<BpmnNode>getComplementGraph(int selfloops)Returns the complement graph of this graph, i.e.Edge<BpmnNode>getEdge(BpmnNode a, BpmnNode b)Returns the corresponding edge (a,b) if a and b are adjacent.java.util.Collection<? extends Edge<? extends BpmnNode>>getEdges()Returns the edges of this graph.SignaturegetMinimalSignature()Returns the signature of the language of this knowledge base.java.util.Collection<BpmnNode>getNeighbors(BpmnNode node)Returns the set of neighbors of the given node.java.util.Collection<BpmnNode>getNodes()Returns the nodes of this graph.intgetNumberOfNodes()Returns the number of nodes in this graph.java.util.Collection<BpmnNode>getParents(Node node)Returns the set of parents (node connected via an undirected edge or a directed edge where the given node is the child) of the given node.Graph<BpmnNode>getRestriction(java.util.Collection<BpmnNode> nodes)Returns copy of this graph consisting only of the given nodes and all corresponding edges.java.util.Collection<java.util.Collection<BpmnNode>>getStronglyConnectedComponents()Returns the strongly connected components of this graph.java.util.Collection<Graph<BpmnNode>>getSubgraphs()Returns the set of sub graphs of this graph.booleanhasSelfLoops()Returns "true" iff the graph has a self loop (an edge from a node to itself).booleanisWeightedGraph()Checks whether this graph only contains weighted edges.java.util.Iterator<BpmnNode>iterator()-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.sf.tweety.commons.BeliefBase
toString
-
-
-
-
Method Detail
-
getMinimalSignature
public Signature getMinimalSignature()
Description copied from interface:BeliefBaseReturns the signature of the language of this knowledge base.- Specified by:
getMinimalSignaturein interfaceBeliefBase- Returns:
- the signature of the language of this knowledge base.
-
add
public boolean add(BpmnNode node)
Description copied from interface:GraphAdds the given node to this graph.
-
add
public boolean add(Edge<BpmnNode> edge)
Description copied from interface:GraphAdds the given edge to this graph. If at least one of the nodes the given edge connects is not in the graph, an illegal argument exception is thrown.
-
getNodes
public java.util.Collection<BpmnNode> getNodes()
Description copied from interface:GraphReturns the nodes of this graph.
-
getNumberOfNodes
public int getNumberOfNodes()
Description copied from interface:GraphReturns the number of nodes in this graph.- Specified by:
getNumberOfNodesin interfaceGraph<BpmnNode>- Returns:
- the number of nodes in this graph.
-
areAdjacent
public boolean areAdjacent(BpmnNode a, BpmnNode b)
Description copied from interface:GraphReturns "true" iff the two nodes are connected by a directed edge from a to b or an undirected edge.- Specified by:
areAdjacentin interfaceGraph<BpmnNode>- Parameters:
a- some nodeb- some node- Returns:
- "true" iff the two nodes are connected by a directed edge from a to b or an undirected edge.
-
getEdge
public Edge<BpmnNode> getEdge(BpmnNode a, BpmnNode b)
Description copied from interface:GraphReturns the corresponding edge (a,b) if a and b are adjacent. Otherwise it returns null.
-
getEdges
public java.util.Collection<? extends Edge<? extends BpmnNode>> getEdges()
Description copied from interface:GraphReturns the edges of this graph.
-
iterator
public java.util.Iterator<BpmnNode> iterator()
-
contains
public boolean contains(java.lang.Object obj)
Description copied from interface:GraphReturns "true" when this graph contains the given node or edge.
-
getChildren
public java.util.Collection<BpmnNode> getChildren(Node node)
Description copied from interface:GraphReturns the set of children (node connected via an undirected edge or a directed edge where the given node is the parent) of the given node.- Specified by:
getChildrenin interfaceGraph<BpmnNode>- Parameters:
node- some node (must be in the graph).- Returns:
- the set of children of the given node.
-
getParents
public java.util.Collection<BpmnNode> getParents(Node node)
Description copied from interface:GraphReturns the set of parents (node connected via an undirected edge or a directed edge where the given node is the child) of the given node.- Specified by:
getParentsin interfaceGraph<BpmnNode>- Parameters:
node- some node (must be in the graph).- Returns:
- the set of parents of the given node.
-
existsDirectedPath
public boolean existsDirectedPath(BpmnNode node1, BpmnNode node2)
Description copied from interface:GraphChecks whether there is a (directed) path from node1 to node2.- Specified by:
existsDirectedPathin interfaceGraph<BpmnNode>- Parameters:
node1- some node.node2- some node.- Returns:
- "true" if there is a directed path from node1 to node2.
-
getNeighbors
public java.util.Collection<BpmnNode> getNeighbors(BpmnNode node)
Description copied from interface:GraphReturns the set of neighbors of the given node.- Specified by:
getNeighborsin interfaceGraph<BpmnNode>- Parameters:
node- some node (must be in the graph).- Returns:
- the set of neighbors of the given node.
-
getAdjacencyMatrix
public Matrix getAdjacencyMatrix()
Description copied from interface:GraphReturns the adjacency matrix of this graph (the order of the nodes is the same as returned by "iterator()").- Specified by:
getAdjacencyMatrixin interfaceGraph<BpmnNode>- Returns:
- the adjacency matrix of this graph
-
getComplementGraph
public Graph<BpmnNode> getComplementGraph(int selfloops)
Description copied from interface:GraphReturns the complement graph of this graph, i.e. the graph on the same set of vertices as this graph that connects two vertices v and w with an edge if and only if v and w are not connected in this graph.- Specified by:
getComplementGraphin interfaceGraph<BpmnNode>- Parameters:
selfloops- Indicates how to deal with selfloops:
IGNORE_SELFLOOPS - ignore self loops (don't add and don't remove)
INVERT_SELFLOOPS - deal with self loops like ordinary edges (add if not present and remove if present)
REMOVE_SELFLOOPS - simple remove self loops, but don't add new ones.- Returns:
- the complement graph of this graph.
-
getStronglyConnectedComponents
public java.util.Collection<java.util.Collection<BpmnNode>> getStronglyConnectedComponents()
Description copied from interface:GraphReturns the strongly connected components of this graph. A set of nodes is strongly connected, if there is a path from each node to each other. A set of nodes is called strongly connected component if it is strongly connected and maximal with respect to set inclusion.- Specified by:
getStronglyConnectedComponentsin interfaceGraph<BpmnNode>- Returns:
- the strongly connected components of this graph.
-
getSubgraphs
public java.util.Collection<Graph<BpmnNode>> getSubgraphs()
Description copied from interface:GraphReturns the set of sub graphs of this graph.- Specified by:
getSubgraphsin interfaceGraph<BpmnNode>- Returns:
- the set of sub graphs of this graph.
-
getRestriction
public Graph<BpmnNode> getRestriction(java.util.Collection<BpmnNode> nodes)
Description copied from interface:GraphReturns copy of this graph consisting only of the given nodes and all corresponding edges.- Specified by:
getRestrictionin interfaceGraph<BpmnNode>- Parameters:
nodes- a set of nodes- Returns:
- a graph.
-
hasSelfLoops
public boolean hasSelfLoops()
Description copied from interface:GraphReturns "true" iff the graph has a self loop (an edge from a node to itself).- Specified by:
hasSelfLoopsin interfaceGraph<BpmnNode>- Returns:
- "true" iff the graph has a self loop (an edge from a node to itself).
-
isWeightedGraph
public boolean isWeightedGraph()
Description copied from interface:GraphChecks whether this graph only contains weighted edges.- Specified by:
isWeightedGraphin interfaceGraph<BpmnNode>- Returns:
- "true" if all edges are weighted in this graph.
-
-