DRCL JavaSim API

drcl.sim.event
Class SESimulator

java.lang.Object
  |
  +--drcl.DrclObj
        |
        +--drcl.comp.ForkManager
              |
              +--drcl.comp.ACARuntime
                    |
                    +--drcl.sim.event.SESimulator
All Implemented Interfaces:
java.lang.Cloneable, ObjectDuplicable, java.io.Serializable

public class SESimulator
extends ACARuntime

A sequential event simulation engine (XXX: still work-in-progress).

See Also:
SEWorkerThread, Serialized Form

Field Summary
protected  long ltime
           
protected  FIFOQueue qReady
          Used to store tasks.
protected  Queue qWaiting
           
protected  long startTime
           
protected  double time
           
 
Fields inherited from class drcl.comp.ACARuntime
debug, DEFAULT_RUNTIME, logenabled, name, resetting, state, State_INACTIVE, State_RUNNING, State_SUSPENDED, tf, timeScale, timeScaleReciprocal, tr, vStateListener
 
Fields inherited from class drcl.comp.ForkManager
parent, runtime
 
Constructor Summary
SESimulator()
           
SESimulator(java.lang.String name_)
           
 
Method Summary
 void ___PROFILE___()
           
protected  double _getEventRate(long numArrivals_)
           
protected  double _getTime()
          Asynchronized version of getTime(), for diagnosis.
protected  void _stop(boolean block_)
           
 java.lang.String a_info(boolean listWaitingTasks_)
          Asynchronous version of ACARuntime.diag().
 void forceReset()
          Forces to reset this runtime.
 java.lang.Object getEventQueue()
           
 double getEventRate()
          Returns the event processing rate of this runtime.
 SEThread getMainThread()
           
 long getNumberOfArrivalEvents()
          Returns the number of arrival events.
 long getWallTimeElapsed()
          Returns the actual time (in ms) for which this runtime has participated.
 java.lang.String info()
          Returns general information of this runtime.
protected  void newTask(Task task_, WorkerThread currentThread_)
          The only way to trigger new tasks to be executed.
protected  void off(ACATimer handle_)
          Cancels a fork event.
 void println(java.lang.String msg_)
           
 void reset()
          The workerpool enters a transitional period when reset() is issued.
 void resume()
          Resumes the system.
 java.lang.String s_info()
           
protected  void setState(java.lang.String new_)
           
 java.lang.String ss_info()
          Synchronized version of s_info().
 java.lang.String t_info()
           
protected  java.lang.String t_info(java.lang.String prefix_)
           
 java.lang.String tasks()
          Returns information of the task queue.
 
Methods inherited from class drcl.comp.ACARuntime
_openlog, a_info, addDebugLevel, addRunnable, addRunnable, addRunnableAt, addRunnableAt, addStateListener, childManager, containsDebugLevel, debug_info, diag, diag, finalized, getAllDebugLevels, getAllStateListeners, getName, getParent, getState, getTime, getTimeScale, isDebugEnabled, isDebugEnabledAt, isIdle, isRunning, isStopped, isSuspended, notifyStateListeners, process, reboot, receive, receiveAt, removeDebugLevel, removeStateListener, resumeFor, resumeTo, send, sendAt, setDebugEnabled, setDebugEnabledAt, setDebugLevels, setMaxWorkforce, setName, setParent, setRuntime, setTimeScale, stop, stop, stopAt, takeover, takeover, toString, tr_info
 
Methods inherited from class drcl.comp.ForkManager
a_list, getRuntime, info, list, takeover
 
Methods inherited from class drcl.DrclObj
clone, duplicate
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

startTime

protected long startTime

ltime

protected long ltime

time

protected double time

qReady

protected FIFOQueue qReady
Used to store tasks.

qWaiting

protected Queue qWaiting
Constructor Detail

SESimulator

public SESimulator()

SESimulator

public SESimulator(java.lang.String name_)
Method Detail

newTask

protected void newTask(Task task_,
                       WorkerThread currentThread_)
The only way to trigger new tasks to be executed.
Overrides:
newTask in class ACARuntime

info

public java.lang.String info()
Description copied from class: ACARuntime
Returns general information of this runtime.
Overrides:
info in class ACARuntime

ss_info

public java.lang.String ss_info()
Synchronized version of s_info().

s_info

public java.lang.String s_info()

getMainThread

public SEThread getMainThread()

a_info

public java.lang.String a_info(boolean listWaitingTasks_)
Asynchronous version of ACARuntime.diag().
Overrides:
a_info in class ACARuntime

tasks

public java.lang.String tasks()
Returns information of the task queue.

forceReset

public void forceReset()
Forces to reset this runtime.

___PROFILE___

public void ___PROFILE___()

getNumberOfArrivalEvents

public long getNumberOfArrivalEvents()
Description copied from class: ACARuntime
Returns the number of arrival events.
Overrides:
getNumberOfArrivalEvents in class ACARuntime

getEventRate

public double getEventRate()
Description copied from class: ACARuntime
Returns the event processing rate of this runtime.
Overrides:
getEventRate in class ACARuntime

_getEventRate

protected double _getEventRate(long numArrivals_)

_getTime

protected double _getTime()
Asynchronized version of getTime(), for diagnosis.
Overrides:
_getTime in class ACARuntime

_stop

protected void _stop(boolean block_)
Overrides:
_stop in class ACARuntime

resume

public void resume()
Description copied from class: ACARuntime
Resumes the system. The state must advance to RUNNING when this method returns.
Overrides:
resume in class ACARuntime

reset

public void reset()
Description copied from class: ACARuntime
The workerpool enters a transitional period when reset() is issued. It waits for all the working thread to either finishes the job or goes into sleep. After all the threads finish jobs, it releases all the threads by kill()ing them.
Overrides:
reset in class ACARuntime

getWallTimeElapsed

public long getWallTimeElapsed()
Description copied from class: ACARuntime
Returns the actual time (in ms) for which this runtime has participated.
Overrides:
getWallTimeElapsed in class ACARuntime

t_info

public java.lang.String t_info()
Overrides:
t_info in class ACARuntime

t_info

protected java.lang.String t_info(java.lang.String prefix_)
Overrides:
t_info in class ACARuntime

setState

protected void setState(java.lang.String new_)
Overrides:
setState in class ACARuntime

println

public void println(java.lang.String msg_)

off

protected void off(ACATimer handle_)
Description copied from class: ForkManager
Cancels a fork event.
Overrides:
off in class ACARuntime

getEventQueue

public java.lang.Object getEventQueue()
Overrides:
getEventQueue in class ACARuntime

DRCL JavaSim API

Copyright © 2001 - DRCL, OSU     ~ Back to JavaSim Home ~