# Description

QUEUE.MOD models an exponential (M/M/1) queue, so the arrival and service times have an exponential distribution. It is similar to CARWASH.MOD in structure, the only difference being that CARWASH.MOD is a G/G/1 queue.

# State Variables

State Variables in QUEUE.MOD
Variable Name Abbreviation Variable Description Size Type
QUEUE Q The number of jobs waiting in line 1 Integer
SERVER S Server is available/busy/broken=1/0/-1 1 Integer
IAT IAT Mean interarrival time 1,1 Real
MST MST Mean service time 1,1 Real

# Vertices

Vertices in QUEUE.MOD
Vertex Name Vertex Description State Changes
RUN Initialization of the queue and the server S=1
ENTER Arrival of a job Q=Q+1
START Start of service S=0, Q=Q-1
LEAVE End of service S=1

# Initialization Conditions

Initialization Conditions in QUEUE.MOD
Variable Description
QUEUE The number of jobs waiting in line
IAT Mean interarrival time
MST Mean service time

# English Translation

An English translation is a verbal description of a model, automatically generated by SIGMA.

```The SIGMA Model, QUEUE.MOD, is a discrete event simulation.
It models AN EXPONENTIAL (M/M/1) QUEUE.
```
```I. STATE VARIABLE DEFINITIONS.
```
```For this simulation, the following state variables are defined:
```
```QUEUE: THE NUMBER OF JOBS WAITING IN LINE   (integer valued)
SERVER: SERVER IS AVAIL/BUSY/BROKEN=1/0/-1   (integer valued)
IAT: MEAN INTERARRIVAL TIME  (real valued)
MST: MEAN SERVICE TIME  (real valued)
```
```II. EVENT DEFINITIONS.
```
```Simulation state changes are represented by event vertices (nodes or balls) in a SIGMA graph.
Event vertex parameters, if any, are given in parentheses. Logical and dynamic relationships
between pairs of events are represented in a SIGMA graph by edges (arrows) between event vertices.
Unless otherwise stated, vertex execution priorities, to break time ties, are equal to 5.
```
```1. The RUN(QUEUE,IAT,MST) event occurs when INITIALIZATION OF THE QUEUE AND THE SERVER.
Initial values for, QUEUE,IAT,MST, are needed for each run.
This event causes the following state change(s):
SERVER=1
After every occurrence of the RUN event:
Unconditionally, INITIATE THE FIRST JOB ARRIVAL;
that is, schedule the ENTER() event to occur without delay.
(Time ties are broken by an execution priority of 6.)
```
```2. The ENTER() event occurs when ARRIVAL OF A JOB.
This event causes the following state change(s):
QUEUE=QUEUE+1
After every occurrence of the ENTER event:
Unconditionally, SCHEDULE THE NEXT ARRIVAL;
that is, schedule the ENTER() event to occur in IAT*ERL{1} time units.
If SERVER==1, then START SERVICE;
that is, schedule the START() event to occur without delay.
```
```3. The START() event occurs when START OF SERVICE.
This event causes the following state change(s):
SERVER=0
QUEUE=QUEUE-1
After every occurrence of the START event:
Unconditionally, THE JOB IS PLACED IN SERVICE FOR 5 MINUTES;
that is, schedule the LEAVE() event to occur in MST*ERL{1} time units.
```
```4. The LEAVE() event occurs when END OF SERVICE.
This event causes the following state change(s):
SERVER=1
After every occurrence of the LEAVE event:
If QUEUE>0, then START SERVICING THE WAITING JOB;
that is, schedule the START() event to occur without delay.
(Time ties are broken by an execution priority of 4.)
```