use of abs.backend.java.scheduling.UsesRandomSeed in project abstools by abstools.
the class ABSRuntime method setRandomSeed.
public synchronized void setRandomSeed(long seed) {
randomSeed = seed;
random = new Random(seed);
logger.config("New Random Seed: " + randomSeed);
if (globalSchedulingStrategy instanceof UsesRandomSeed) {
((UsesRandomSeed) globalSchedulingStrategy).setRandom(random);
}
if (taskSchedulingStrategy instanceof UsesRandomSeed) {
((UsesRandomSeed) taskSchedulingStrategy).setRandom(random);
}
}
use of abs.backend.java.scheduling.UsesRandomSeed 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);
}
Aggregations