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 SyncStatements 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 Details

    • selectableEvents

      Set<BEvent> selectableEvents(BProgramSyncSnapshot bpss)
      Creates the set of selectable events, given a b-program's synchronization point.
      Parameters:
      bpss - a BProgram at a synchronization point.
      Returns:
      A set of events that may be selected for execution.
    • select

      Optional<EventSelectionResult> select(BProgramSyncSnapshot bpss, Set<BEvent> selectableEvents)
      Selects an event for execution from the parameter selectableEvents, or returns Optional.empty() in case no suitable event is found. The selectableEvents set is Normally the set of events returned by this' 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 of selectableEvents.
      Parameters:
      bpss - a BProgram at a synchronization point.
      selectableEvents - A set of events to select from.
      Returns:
      An event selection result, or no result.