|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--SimKit.Simulation
SimKit is a package for efficient discrete event modeling and simulation.
SimKit provides a "Logical Process" paradigm that attempts to approximate a "process-oriented" modeling view within an "event-oriented" implementation. The main objective of the SimKit application programmer's interface (API) is to enable extremely efficient implementations for both sequential and parallel execution. The Logical Process (LP) paradigm offers a bit of the flavor of the "process view" while making very fast execution possible on both single processor and multiprocessor platforms with minimal changes required to SimKit model source code.
There are three major classes defined in the SimKit Package: class Simulation, class Event and class LP. The Simulation class provides facilites for creating, initializing, running, and terminating a simulation. The LP class supports the creation of LP objects that represent components of a simulation model. LPs interact with other LPs soley by sending and receiving messages. These messages are instances of class Event that are sent by a source LP to a destination LP specifying the simulation time at which the Event message is to be received by the destination LP. These provide the only mechanism for advancing simulation time.
class Simulation provides methods for initialization, running and terminating a simulation. Initialization requires the creation of all the Logical Processes (LPs) that will be required during the simulation. Methods for accessing the current Event, current LP and current simulation time are also provided. There can only be one instance of this class at any one time. Users define a specific simulation by deriving from this class, for example:
class BankSimulation extends SimKit.Simulation { ... }
Extending this class ...
When extending this class, users need to implement the
initialize() and terminate() routines.
Event
,
LP
Field Summary | |
protected static double |
decEv
|
protected static java.util.Vector |
fLPs
The list of LP's in the simulation, arbitrarily ordered. |
protected static double |
numEv
|
Constructor Summary | |
Simulation(Arguments argv)
The constructor for Simulation creates a run time kernel and accepts an instance of class Arguments. |
Method Summary | |
static Event |
currEvent()
Report the current simulation event being executed. |
static LP |
currLP()
Reports the current LP. |
static double |
currTime()
Report the current simulation time. |
static void |
dbgPrint(java.lang.String info)
Output debugging information. |
static void |
dbgPrintEventList()
Print out the whole FEL list, but only if the debug flag is set. |
static boolean |
debugFlag()
Report the status of the debug flag. |
static void |
DecNumEvents()
|
static void |
error(java.lang.String info)
Report an error to the user. |
static java.lang.String |
FELToString()
Report the event sequence in the future event list |
static void |
IncNumEvents()
|
abstract void |
initialize()
Users of this class provide the implementation for this abstract function to initialize the simulation model. |
void |
run()
The standard entry point from class Runnable. |
static void |
setCurrLP(LP currLP)
Set the currentLP of the kernel |
static void |
setEndTime(double endTime)
Tell the simulation kernel how long you want the simulation to run, runs begin at time zero and end when the next event to process has a timestamp greater than endtime. |
abstract void |
terminate()
Users of this class provide the implementation for this abstract function. |
java.lang.String |
toString()
Convert the simulation into a string. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected static double numEv
protected static double decEv
protected static java.util.Vector fLPs
Constructor Detail |
public Simulation(Arguments argv)
argv
- The command line arguments and other parameters
that are passed to the Simulation at start up.Method Detail |
public static void IncNumEvents()
public static void DecNumEvents()
public static final void dbgPrint(java.lang.String info)
info
- The string to output.public static final void dbgPrintEventList()
public static final java.lang.String FELToString()
public static final void error(java.lang.String info)
public abstract void initialize()
public abstract void terminate()
public static final double currTime()
public static final LP currLP()
public static boolean debugFlag()
public static final Event currEvent()
public static final void setEndTime(double endTime)
endTime
- The time to end the simulation. Must be
greater than or equal to zero.public static void setCurrLP(LP currLP)
public final void run()
This method is required when implementing the Runnable interface.
run
in interface java.lang.Runnable
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |