Class AbstractBigraphMatcher<B extends Bigraph<? extends Signature<?>>>

java.lang.Object
org.bigraphs.framework.simulation.matching.AbstractBigraphMatcher<B>
Type Parameters:
B - the type of bigraph which extends from Bigraph with a specific signature
Direct Known Subclasses:
PureBigraphMatcher

public abstract class AbstractBigraphMatcher<B extends Bigraph<? extends Signature<?>>> extends Object
Abstract class for matching bigraphs against reaction rules. This class provides the basic structure for implementing specific bigraph matchers by extending its functionality. Subclasses are required to provide implementations for custom matching logic and driven by a dedicated matching engine instantiateEngine() w.r.t. to the bigraph type.

The correct one, is created using the factory method create(Class) by supplying the bigraph type as class.

The matcher needs an agent and redex to perform bigraph matching.

Author:
Dominik Grzelak
  • Field Details

  • Constructor Details

    • AbstractBigraphMatcher

      protected AbstractBigraphMatcher()
  • Method Details

    • create

      public static <B extends Bigraph<? extends Signature<?>>> AbstractBigraphMatcher<B> create(Class<B> bigraphClass)
    • match

      @Deprecated public abstract MatchIterable<? extends BigraphMatch<B>> match(B agent, ReactionRule<B> rule)
      Deprecated.
      Use matchAll instead of match(); or use matchFirst() (constrained variant)
    • matchAll

      public MatchIterable<? extends BigraphMatch<B>> matchAll(B agent, ReactionRule<B> rule)
      Finds all matches of a specified reaction rule within a given pure bigraph.
      Parameters:
      agent - the pure bigraph in which to search for matches.
      rule - the reaction rule containing the redex to be matched against the agent.
      Returns:
      an iterable collection of matches of type M found in the given pure bigraph agent.
    • matchFirst

      public MatchIterable<? extends BigraphMatch<B>> matchFirst(B agent, ReactionRule<B> rule)
      Finds the first match of a specified reaction rule within a given pure bigraph.
      Parameters:
      agent - the pure bigraph in which to search for the first match.
      rule - the reaction rule containing the redex to be matched against the agent.
      Returns:
      an iterable collection containing the first match of type M found in the given pure bigraph agent.
    • instantiateEngine

      protected abstract BigraphMatchingEngine<B> instantiateEngine()
      Provide the matching engine for the specific bigraph type implemented by the subclass
      Returns:
      concrete bigraph matching engine
    • getAgent

      public B getAgent()
      Returns the supplied agent passed via the match(Bigraph, ReactionRule) method.
      Returns:
      the agent for the match
    • getRedex

      public B getRedex()
      Returns the supplied redex passed via the match(Bigraph, ReactionRule) method.
      Returns:
      the redex for the match
    • matchAllInternal

      protected MatchIterable<? extends BigraphMatch<B>> matchAllInternal(B agent, ReactionRule<B> rule, boolean firstOnly)