Package org.mpi_sws.jmc.strategies.trust
Class TrustStrategy
java.lang.Object
org.mpi_sws.jmc.strategies.TrackActiveTasksStrategy
org.mpi_sws.jmc.strategies.trust.TrustStrategy
- All Implemented Interfaces:
ReplayableSchedulingStrategy,SchedulingStrategy
A wrapper around the
Algo algorithm that implements a scheduling strategy based on trust.
The class implements the ReplayableSchedulingStrategy and SchedulingStrategy and uses the TrackActiveTasksStrategy to
track active tasks during the execution.-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.mpi_sws.jmc.strategies.TrackActiveTasksStrategy
TrackActiveTasksStrategy.Tracker, TrackActiveTasksStrategy.TrackLocks, TrackActiveTasksStrategy.TrackTasks -
Constructor Summary
ConstructorsConstructorDescriptionTrustStrategy(Long randomSeed, TrustStrategy.SchedulingPolicy policy, boolean debug, String reportPath) -
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.voidRecords the current execution trace of the scheduling strategy.voidReplays the recorded execution trace of the scheduling strategy.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.Methods inherited from class org.mpi_sws.jmc.strategies.TrackActiveTasksStrategy
getActiveTasks, isActive, markActive, markInactive
-
Constructor Details
-
TrustStrategy
public TrustStrategy() -
TrustStrategy
public TrustStrategy(Long randomSeed, TrustStrategy.SchedulingPolicy policy, boolean debug, String reportPath)
-
-
Method Details
-
initIteration
Description copied from interface:SchedulingStrategyInitializes the strategy for a new iteration.- Specified by:
initIterationin interfaceSchedulingStrategy- Overrides:
initIterationin classTrackActiveTasksStrategy- Parameters:
iteration- the number of the iteration.
-
nextTask
Description copied from interface:SchedulingStrategyReturns the ID of the next thread to be scheduled.- Specified by:
nextTaskin interfaceSchedulingStrategy- Returns:
- the ID of the next thread to be scheduled.
-
updateEvent
Description copied from interface:SchedulingStrategyUpdates the strategy with the event that has occurred.May be left empty if unused
- Specified by:
updateEventin interfaceSchedulingStrategy- Overrides:
updateEventin classTrackActiveTasksStrategy- Throws:
HaltTaskExceptionHaltExecutionException
-
resetIteration
public void resetIteration(int iteration) Description copied from interface:SchedulingStrategyResets the strategy for the current Iteration.- Specified by:
resetIterationin interfaceSchedulingStrategy- Overrides:
resetIterationin classTrackActiveTasksStrategy
-
getExecutionGraph
-
teardown
public void teardown()Description copied from interface:SchedulingStrategyTeardown the strategy. Allows for releasing resources.- Specified by:
teardownin interfaceSchedulingStrategy- Overrides:
teardownin classTrackActiveTasksStrategy
-
recordTrace
Description copied from interface:ReplayableSchedulingStrategyRecords the current execution trace of the scheduling strategy.- Specified by:
recordTracein interfaceReplayableSchedulingStrategy- Throws:
JmcCheckerException
-
replayRecordedTrace
Description copied from interface:ReplayableSchedulingStrategyReplays the recorded execution trace of the scheduling strategy.- Specified by:
replayRecordedTracein interfaceReplayableSchedulingStrategy- Throws:
JmcCheckerException
-