SSJ API Documentation
Stochastic Simulation in Java
Loading...
Searching...
No Matches
Sim.java
1/*
2 * Class: Sim
3 * Description: contains the executive of a discrete-event simulation
4 * Environment: Java
5 * Software: SSJ
6 * Copyright (C) 2001 Pierre L'Ecuyer and Universite de Montreal
7 * Organization: DIRO, Universite de Montreal
8 * @author
9 * @since
10 *
11 *
12 * Licensed under the Apache License, Version 2.0 (the "License");
13 * you may not use this file except in compliance with the License.
14 * You may obtain a copy of the License at
15 *
16 * http://www.apache.org/licenses/LICENSE-2.0
17 *
18 * Unless required by applicable law or agreed to in writing, software
19 * distributed under the License is distributed on an "AS IS" BASIS,
20 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21 * See the License for the specific language governing permissions and
22 * limitations under the License.
23 *
24 */
25package umontreal.ssj.simevents;
26
27import umontreal.ssj.simevents.eventlist.EventList;
28import umontreal.ssj.simevents.eventlist.SplayTree;
29import umontreal.ssj.simevents.Event;
30import umontreal.ssj.simevents.Simulator;
31
48public final class Sim {
49
50 // Prevents construction of this object
51 private Sim() {
52 }
53
59 public static double time() {
61 }
62
69 public static void init() {
70 // This has to be done another way in order to separate events and processes.
72 }
73
85 public static void init(EventList evlist) {
87 }
88
94 public static EventList getEventList() {
96 }
97
105 protected static Event removeFirstEvent() {
107 }
108
113 public static void start() {
115 }
116
125 public static void stop() {
127 }
128
129 // Used to passivate and activate the main process.
130 // See the SimProcess.dispatch() and SimThread.actions()
131
132// protected static void activate() {
133 // synchronized (eventList) {eventList.notify(); }
134 // }
135
136// protected static void passivate() {
137// synchronized (eventList) {
138 // try { eventList.wait(); } catch (InterruptedException e) {}
139 // }
140 // }
141}
This abstract class provides event scheduling tools.
Definition Event.java:53
static EventList getEventList()
Gets the currently used event list.
Definition Sim.java:94
static void init(EventList evlist)
Same as init, but also chooses evlist as the event list to be used.
Definition Sim.java:85
static void stop()
Tells the simulation executive to stop as soon as it takes control, and to return control to the prog...
Definition Sim.java:125
static double time()
Returns the current value of the simulation clock.
Definition Sim.java:59
static void start()
Starts the simulation executive.
Definition Sim.java:113
static Event removeFirstEvent()
This method is used by the package umontreal.ssj.simprocs; it should not be used directly by a simula...
Definition Sim.java:105
static void init()
Reinitializes the simulation executive by clearing up the event list, and resetting the simulation cl...
Definition Sim.java:69
Represents the executive of a discrete-event simulator.
Event removeFirstEvent()
Removes the first event from the event list and sets the simulation clock to its event time.
EventList getEventList()
Gets the currently used event list.
void stop()
Tells the simulation executive to stop as soon as it takes control, and to return control to the prog...
void start()
Starts the simulation executive.
void init()
Reinitializes the simulation executive by clearing up the event list, and resetting the simulation cl...
static Simulator getDefaultSimulator()
Returns the default simulator instance used by the deprecated class.
double time()
Returns the current value of the simulation clock.
An interface for implementations of event lists.