Class SuccessionGraph

java.lang.Object
org.oristool.analyzer.graph.SuccessionGraph

public final class SuccessionGraph extends Object
A graph of Succession objects.

Multiple successions can be associated with the same ordered pair of nodes.

  • Constructor Details

    • SuccessionGraph

      public SuccessionGraph()
  • Method Details

    • addSuccession

      public boolean addSuccession(Succession s)
      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

      public Node getRoot()
    • getNodes

      public Set<Node> getNodes()
    • getPredecessors

      public Set<Node> getPredecessors(Node n)
    • getSuccessors

      public Set<Node> getSuccessors(Node n)
    • getState

      public State getState(Node n)
    • getNode

      public Node getNode(State s)
    • getStates

      public Set<State> getStates()
    • getSuccessions

      public Set<Succession> getSuccessions()
      Returns a copy of all successions in the graph.
      Returns:
      a set of successions
    • getSuccessions

      public Set<Succession> getSuccessions(Node n1, Node n2)
    • getIncomingSuccessions

      public Set<Succession> getIncomingSuccessions(Node n)
      Returns a copy of all incoming successions of a node.
      Parameters:
      n - input node
      Returns:
      a set of successions
    • getOutgoingSuccessions

      public Set<Succession> getOutgoingSuccessions(Node n)
      Returns a copy of all outgoing successions of a node.
      Parameters:
      n - input node
      Returns:
      a set of successions
    • modifyStates

      public SuccessionGraph modifyStates(UnaryOperator<State> stateChange)
      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