|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Thread rp1.simulator.SimTaskQueue rp1.simulator.SimScheduler
public class SimScheduler
A time-driven task queue that provides the backbone of the RP1 simulator; this class extends SimTaskQueue by adding clock-driven delays between sunsequent tasks so that they are executed according to a time sequence. It does this by overloading the waitForNextTask from SimTaskQueue. In SimTaskQueue, waitForNextTask returns a task as soon as one is available. In SimScheduler, it waits until the next task in the queue is scheduled for processing. Note that sometimes tasks with a startTime value of zero meaning "for immediate execution." Such tasks will cause the waitForNextTask method to return control to the calling application without delay.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary |
---|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
SimScheduler()
|
Method Summary | |
---|---|
void |
addTaskAtUpdatedSimTime(double offset,
SimTask task)
|
void |
addTaskAtUpdatedSimTime(SimTask task)
|
void |
addTaskForImmediateProcessing(SimTask task)
|
double |
getSimSpeed()
|
double |
getSimTime()
|
double |
getUpdatedSimTime()
|
void |
setSimSpeed(double newSpeed)
|
void |
startClock()
|
void |
stopClock()
|
SimTask |
waitForNextTask()
|
Methods inherited from class rp1.simulator.SimTaskQueue |
---|
add, isTaskOnQueue, remove, removeTasksForOriginator, run |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SimScheduler()
Method Detail |
---|
public void setSimSpeed(double newSpeed)
public void startClock()
public void stopClock()
public double getSimSpeed()
public double getSimTime()
public double getUpdatedSimTime()
public SimTask waitForNextTask()
waitForNextTask
in class SimTaskQueue
public void addTaskAtUpdatedSimTime(SimTask task)
public void addTaskAtUpdatedSimTime(double offset, SimTask task)
public void addTaskForImmediateProcessing(SimTask task)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |