Interface EventSelectionStrategy
- All Known Implementing Classes:
AbstractEventSelectionStrategy
,AbstractEventSelectionStrategyDecorator
,LoggingEventSelectionStrategyDecorator
,OrderedEventSelectionStrategy
,PausingEventSelectionStrategyDecorator
,PrioritizedBSyncEventSelectionStrategy
,PrioritizedBThreadsEventSelectionStrategy
,SimpleEventSelectionStrategy
public interface EventSelectionStrategy
Strategy for selecting events from a set of
SyncStatement
s and an
external event queue.
This class has two methods, one for detecting the set of selectable events,
and the other for selecting the actual event. The former is useful in both
execution and model checking. The latter - in execution only.- Author:
- michael
-
Method Summary
Modifier and TypeMethodDescriptionselect
(BProgramSyncSnapshot bpss, Set<BEvent> selectableEvents) Selects an event for execution from the parameterselectableEvents
, or returnsOptional.empty()
in case no suitable event is found.Creates the set of selectable events, given a b-program's synchronization point.
-
Method Details
-
selectableEvents
Creates the set of selectable events, given a b-program's synchronization point.- Parameters:
bpss
- aBProgram
at a synchronization point.- Returns:
- A set of events that may be selected for execution.
-
select
Selects an event for execution from the parameterselectableEvents
, or returnsOptional.empty()
in case no suitable event is found. TheselectableEvents
set is Normally the set of events returned bythis
'selectableEvents(il.ac.bgu.cs.bp.bpjs.model.BProgramSyncSnapshot)
method on the previous call on the same synchronization point. This is an optimization that allows most strategies to select events only once per synchronization point. In normal BP, the selected event (if any) has to be a member ofselectableEvents
.- Parameters:
bpss
- aBProgram
at a synchronization point.selectableEvents
- A set of events to select from.- Returns:
- An event selection result, or no result.
-