Package org.mpi_sws.jmc.strategies
Class TrackActiveTasksStrategy
java.lang.Object
org.mpi_sws.jmc.strategies.TrackActiveTasksStrategy
- All Implemented Interfaces:
SchedulingStrategy
- Direct Known Subclasses:
RandomSchedulingStrategy,TrustStrategy
A strategy that tracks the active tasks.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceTracks the active tasks based on events.static classTracks the locks acquired and released events of tasks.static classTracks the tasks start finish and join request events. -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new TrackActiveTasksStrategy object.Constructs a new TrackActiveTasksStrategy object with the given trackers. -
Method Summary
Modifier and TypeMethodDescriptionReturns the set of active tasks.voidinitIteration(int iteration, JmcModelCheckerReport report) Initializes the strategy for a new iteration.protected BooleanReturns whether the given thread is active.protected voidmarkActive(Long threadId) Marks the given thread as active.protected voidmarkInactive(Long threadId) Marks the given thread as inactive.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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.mpi_sws.jmc.strategies.SchedulingStrategy
nextTask
-
Constructor Details
-
TrackActiveTasksStrategy
public TrackActiveTasksStrategy()Constructs a new TrackActiveTasksStrategy object. -
TrackActiveTasksStrategy
Constructs a new TrackActiveTasksStrategy object with the given trackers.
-
-
Method Details
-
initIteration
Description copied from interface:SchedulingStrategyInitializes the strategy for a new iteration.- Specified by:
initIterationin interfaceSchedulingStrategy- Parameters:
iteration- the number of the iteration.
-
updateEvent
Description copied from interface:SchedulingStrategyUpdates the strategy with the event that has occurred.May be left empty if unused
- Specified by:
updateEventin interfaceSchedulingStrategy
-
resetIteration
public void resetIteration(int iteration) Description copied from interface:SchedulingStrategyResets the strategy for the current Iteration.- Specified by:
resetIterationin interfaceSchedulingStrategy
-
teardown
public void teardown()Description copied from interface:SchedulingStrategyTeardown the strategy. Allows for releasing resources.- Specified by:
teardownin interfaceSchedulingStrategy
-
isActive
Returns whether the given thread is active.- Parameters:
threadId- the thread ID- Returns:
- whether the given thread is active
-
getActiveTasks
Returns the set of active tasks.- Returns:
- the set of active tasks
-
markActive
Marks the given thread as active.- Parameters:
threadId- the thread ID
-
markInactive
Marks the given thread as inactive.- Parameters:
threadId- the thread ID
-