|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthades.simulator.SimKernel
hades.simulator.RealTimeSimKernel
RealTimeSimKernel -- A subclass of the event-based HADES simulation engine with support for interactive 'real time' simulation 'a la DIGLOG.
Once started, the RealTimeSimKernel will dispatch Events in real time: No events will be processed faster than their scheduled time (in seconds). Naturally, Events cannot be processed faster than the Java virtual machine allows.
If no Events remain, the RealTimeSimKernel will enter into a sleep phase, polling the EventList all 100msec, to look for further interactive (user generated) Events.
Field Summary | |
(package private) static boolean |
ddebug
|
(package private) static boolean |
debug
|
(package private) int |
delta_resync_iterations
|
(package private) double |
eventTime
|
(package private) int |
global_errors
|
(package private) double |
lastSyncTime
|
(package private) int |
n_resync_iterations
|
(package private) double |
realTime
|
static int |
t_sleep
|
(package private) long |
t0
|
(package private) long |
t1
|
(package private) static java.lang.String |
versionString
|
Fields inherited from class hades.simulator.SimKernel |
commandQueue, console, controlPanel, design, ELABORATE, endTime, eventList, n_interactive, n_interactive_transferred, n_iterations, n_processed, n_scheduled, n_simulators, name, painter, PAUSED, RESET, runner, RUNNING, shouldStop, simTime, simulatorID, SINGLESTEP, state, STOPPED |
Constructor Summary | |
RealTimeSimKernel()
constructor for an so far idle simulation engine |
Method Summary | |
void |
addPendingEvent(SimEvent se,
Port target)
the standard simulation engines don't support VHDL-style two-list simulation with delta-cycles. |
void |
initializeSimulator()
initialize the simulator: stop any running simulation, then create a new eventlist, initialize start and end times, ... |
void |
printStatus()
printStatus(): print a short message about current simulation and real times, as well as the number of scheduled and processed events. |
void |
resync()
resync(): update our 'realTime' variable from the JVM system clock. |
void |
run()
run the simulation until ready or interrupted. |
void |
runForever()
set the simulation end time to Double.MAX_VALUE, then start/continue the simulation from the current time. |
void |
sleep()
sleep for t_sleep milliseconds. |
java.lang.String |
toString()
standard identification method |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
static boolean debug
static boolean ddebug
static java.lang.String versionString
double realTime
double lastSyncTime
double eventTime
long t0
long t1
int n_resync_iterations
int delta_resync_iterations
int global_errors
public static int t_sleep
Constructor Detail |
public RealTimeSimKernel()
Method Detail |
public void runForever()
runForever
in class SimKernel
public void initializeSimulator()
SimKernel
initializeSimulator
in class SimKernel
public void addPendingEvent(SimEvent se, Port target)
addPendingEvent
in class SimKernel
public void run()
Variable 't0' holds the JVM clock at start of the simulation, 't1' is used for the curent JVM clock value.
run
in interface java.lang.Runnable
run
in class SimKernel
public void resync()
public void printStatus()
printStatus
in class SimKernel
public void sleep()
public java.lang.String toString()
toString
in class SimKernel
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |