Class AbstractTransitionSystem<B,T>

java.lang.Object
org.bigraphs.framework.core.reactivesystem.AbstractTransitionSystem<B,T>
Type Parameters:
B - the bigraph type of the states
T - the type for the data attached to the transition relations of type AbstractTransitionSystem<B,T>.Transition
Direct Known Subclasses:
ReactionGraph

public class AbstractTransitionSystem<B,T> extends Object
Abstract base class representing the minimal data structure for all concrete transition system implementations. This class generalizes all possible variations of transition systems.
Author:
Dominik Grzelak
  • Field Details

    • initialStateLabels

      protected final Set<String> initialStateLabels
    • stateMap

      protected final Map<String,B> stateMap
    • transitionMap

      protected final Map<String,List<T>> transitionMap
    • canonicalNodeLabel

      protected boolean canonicalNodeLabel
    • aSup

      protected Supplier<String> aSup
  • Constructor Details

    • AbstractTransitionSystem

      public AbstractTransitionSystem()
  • Method Details

    • createSupplier

      protected Supplier<String> createSupplier()
    • addState

      public void addState(String sourceLbl, B source)
    • getInitialStateLabels

      public Set<String> getInitialStateLabels()
    • addInitialStateLabels

      public AbstractTransitionSystem<B,T> addInitialStateLabels(String... labels)
    • getTransitionMap

      public Map<String,List<T>> getTransitionMap()
      Get the actual redex of a rule by querying the string label of a transition.

      Note that the label could either be an arbitrary string (user-defined) or the canonical form of the bigraph (redex).

      Returns:
      a map where transition labels are mapped to bigraphs (redexes)
    • getTransitionRelations

      public Map<B,Set<AbstractTransitionSystem<B,T>.Transition>> getTransitionRelations()
    • getStateMap

      public Map<String,B> getStateMap()
      Get the actual bigraph by querying the string label of a state.

      Note that the label could either be an arbitrary string (user-defined) or the canonical form of the bigraph.

      Returns:
      a map where state labels are mapped to bigraphs
    • getStates

      public Set<B> getStates()
    • getStatesWithoutFinalStates

      public Set<B> getStatesWithoutFinalStates()
    • containsBigraph

      public boolean containsBigraph(String label)
      Check if a bigraph is present in the graph as a state. The bigraph is identified by its label.

      The label of a bigraph must be unique.

      Parameters:
      label - The unique label of a bigraph to find in the reaction graph.
      Returns:
      true, if the bigraph is contained in the graph, otherwise false
    • getTransitions

      public Set<AbstractTransitionSystem<B,T>.Transition> getTransitions(B state)
      This methods returns all transitions from a state Thus, it gets all possible next states (represented as AbstractTransitionSystem<B,T>.Transition) that can be reached from the given state. That is, only out-going transition relations are considered.
      Parameters:
      state - the state in question to get all successor states.
      Returns:
      possible out-going transitions reachable from a given state
    • getLabelByState

      public Optional<String> getLabelByState(B state)
      This doesnt work with source/target states coming from Transition. Its better to compute the canonical string encoding directly to get the label.
      Parameters:
      state -
      Returns:
    • getStateByLabel

      public Optional<B> getStateByLabel(String stateLabel)
    • addTransition

      public void addTransition(B source, B target, String reactionLbl, T transitionRelationObject)
    • removeState

      public void removeState(B state)