java.lang.Object
org.bigraphs.framework.core.reactivesystem.AbstractSimpleReactiveSystem<B>
- All Implemented Interfaces:
ReactiveSystem<B>
- Direct Known Subclasses:
AbstractSimpleReactiveSystem.TransitionSystemBoundSimpleReactiveSystem
,PureReactiveSystem
public abstract class AbstractSimpleReactiveSystem<B extends Bigraph<? extends Signature<?>>>
extends Object
implements ReactiveSystem<B>
Abstract class of a "nice and simple" bigraphical reactive system (BRS).
For all available bigraph types the corresponding reactive system implementation extends this class for the implementation of their own specific nice and simple BRS.
The required composition instructions using the deconstructed match result (see BigraphMatch
) to compute the
new agent, are implemented by the subclasses. The methods buildGroundReaction
and buildParametricReaction
are made abstract here to make this clear.
- Author:
- Dominik Grzelak
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
AbstractSimpleReactiveSystem.TransitionSystemBoundSimpleReactiveSystem<B extends Bigraph<? extends Signature<?>>>
A bigraphical reactive system (BRS) bounded to a reaction graph. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected B
protected com.google.common.collect.BiMap<String,
ReactiveSystemPredicate<B>> protected com.google.common.collect.BiMap<String,
ReactionRule<B>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addPredicate
(ReactiveSystemPredicate<B> predicate) boolean
addReactionRule
(ReactionRule<B> reactionRule) void
assertAgentIsGround
(B agent) void
assertAgentIsPrime
(B agent) void
assertNoIdleOuterName
(ReactionRule<B> reactionRule) Throws anInvalidReactionRuleException
if an outer name of a given redex is idle (i.e., not connected to a point of the redex).void
assertParametricRedexIsSimple
(ReactionRule<B> reactionRule) Checks if a parametric redex is simple.abstract B
buildGroundReaction
(B agent, BigraphMatch<B> match, ReactionRule<B> rule) abstract B
buildParametricReaction
(B agent, BigraphMatch<B> match, ReactionRule<B> rule) protected void
copyAttributes
(B sourceBigraph, B targetBigraph) getAgent()
com.google.common.collect.BiMap<String,
ReactiveSystemPredicate<B>> Set<ReactionRule<B>>
Return the labels of the transition system which are called reaction rules for BRS.com.google.common.collect.BiMap<String,
ReactionRule<B>> protected boolean
hasIdleOuterNames
(B bigraph) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.bigraphs.framework.core.reactivesystem.ReactiveSystem
isSimple
-
Field Details
-
initialAgent
-
reactionRules
protected com.google.common.collect.BiMap<String,ReactionRule<B extends Bigraph<? extends Signature<?>>>> reactionRules -
predicateMap
protected com.google.common.collect.BiMap<String,ReactiveSystemPredicate<B extends Bigraph<? extends Signature<?>>>> predicateMap
-
-
Constructor Details
-
AbstractSimpleReactiveSystem
public AbstractSimpleReactiveSystem()
-
-
Method Details
-
buildGroundReaction
- Specified by:
buildGroundReaction
in interfaceReactiveSystem<B extends Bigraph<? extends Signature<?>>>
-
buildParametricReaction
- Specified by:
buildParametricReaction
in interfaceReactiveSystem<B extends Bigraph<? extends Signature<?>>>
-
assertParametricRedexIsSimple
public void assertParametricRedexIsSimple(ReactionRule<B> reactionRule) throws RedexIsNotSimpleException Checks if a parametric redex is simple. A parametric redex is simple if:- open: every link is open
- guarding: no site has a root as parent
- inner-injective: no two sites are siblings
Note that the
AbstractReactionRule
class also checks if the redex is simple.- Parameters:
reactionRule
- the reaction rule to be checked (redex is used)- Throws:
RedexIsNotSimpleException
- if the redex is not simple
-
assertAgentIsGround
- Throws:
AgentNotGroundException
-
assertAgentIsPrime
- Throws:
AgentNotPrimeException
-
assertNoIdleOuterName
Throws anInvalidReactionRuleException
if an outer name of a given redex is idle (i.e., not connected to a point of the redex).- Parameters:
reactionRule
- reaction rule where the outer names of the redex are checked- Throws:
InvalidReactionRuleException
- if outer name is idle.
-
hasIdleOuterNames
-
copyAttributes
-
getReactionRules
Description copied from interface:ReactiveSystem
Return the labels of the transition system which are called reaction rules for BRS.- Specified by:
getReactionRules
in interfaceReactiveSystem<B extends Bigraph<? extends Signature<?>>>
- Returns:
- the labels of the transition system
-
getReactionRulesMap
- Specified by:
getReactionRulesMap
in interfaceReactiveSystem<B extends Bigraph<? extends Signature<?>>>
-
getPredicateMap
- Specified by:
getPredicateMap
in interfaceReactiveSystem<B extends Bigraph<? extends Signature<?>>>
-
getPredicates
- Specified by:
getPredicates
in interfaceReactiveSystem<B extends Bigraph<? extends Signature<?>>>
-
addPredicate
-
addReactionRule
- Throws:
InvalidReactionRuleException
-
getSignature
- Specified by:
getSignature
in interfaceReactiveSystem<B extends Bigraph<? extends Signature<?>>>
-
getAgent
- Specified by:
getAgent
in interfaceReactiveSystem<B extends Bigraph<? extends Signature<?>>>
-
setAgent
-