Package org.oristool.analyzer.graph
Class SuccessionGraph
java.lang.Object
org.oristool.analyzer.graph.SuccessionGraph
A graph of
Succession
objects.
Multiple successions can be associated with the same ordered pair of nodes.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Adds a succession to the graph.Returns a copy of all incoming successions of a node.getNodes()
Returns a copy of all outgoing successions of a node.getRoot()
Returns a copy of all successions in the graph.getSuccessions
(Node n1, Node n2) modifyStates
(UnaryOperator<State> stateChange) Modifies this graph by applying a function to each state.
-
Constructor Details
-
SuccessionGraph
public SuccessionGraph()
-
-
Method Details
-
addSuccession
Adds a succession to the graph.The parent state of the succession must be already present in the graph.
If the succession has no parent state, the child state is used as root of the graph.
- Parameters:
s
- input succession- Returns:
- true if the child node of the succession was not present in the graph
-
getRoot
-
getNodes
-
getPredecessors
-
getSuccessors
-
getState
-
getNode
-
getStates
-
getSuccessions
Returns a copy of all successions in the graph.- Returns:
- a set of successions
-
getSuccessions
-
getIncomingSuccessions
Returns a copy of all incoming successions of a node.- Parameters:
n
- input node- Returns:
- a set of successions
-
getOutgoingSuccessions
Returns a copy of all outgoing successions of a node.- Parameters:
n
- input node- Returns:
- a set of successions
-
modifyStates
Modifies this graph by applying a function to each state. This can also modify the structure of the graph (confluences can be introduced or removed).- Parameters:
stateChange
- function applied to each state- Returns:
- resulting graph
-