public final class Sim
extends java.lang.Object
Starting from SSJ-2.0, the Sim class now uses
the default simulator returned by the getDefaultSimulator()
method in the Simulator class. Although the Sim class is
perfectly adequate for simple simulations, the Simulator class
is more general and supports more functionnalities.
For example, if one needs to have more than one simulation clock and event list,
one will have to use the Simulator class instead of the simpler
Sim class.
| Modifier and Type | Method and Description |
|---|---|
static EventList |
getEventList()
Gets the currently used event list.
|
static void |
init()
Reinitializes the simulation executive by clearing up the event
list, and resetting the simulation clock to zero.
|
static void |
init(EventList evlist)
Same as
init, but also chooses evlist as the
event list to be used. |
static void |
start()
Starts the simulation executive.
|
static void |
stop()
Tells the simulation executive to stop as soon as it takes control,
and to return control to the program that called
start. |
static double |
time()
Returns the current value of the simulation clock.
|
public static double time()
public static void init()
SimProcess.init
must be used instead.public static void init(EventList evlist)
init, but also chooses evlist as the
event list to be used. For example, calling
init(new DoublyLinked()) initializes the simulation
with a doubly linked linear structure for the event list.
This method must not be used to initialize process-driven
simulation;
umontreal.iro.lecuyer.simprocs.DSOLProcessSimulator (EventList) or
umontreal.iro.lecuyer.simprocs.ThreadProcessSimulator (EventList)
must be used instead.evlist - selected event list implementationpublic static EventList getEventList()
public static void start()
public static void stop()
start.
This program will then continue
executing from the instructions right after its call to Sim.start.
If an Event is currently executing (and this event has just called
Sim.stop), the executive will take
control when the event terminates its execution.To submit a bug or ask questions, send an e-mail to Pierre L'Ecuyer.