DRCL J-Sim API

drcl.sim.event
Class SESimulator

java.lang.Object
  extended bydrcl.DrclObj
      extended bydrcl.comp.ForkManager
          extended bydrcl.comp.ACARuntime
              extended bydrcl.sim.event.SESimulator
All Implemented Interfaces:
java.lang.Cloneable, ObjectCloneable, ObjectDuplicable, java.io.Serializable

public class SESimulator
extends ACARuntime

A sequential event simulation engine.

See Also:
SEThread, Serialized Form

Field Summary
static java.lang.String Debug_Q
           
static java.lang.String Debug_RECYCLE
           
static java.lang.String Debug_STATE
           
static java.lang.String Debug_THREAD
           
static java.lang.String Debug_THREAD_STATE
           
static java.lang.String State_RESETTING
          Transitional state to INACTIVE when system is being reset.
static java.lang.String State_SUSPENDING
          Transitional state to SUSPENDED.
 
Fields inherited from class drcl.comp.ACARuntime
debug, DEFAULT_RUNTIME, logenabled, resetting, State_INACTIVE, State_RUNNING, State_SUSPENDED
 
Constructor Summary
SESimulator()
           
SESimulator(java.lang.String name_)
           
 
Method Summary
 void ___PROFILE___()
           
 java.lang.String a_info(boolean listWaitingTasks_)
          Asynchronous version of ACARuntime.diag(boolean).
 java.lang.String a_info(boolean listWaitingTasks_, boolean listReadyTasks_, boolean listWorkingThreads_)
          Asynchronous version of ACARuntime.diag().
 void forceReset()
          Forces to reset this runtime.
 double getEfficiencyIndex()
          Returns the efficiency index of thread recycling.
 double getEventEfficiencyIndex(long numberOfArrivalEvents_)
           
 java.lang.Object getEventQueue()
           
 double getEventRate()
          Returns the event processing rate of this runtime.
 long getNumberOfArrivalEvents()
          Returns the number of arrival events.
 int getNumberOfIdleThreads()
          Returns the number of [idle] worker threads in the recycling pool.
 long getNumberOfThreadRequests()
          Returns the number of requests for worker threads.
 int getNumberOfThreadsCreated()
          Returns the number of worker threads being created.
 int getNumberOfWorkingThreads()
          Returns the number of worker threads that are currently executing some tasks.
 long getNumLaggingEvents()
           
 Queue getQ()
           
 double getRTEvaluation()
          Returns the percentage where events are processed in real time (within tolerance specified by setRTTolerance() (not implemented).
 long getRTTolerance()
           
 java.lang.ThreadGroup getThreadGroup()
           
 double getThreadRequestRate()
           
 long getWallTimeElapsed()
          Returns the actual time (in ms) this runtime has run for.
 SEThread getWorkingThread(int index_)
          Returns the worker thread, for diagnosis
 java.lang.String info()
          Returns general information of this runtime.
 boolean isIdle()
          Returns true if the runtime is stopped (inactive or suspended) or running but all working threads are waiting.
 boolean isResetting()
          Returns true if the runtime is in resetting.
 boolean isRTEnabled()
           
 void listThreads()
           
 void print(java.lang.String which_, SEThread current_, java.lang.String msg_)
           
 void println(java.lang.String which_, SEThread current_, java.lang.String msg_)
           
 java.lang.String q_info(java.lang.String prefix_, boolean listElement_)
          Returns information of the event queue.
 void reset()
          The workerpool enters a transitional period when reset() is issued.
 void resume()
          Resumes the system.
 java.lang.String s_info()
          Returns statistics of this runtime.
 java.lang.String s_info(boolean listWaitingTasks_)
          Returns statistics of this runtime.
 void setRTEnabled(boolean value_)
          Can only be set when INACTIVE (not implemented).
 void setRTTolerance(long v_)
           
 java.lang.String ss_info()
          Synchronized version of s_info().
 java.lang.String sthreads()
           
 java.lang.String swthreads()
          Synchronized version of wthreads().
 java.lang.String t_info()
           
 java.lang.String tasks()
          Returns information of the task queue.
 java.lang.String threads()
          Returns information of the associate thread group.
 java.lang.String wthreads()
          Returns information of working threads.
 
Methods inherited from class drcl.comp.ACARuntime
a_info, addDebugLevel, addRunHook, addRunnable, addRunnable, addRunnableAt, addRunnableAt, addStateListener, addStopHook, addSuspendHook, containsDebugLevel, debug_info, diag, diag, getAllDebugLevels, getAllStateListeners, getName, getParent, getState, getTime, getTimeScale, isDebugEnabled, isDebugEnabledAt, isRunning, isStopped, isSuspended, notifyStateListeners, reboot, removeAllRunHooks, removeAllStopHooks, removeAllSuspendHooks, removeDebugLevel, removeRunHook, removeStateListener, removeStopHook, removeSuspendHook, resumeFor, resumeTo, 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, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

Debug_THREAD

public static final java.lang.String Debug_THREAD
See Also:
Constant Field Values

Debug_THREAD_STATE

public static final java.lang.String Debug_THREAD_STATE
See Also:
Constant Field Values

Debug_Q

public static final java.lang.String Debug_Q
See Also:
Constant Field Values

Debug_RECYCLE

public static final java.lang.String Debug_RECYCLE
See Also:
Constant Field Values

Debug_STATE

public static final java.lang.String Debug_STATE
See Also:
Constant Field Values

State_SUSPENDING

public static final java.lang.String State_SUSPENDING
Transitional state to SUSPENDED.

See Also:
Constant Field Values

State_RESETTING

public static final java.lang.String State_RESETTING
Transitional state to INACTIVE when system is being reset.

See Also:
Constant Field Values
Constructor Detail

SESimulator

public SESimulator()

SESimulator

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

getThreadGroup

public java.lang.ThreadGroup getThreadGroup()

listThreads

public void listThreads()

info

public java.lang.String info()
Returns general information of this runtime.

Specified by:
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()
Returns statistics of this runtime.


s_info

public java.lang.String s_info(boolean listWaitingTasks_)
Returns statistics of this runtime.


a_info

public java.lang.String a_info(boolean listWaitingTasks_)
Description copied from class: ACARuntime
Asynchronous version of ACARuntime.diag(boolean).

Specified by:
a_info in class ACARuntime

a_info

public java.lang.String a_info(boolean listWaitingTasks_,
                               boolean listReadyTasks_,
                               boolean listWorkingThreads_)
Asynchronous version of ACARuntime.diag().


sthreads

public java.lang.String sthreads()

threads

public java.lang.String threads()
Returns information of the associate thread group.


swthreads

public java.lang.String swthreads()
Synchronized version of wthreads().


wthreads

public java.lang.String wthreads()
Returns information of working threads.


tasks

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


forceReset

public void forceReset()
Forces to reset this runtime.


getWorkingThread

public SEThread getWorkingThread(int index_)
Returns the worker thread, for diagnosis


___PROFILE___

public void ___PROFILE___()

getNumberOfThreadsCreated

public int getNumberOfThreadsCreated()
Returns the number of worker threads being created.


getNumberOfIdleThreads

public int getNumberOfIdleThreads()
Returns the number of [idle] worker threads in the recycling pool.


getNumberOfThreadRequests

public long getNumberOfThreadRequests()
Returns the number of requests for worker threads.


getNumberOfArrivalEvents

public long getNumberOfArrivalEvents()
Returns the number of arrival events.

Specified by:
getNumberOfArrivalEvents in class ACARuntime

getEfficiencyIndex

public double getEfficiencyIndex()
Returns the efficiency index of thread recycling. Calculated by getNumberOfThreadRequests() over getNumberOfThreadsCreated().


getEventEfficiencyIndex

public double getEventEfficiencyIndex(long numberOfArrivalEvents_)

getNumberOfWorkingThreads

public int getNumberOfWorkingThreads()
Returns the number of worker threads that are currently executing some tasks.


getEventRate

public double getEventRate()
Returns the event processing rate of this runtime.

Specified by:
getEventRate in class ACARuntime

getThreadRequestRate

public double getThreadRequestRate()

resume

public void resume()
Resumes the system. The state must advance to RUNNING when this method returns.

Specified by:
resume in class ACARuntime

reset

public void reset()
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.

CAUTION: 1. This method is better be executed by a thread that is not created from this worker pool, unless you know what you're doing. 2. Current implementation does not work if a thread executes indefinitely.

Specified by:
reset in class ACARuntime

getWallTimeElapsed

public long getWallTimeElapsed()
Returns the actual time (in ms) this runtime has run for.

Specified by:
getWallTimeElapsed in class ACARuntime

t_info

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

isResetting

public boolean isResetting()
Returns true if the runtime is in resetting.


isIdle

public boolean isIdle()
Returns true if the runtime is stopped (inactive or suspended) or running but all working threads are waiting.

Overrides:
isIdle in class ACARuntime

print

public void print(java.lang.String which_,
                  SEThread current_,
                  java.lang.String msg_)

println

public void println(java.lang.String which_,
                    SEThread current_,
                    java.lang.String msg_)

setRTEnabled

public void setRTEnabled(boolean value_)
Can only be set when INACTIVE (not implemented).


isRTEnabled

public boolean isRTEnabled()

getNumLaggingEvents

public long getNumLaggingEvents()

getRTEvaluation

public double getRTEvaluation()
Returns the percentage where events are processed in real time (within tolerance specified by setRTTolerance() (not implemented).


setRTTolerance

public void setRTTolerance(long v_)

getRTTolerance

public long getRTTolerance()

getQ

public Queue getQ()

getEventQueue

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

q_info

public java.lang.String q_info(java.lang.String prefix_,
                               boolean listElement_)
Returns information of the event queue.


DRCL J-Sim API

Copyright © 1998-2003 Distributed Real-time Computing Lab (DRCL). All Rights Reserved.     ~ To J-Sim Home ~