java.lang.Object
org.bigraphs.framework.simulation.modelchecking.ModelCheckingStrategySupport<B>
- All Implemented Interfaces:
ModelCheckingStrategy<B>
- Direct Known Subclasses:
BreadthFirstStrategy,DepthFirstStrategy,RandomAgentModelCheckingStrategy,SimulatedAnnealingFrontierStrategy
public abstract class ModelCheckingStrategySupport<B extends Bigraph<? extends Signature<?>>>
extends Object
implements ModelCheckingStrategy<B>
Base class for supporting model checking strategy implementations.
Provides some useful method to keep subclasses simple.
- Author:
- Dominik Grzelak
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classModelCheckingStrategySupport.MatchResult<B extends Bigraph<? extends Signature<?>>> -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected JLibBigBigraphDecoderprotected JLibBigBigraphEncoderprotected booleanprotected org.slf4j.Loggerprotected BigraphModelChecker<B> protected intprotected PredicateChecker<B> protected ReactionRuleFilter<B> protected BigraphFilter<B> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidaddToWorklist(Collection<B> worklist, B bigraph) abstract Collection<B> protected voidevaluatePredicates(B agent, String canonical, String root) protected MatchIterable<BigraphMatch<B>> getBigraphMatches(ReactionRule<B> rule, B theAgent) Retrieves all matches of the given reaction rule for the provided agent bigraph.Returns the currently configured reaction rule filter.abstract BremoveNext(Collection<B> worklist) protected voidvoidsetReactionRuleFilter(ReactionRuleFilter<B> filter) Sets the reaction rule filter used during rule exploration.voidsetWorklistFilter(BigraphFilter<B> filter) Defaults toBigraphFilter.noop()unless a subclass overrides this to add logic.voidMain method for model checking.
-
Field Details
-
logger
protected org.slf4j.Logger logger -
modelChecker
-
predicateChecker
-
occurrenceCounter
protected int occurrenceCounter -
decoder
-
encoder
-
worklistFilter
-
reactionRuleFilter
-
isRunning
protected boolean isRunning
-
-
Constructor Details
-
ModelCheckingStrategySupport
public ModelCheckingStrategySupport() -
ModelCheckingStrategySupport
-
-
Method Details
-
createWorklist
-
removeNext
-
addToWorklist
-
resetOccurrenceCounter
protected void resetOccurrenceCounter() -
synthesizeTransitionSystem
public void synthesizeTransitionSystem()Main method for model checking. The mode of traversal can be changed by implementing thecreateWorklist()andremoveNext(Collection)methods.Alternatively, the #synthesizeTransitionSystem() method can be simply overridden.
- Specified by:
synthesizeTransitionSystemin interfaceModelCheckingStrategy<B extends Bigraph<? extends Signature<?>>>
-
getBigraphMatches
Retrieves all matches of the given reaction rule for the provided agent bigraph.Subclasses may override this method to introduce additional filtering, pruning strategies, or domain-specific constraints on the match set (e.g., restricting matches by attributes, spatial bounds, or metadata).
By default, this method delegates to the underlying
AbstractBigraphMatcher.- Parameters:
rule- the reaction rule whose redex will be matched against the agenttheAgent- the agent (host) bigraph in which matches should be searched- Returns:
- an iterable collection of all matches found for the given rule on the agent;
never
null, but may be empty if no matches exist. Depends onAbstractBigraphMatcher.
-
setWorklistFilter
Defaults toBigraphFilter.noop()unless a subclass overrides this to add logic.- Specified by:
setWorklistFilterin interfaceModelCheckingStrategy<B extends Bigraph<? extends Signature<?>>>- Parameters:
filter- the filter to apply, ifnull, the default noop is used.
-
getWorklistFilter
- Specified by:
getWorklistFilterin interfaceModelCheckingStrategy<B extends Bigraph<? extends Signature<?>>>
-
setReactionRuleFilter
Sets the reaction rule filter used during rule exploration. The filter decides whether a reaction rule should be considered for a given agent before computing matches.If
nullis provided,ReactionRuleFilter.alwaysAccept()will be used.- Specified by:
setReactionRuleFilterin interfaceModelCheckingStrategy<B extends Bigraph<? extends Signature<?>>>- Parameters:
filter- the reaction rule filter
-
getReactionRuleFilter
Returns the currently configured reaction rule filter.- Specified by:
getReactionRuleFilterin interfaceModelCheckingStrategy<B extends Bigraph<? extends Signature<?>>>- Returns:
- the reaction rule filter
-
evaluatePredicates
-