Custom Strategies #
The strategy type is defined by the following interface.
public interface SchedulingStrategy {
void initIteration(int iteration, JmcModelCheckerReport report) throws HaltCheckerException;
void updateEvent(JmcRuntimeEvent event) throws HaltTaskException, HaltExecutionException;
SchedulingChoice<?> nextTask();
void resetIteration(int iteration);
void teardown();
}
The custom strategy should implement the above interface. However, handling all event types and ensuring no deadlocks is a cumbersome process. To ease this, JMC defines an abstract TrackActiveTasksStrategy
that keeps track of available tasks. When extending, use the activeTasks
method to obtain the list of active tasks.
Ignoring instrumentation
Any custom strategy defined will run within the confines of the JMC runtime and therefore, should not be instrumented. It is mandatory to annotate the strategy class and other helper classes with theJmcIgnoreInstrumentation
annotation.