|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthades.simulator.SimKernel
hades.simulator.InteractiveSimKernel
Field Summary | |
(package private) int |
delta_resync_iterations
|
(package private) double |
eventTime
|
(package private) int |
global_errors
|
(package private) double |
lastSyncTime
|
(package private) int |
n_pending
|
(package private) int |
n_resync_iterations
|
static int |
PAUSE
|
(package private) int |
PENDING_ARRAY_SIZE
|
(package private) int |
pendingArrayIndex
|
(package private) SimEvent[] |
pendingEventArray
|
(package private) Port[] |
pendingEventTargetArray
|
(package private) double |
realTime
|
static int |
RUNNING
|
(package private) int |
simulatorState
|
static int |
SINGLE_STEP
|
static int |
STOP
|
long |
t_resync
|
long |
t_sleep
|
(package private) long |
t0
|
(package private) long |
t1
|
(package private) static java.lang.String |
versionString
|
static int |
VIRGIN
|
Fields inherited from class hades.simulator.SimKernel |
commandQueue, console, controlPanel, debug, design, ELABORATE, endTime, eventList, n_interactive, n_interactive_transferred, n_iterations, n_processed, n_scheduled, n_simulators, name, painter, PAUSED, RESET, runner, shouldStop, simTime, simulatorID, SINGLESTEP, state, STOPPED |
Constructor Summary | |
InteractiveSimKernel()
constructor for an so far idle simulation engine |
Method Summary | |
void |
addPendingEvent(SimEvent event,
Port target)
add SimEvents for later execution. |
void |
checkCreateSimulationThread()
|
(package private) void |
checkInteractiveEvents()
check the CommandQueue for events and execute them, if any. |
(package private) void |
checkResync()
check whether we need to re-synchronize simulation time and real time. |
(package private) void |
collectEvents()
|
void |
deleteAllEventsFromSource(SimObject source)
delete all events scheduled from object 'source' from our event list. |
void |
elaborateComponents()
|
void |
evaluate(java.lang.Object arg)
evaluate(): called by the Simulation engine. |
(package private) void |
executeAllPendingEvents()
|
(package private) void |
executePendingEvent()
execute one pending event (the last one). |
void |
executeSingleStep()
|
java.lang.String |
getState()
getState(): print current state |
void |
initializeSimulator()
initialize the simulator: stop any running simulation, then create a new eventlist, initialize start and end times, ... |
boolean |
isPaused()
check whether this simulator is currently interrupted |
boolean |
isRunning()
check whether this simulator is running |
boolean |
isSingleStep()
|
boolean |
isStarted()
|
boolean |
isStopped()
|
boolean |
isVirgin()
|
void |
msg(java.lang.String s)
|
void |
pauseSimulation()
pause the simulation, if running |
void |
printStatus()
printStatus(): print a short message about current simulation and real times, as well as the number of scheduled and processed events, memory status, etc. |
(package private) void |
reallocatePendingEventArrays()
|
void |
resync()
resync: update our 'realTime' variable from the JVM system clock. |
void |
run()
run the simulation until ready or interrupted. |
void |
runFor(double delta_t)
continue the simulation for the specified interval of time. |
void |
runForever()
set the simulation end time to Double.MAX_VALUE, then start/continue the simulation from the current time. |
void |
scheduleInteractiveEvent(SimEvent se)
schedule an interactive event. |
(package private) void |
simulation()
simulation: for each iteration, we first check and handle interactive events. |
void |
singleStep()
singleStep(): execute the one next event (if any). |
void |
sleep(long millis)
tell the simulation Thread to sleep a bit. |
void |
stopSimulation()
stop the simulation, no questions asked |
java.lang.String |
toString()
standard identification method |
void |
updateControlPanel()
|
Methods inherited from class hades.simulator.SimKernel |
checkClearWaveforms, continueSimulation, dbg, elaborate, getDebug, getEventList, getNumberOfProcessedEvents, getNumberOfScheduledEvents, getSimTime, getSyncPainter, getToolTip, hasEvents, isReset, main, message, pauseSimulation_NEW, printNextPendingEvent, processPendingRepaints, run_debug, scheduleEvent, scheduleWakeup, setConsole, setControlPanel, setDebug, setDesign, setName, setSyncPainter, stopSimulation_NEW, usage |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public long t_sleep
public long t_resync
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 final int STOP
public static final int SINGLE_STEP
public static final int PAUSE
public static final int RUNNING
public static final int VIRGIN
int simulatorState
int PENDING_ARRAY_SIZE
int pendingArrayIndex
int n_pending
SimEvent[] pendingEventArray
Port[] pendingEventTargetArray
Constructor Detail |
public InteractiveSimKernel()
Method Detail |
public void addPendingEvent(SimEvent event, Port target)
addPendingEvent
in class SimKernel
void reallocatePendingEventArrays()
void executePendingEvent()
void executeAllPendingEvents()
public boolean isStopped()
public boolean isSingleStep()
isSingleStep
in class SimKernel
public boolean isPaused()
SimKernel
isPaused
in class SimKernel
public boolean isRunning()
SimKernel
isRunning
in class SimKernel
public boolean isStarted()
public boolean isVirgin()
public java.lang.String getState()
getState
in class SimKernel
public void elaborateComponents()
elaborateComponents
in class SimKernel
public void runForever()
runForever
in class SimKernel
public void runFor(double delta_t)
runFor
in class SimKernel
public void checkCreateSimulationThread()
public void initializeSimulator()
SimKernel
initializeSimulator
in class SimKernel
public void evaluate(java.lang.Object arg)
SimKernel
evaluate
in interface Simulatable
evaluate
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
void simulation()
Finally, we collect and execute the events.
void checkInteractiveEvents()
public void scheduleInteractiveEvent(SimEvent se)
scheduleInteractiveEvent
in class SimKernel
public void deleteAllEventsFromSource(SimObject source)
deleteAllEventsFromSource
in class SimKernel
public void singleStep()
SimKernel
singleStep
in class SimKernel
public void pauseSimulation()
SimKernel
pauseSimulation
in class SimKernel
public void stopSimulation()
SimKernel
stopSimulation
in class SimKernel
public void updateControlPanel()
void checkResync()
void collectEvents()
public void executeSingleStep()
executeSingleStep
in class SimKernel
public void resync()
public void printStatus()
printStatus
in class SimKernel
public void sleep(long millis)
public java.lang.String toString()
SimKernel
toString
in class SimKernel
public void msg(java.lang.String s)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |