# Description

NONPOIS.MOD is a variation of CARWASH.MOD where the arrival rate of cars varies throughout the day.

CARWASH.MOD is an example of a Poisson process. A Poisson process where the arrival rate varies is called a non-homogeneous Poisson process. NONPOIS.MOD models a non-homogeneous Poisson process using a technique called "thinning" (Lewis and Shedler, 1979). Here we simply generate Poisson events at the maximum rate and keep them with a probability proportional to the current rate. To illustrate: assume we know that during an 24-hour day, customers will arrive at our carwash with the following hourly rates: R[0], R[1],..., R[23] (the rate can be zero if the facility is closed). RMAX is the maximum of these rates.

# State Variables

State Variables in NONPOIS.MOD
Variable Name Abbreviation Variable Description Size Type
QUEUE Q Number of cars in line 1 Integer
SERVERS S Machine is idle/busy = 1/0 1 Integer
R R Poisson arrival rate 24 Real
RMAX RMAX Maximum Poisson arrival rate 1 Real
RATIO RATIO Thinning ratio of current rate to max 1 Real
T T Current time in arrival cycle 1 Integer

# Vertices

Vertices in NONPOIS.MOD
Vertex Name Vertex Description State Changes
RUN The simulation is started S=1
MAXR Generate arrivals at the maximum rate T=MOD{CLK;8}, RATIO=R[T]/RMAX
ENTER Car entering the line Q=Q+1
START Start of service S=0, Q=Q-1
LEAVE End of service S=1

# Initialization Conditions

Initialization Conditions in NONPOIS.MOD
Variable Description
QUEUE Number of cars in line
R Poisson arrival rate
RMAX Maximum Poisson arrival rate

NONPOIS.MOD

# English Translation

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

```The SIGMA Model, NONPOIS.MOD, is a discrete event simulation.
It models Non-Poisson process with 8-HOUR cyclical rate function..
```
```I. STATE VARIABLE DEFINITIONS.
```
```For this simulation, the following state variables are defined:
```
```QUEUE: NUMBER OF CARS IN LINE   (integer valued)
SERVER: MACHINE IS IDLE/BUSY = 1/0   (integer valued)
R[24]: POISSON ARRIVAL RATE  (real valued)
RMAX: MAXIMUM POISSON ARRIVAL RATE  (real valued)
RATIO: THINNING RATION OF CURRENT RATE TO MAX  (real valued)
T: CURRENT TIME IN ARRIVAL CYCLE   (integer 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,R[0],R[1],R[2],R[3],R[4],R[5],R[6],R[7],RMAX) event
occurs when INITIALIZATION OF THE SIMULATION.
Initial values for, QUEUE,R[0],R[1],R[2],R[3],R[4],R[5],R[6],R[7],RMAX, are needed for each run.
This event causes the following state change(s):
SERVER=1
After every occurrence of the RUN event:
Unconditionally, START THE ARRIVAL PROCESS AT MAXR;
that is, schedule the MAXR() event to occur without delay.
```
```2. The ENTER() event occurs when CAR ENTERING THE LINE.
This event causes the following state change(s):
QUEUE=QUEUE+1
After every occurrence of the ENTER event:
If SERVER==1, then START SERVICE WITH THE IDLE MACHINE;
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 CAR WILL BE IN SERVICE FOR 5 MINUTES;
that is, schedule the LEAVE() event to occur in .1 time units.
(Time ties are broken by an execution priority of 6.)
```
```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 SERVICE FOR THE NEXT CAR IN LINE;
that is, schedule the START() event to occur without delay.
```
```5. The MAXR() event occurs when GENERATE ARRIVALS AT THE MAXIMUM RATE.
This event causes the following state change(s):
T=MOD{CLK;8}
RATIO=R[T]/RMAX
After every occurrence of the MAXR event:
Unconditionally, GENERATE THE NEXT ARRIVAL AT MAX RATE;
that is, schedule the MAXR() event to occur in (1/RMAX)*ERL{1} time units.
(Time ties are broken by an execution priority of 6.)
If RND<RATIO, then THIN THE ARRIVAL PROCESS;
that is, schedule the ENTER() event to occur without delay.
```