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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <B extends Bigraph<? extends Signature<?>>>
AbstractBigraphMatcher<B> getAgent()Returns the supplied agent passed via thematch(Bigraph, ReactionRule)method.getRedex()Returns the supplied redex passed via thematch(Bigraph, ReactionRule)method.protected abstract BigraphMatchingEngine<B> Provide the matching engine for the specific bigraph type implemented by the subclassabstract MatchIterable<? extends BigraphMatch<B>> match(B agent, ReactionRule<B> rule) Deprecated.MatchIterable<? extends BigraphMatch<B>> matchAll(B agent, ReactionRule<B> rule) Finds all matches of a specified reaction rule within a given pure bigraph.protected MatchIterable<? extends BigraphMatch<B>> matchAllInternal(B agent, ReactionRule<B> rule, boolean firstOnly) MatchIterable<? extends BigraphMatch<B>> matchFirst(B agent, ReactionRule<B> rule) Finds the first match of a specified reaction rule within a given pure bigraph.
-
Field Details
-
LOGGER
protected static final org.slf4j.Logger LOGGER -
agent
-
redex
-
rule
-
-
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
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
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
Provide the matching engine for the specific bigraph type implemented by the subclass- Returns:
- concrete bigraph matching engine
-
getAgent
Returns the supplied agent passed via thematch(Bigraph, ReactionRule)method.- Returns:
- the agent for the match
-
getRedex
Returns the supplied redex passed via thematch(Bigraph, ReactionRule)method.- Returns:
- the redex for the match
-
matchAllInternal
protected MatchIterable<? extends BigraphMatch<B>> matchAllInternal(B agent, ReactionRule<B> rule, boolean firstOnly)
-