Search in sources :

Example 1 with TotalSchedulingStrategy

use of abs.backend.java.scheduling.TotalSchedulingStrategy in project abstools by abstools.

the class SchedulingStrategy method resumeAutomaticScheduling.

/**
 * resumes the scheduling with the current base scheduler (Interrupts the
 * GUIScheduler if it is the current scheduler)
 */
public synchronized void resumeAutomaticScheduling() {
    TotalSchedulingStrategy oldScheduler = curScheduler;
    baseScheduler.reset();
    curScheduler = baseScheduler;
    disableHighlighting();
    schedulerUpdated(oldScheduler);
}
Also used : TotalSchedulingStrategy(abs.backend.java.scheduling.TotalSchedulingStrategy)

Example 2 with TotalSchedulingStrategy

use of abs.backend.java.scheduling.TotalSchedulingStrategy in project abstools by abstools.

the class Debugger method addSchedulingStrategy.

private static boolean addSchedulingStrategy(String debuggerArgsScheduler, final ABSRuntime r) {
    if (debuggerArgsScheduler != null && !debuggerArgsScheduler.isEmpty()) {
        String scheduler = debuggerArgsScheduler.replaceFirst("-Dabs.totalscheduler=", "");
        if (!scheduler.isEmpty()) {
            try {
                Class<?> c = Class.forName(scheduler);
                Object o = c.newInstance();
                TotalSchedulingStrategy ss = (TotalSchedulingStrategy) o;
                r.setTotalSchedulingStrategy(ss);
                return (ss instanceof SchedulingStrategy);
            } catch (ClassNotFoundException e) {
                standardExceptionHandling(e);
                showErrorMessage("Not able to instantiate total scheduler");
            } catch (InstantiationException e) {
                standardExceptionHandling(e);
                showErrorMessage("Not able to instantiate total scheduler");
            } catch (IllegalAccessException e) {
                standardExceptionHandling(e);
                showErrorMessage("Not able to instantiate total scheduler");
            }
        }
    }
    return false;
}
Also used : TotalSchedulingStrategy(abs.backend.java.scheduling.TotalSchedulingStrategy) SchedulingStrategy(org.absmodels.abs.plugin.debug.scheduling.SchedulingStrategy) TotalSchedulingStrategy(abs.backend.java.scheduling.TotalSchedulingStrategy)

Example 3 with TotalSchedulingStrategy

use of abs.backend.java.scheduling.TotalSchedulingStrategy in project abstools by abstools.

the class SchedulingStrategy method setCurrentScheduler.

/**
 * Sets the current scheduler. If the old scheduler is the GUIScheduler, it is interrupted
 * and notified about the changed scheduler.
 * @param scheduler
 */
public synchronized void setCurrentScheduler(TotalScheduler scheduler) {
    if (random != null && scheduler instanceof UsesRandomSeed) {
        ((UsesRandomSeed) scheduler).setRandom(random);
    }
    TotalSchedulingStrategy oldscheduler = curScheduler;
    curScheduler = scheduler;
    schedulerUpdated(oldscheduler);
}
Also used : TotalSchedulingStrategy(abs.backend.java.scheduling.TotalSchedulingStrategy) UsesRandomSeed(abs.backend.java.scheduling.UsesRandomSeed)

Aggregations

TotalSchedulingStrategy (abs.backend.java.scheduling.TotalSchedulingStrategy)3 UsesRandomSeed (abs.backend.java.scheduling.UsesRandomSeed)1 SchedulingStrategy (org.absmodels.abs.plugin.debug.scheduling.SchedulingStrategy)1