hades.simulator
Class BatchModeSimKernel

java.lang.Object
  extended byhades.simulator.SimKernel
      extended byhades.simulator.BatchModeSimKernel
All Implemented Interfaces:
ContextToolTip, java.lang.Runnable, Simulatable

public class BatchModeSimKernel
extends SimKernel
implements java.lang.Runnable

BatchModeSimKernel -- A subclass of the event-based HADES simulation engine with the standard 'batch mode' behaviour.

Once started, the BatchModeSimKernel will dispatch Events as fast as possible. If no Events remain, the BatchModeSimKernel will enter into a sleep phase, increasing the simulation time once by 5 nsecs. and afterwards polling the EventList all 100msec, to look for further interactive (user generated) Events.


Field Summary
(package private)  double eventTime
           
(package private)  int global_errors
           
(package private)  double sleepDeltaTime
           
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, debug, 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
BatchModeSimKernel()
          construct a new and idle BatchModeSimKernel
BatchModeSimKernel(Design design)
          construct a BatchModeSimKernel for a given Design
BatchModeSimKernel(java.lang.String name)
          construct a named simulation engine
 
Method Summary
 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 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 hades.simulator.SimKernel
addPendingEvent, checkClearWaveforms, continueSimulation, dbg, deleteAllEventsFromSource, elaborate, elaborateComponents, evaluate, executeSingleStep, getDebug, getEventList, getNumberOfProcessedEvents, getNumberOfScheduledEvents, getSimTime, getState, getSyncPainter, getToolTip, hasEvents, isPaused, isReset, isRunning, isSingleStep, main, message, pauseSimulation_NEW, pauseSimulation, printNextPendingEvent, processPendingRepaints, run_debug, runFor, scheduleEvent, scheduleInteractiveEvent, scheduleWakeup, setConsole, setControlPanel, setDebug, setDesign, setName, setSyncPainter, singleStep, stopSimulation_NEW, stopSimulation, usage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

versionString

static java.lang.String versionString

eventTime

double eventTime

sleepDeltaTime

double sleepDeltaTime

t0

long t0

t1

long t1

global_errors

int global_errors

t_sleep

public static int t_sleep
Constructor Detail

BatchModeSimKernel

public BatchModeSimKernel()
construct a new and idle BatchModeSimKernel


BatchModeSimKernel

public BatchModeSimKernel(java.lang.String name)
construct a named simulation engine


BatchModeSimKernel

public BatchModeSimKernel(Design design)
construct a BatchModeSimKernel for a given Design

Method Detail

runForever

public void runForever()
set the simulation end time to Double.MAX_VALUE, then start/continue the simulation from the current time.

Overrides:
runForever in class SimKernel

initializeSimulator

public void initializeSimulator()
Description copied from class: SimKernel
initialize the simulator: stop any running simulation, then create a new eventlist, initialize start and end times, ...

Overrides:
initializeSimulator in class SimKernel

run

public void run()
run the simulation until ready or interrupted. This method processes all remaining SimEvents in 'real time' as follows: All Events with scheduled time smaller than the current time are processed as fast as possible. If no such Events remain, the simulator Thread will sleep() itself for 100msec. each, until the user generates new Events or the time is ripe for the Events scheduled for later times.

Variable 't0' holds the JVM clock at start of the simulation, 't1' is used for the curent JVM clock value.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class SimKernel

printStatus

public void printStatus()
printStatus(): print a short message about current simulation and real times, as well as the number of scheduled and processed events.

Overrides:
printStatus in class SimKernel

sleep

public void sleep()
sleep for t_sleep milliseconds.


toString

public java.lang.String toString()
standard identification method

Overrides:
toString in class SimKernel