Package org.mpi_sws.jmc.strategies
Interface SchedulingStrategy
- All Known Subinterfaces:
ReplayableSchedulingStrategy
- All Known Implementing Classes:
MeasureGraphCoverageStrategy,RandomSchedulingStrategy,TrackActiveTasksStrategy,TrustStrategy
public interface SchedulingStrategy
The scheduling strategy is responsible for deciding which thread to schedule next.
It is used by the Scheduler to decide which thread to schedule next. The Scheduler is in turn used by the JmcRuntime to manage the execution of threads.
Implementations of this interface should be thread-safe. Multiple threads can make concurrent
calls to the updateEvent(org.mpi_sws.jmc.runtime.JmcRuntimeEvent) function.
-
Method Summary
Modifier and TypeMethodDescriptionvoidinitIteration(int iteration, JmcModelCheckerReport report) Initializes the strategy for a new iteration.nextTask()Returns the ID of the next thread to be scheduled.voidresetIteration(int iteration) Resets the strategy for the current Iteration.voidteardown()Teardown the strategy.voidupdateEvent(JmcRuntimeEvent event) Updates the strategy with the event that has occurred.
-
Method Details
-
initIteration
Initializes the strategy for a new iteration.- Parameters:
iteration- the number of the iteration.- Throws:
HaltCheckerException
-
updateEvent
Updates the strategy with the event that has occurred.May be left empty if unused
-
nextTask
SchedulingChoice<?> nextTask()Returns the ID of the next thread to be scheduled.- Returns:
- the ID of the next thread to be scheduled.
-
resetIteration
void resetIteration(int iteration) Resets the strategy for the current Iteration. -
teardown
void teardown()Teardown the strategy. Allows for releasing resources.
-