A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://umontreal-simul.github.io/ssj/docs/master/classumontreal_1_1ssj_1_1simevents_1_1Sim.html below:

SSJ: Sim Class Reference

This static class contains the executive of a discrete-event simulation. More...

static double  time ()   Returns the current value of the simulation clock. More...
  static void  init ()   Reinitializes the simulation executive by clearing up the event list, and resetting the simulation clock to zero. More...
  static void  init (EventList evlist)   Same as init, but also chooses evlist as the event list to be used. More...
  static EventList  getEventList ()   Gets the currently used event list. More...
  static void  start ()   Starts the simulation executive. More...
  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. More...
  static Event  removeFirstEvent ()   This method is used by the package umontreal.ssj.simprocs; it should not be used directly by a simulation program. More...
 

This static class contains the executive of a discrete-event simulation.

It maintains the simulation clock and starts executing the events in the appropriate order. Its methods permit one to start, stop, and (re)initialize the simulation, and read the simulation clock.

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.

◆ getEventList()

Gets the currently used event list.

Returns
the currently used event list
◆ init() [1/2]

Reinitializes the simulation executive by clearing up the event list, and resetting the simulation clock to zero.

This method must not be used to initialize process-driven simulation; umontreal.ssj.simprocs.SimProcess.init must be used instead.

◆ init() [2/2]

Same as 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.ssj.simprocs.DSOLProcessSimulator(init)  (EventList) or
umontreal.ssj.simprocs.ThreadProcessSimulator(init)  (EventList) must be used instead.

Parameters
evlist selected event list implementation
◆ removeFirstEvent() static Event removeFirstEvent ( ) staticprotected

This method is used by the package umontreal.ssj.simprocs; it should not be used directly by a simulation program.

It removes the first event from the event list and sets the simulation clock to its event time.

Returns
the first planned event, or null if there is no such event
◆ start()

Starts the simulation executive.

There must be at least one Event in the event list when this method is called.

◆ stop()

Tells the simulation executive to stop as soon as it takes control, and to return control to the program that called 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.

◆ time()

Returns the current value of the simulation clock.

Returns
the current simulation time

The documentation for this class was generated from the following file:


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4