- •Table of Contents
- •Chapter 1. Using GPSS World
- •Lesson 1 - The GPSS World Program
- •Lesson 2 - Running a Simulation
- •Lesson 3 - Problems
- •Lesson 4 - The Text Editor
- •Lesson 6 - The ADVANCE Block
- •Lesson 9 - GPSS World Commands
- •Lesson 10 - Manual Simulation
- •Lesson 11 - The Graphics Windows
- •Lesson 12 - Reading from and Writing to External Files
- •Lesson 14 - Reports
- •Lesson 15 - Session Journaling
- •Lesson 16 - Continuous Modeling
- •Lesson 17 - PLUS
- •Lesson 19 - Experiments
- •Chapter 2. Applications
- •1. TURNSTIL.GPS
- •2. TELEPHON.GPS
- •3. PERIODIC.GPS
- •4. TVREPAIR.GPS
- •5. QCONTROL.GPS
- •6. ORDERPNT.GPS
- •7. MANUFACT.GPS
- •8. TEXTILE.GPS
- •9. OILDEPOT.GPS
- •10. ASSEMBLY.GPS
- •11. ROBOTFMS.GPS
- •12. BICYCLE.GPS
- •13. STOCKCTL.GPS
- •14. LOCKSIMN.GPS
- •15. FOUNDRY.GPS
- •16. TAPEPREP.GPS
- •17. TRAFFIC.GPS
- •18. POWDER.GPS
- •19. QTHEORY.GPS
- •20. SUPERMRK.GPS
- •21. SHIPPORT.GPS
- •22. EXCHANGE.GPS
- •23. FMSMODEL.GPS
- •24. ETHERNET.GPS
- •25. PREDATOR.GPS
Figure 16—2 Userchains, Expanded One Level
These chains represent the waiting lines for each of the three processes.
If you wish to go on to the next lesson, close all windows related to this model.
CLICK ON The X-Upper Right of Each Window
Otherwise, to end the session
CLICK ON The X-Upper Right of Main Window.
17. TRAFFIC.GPS
Simulation of traffic at a T-junction.
Problem Statement
Cars arrive at a T-junction every 6.28 seconds hyperexponentially distributed (standard deviation = 8.40 seconds). The cars then make a left turn northbound onto a highway. When cars cross the southbound lanes, they must wait in a center aisle which can accommodate a maximum of 8 cars. Each car takes 3.6 seconds (Erlang k=4 ) to cross the traffic lanes. It takes 4 seconds (Erlang k=5 ) to merge with northbound traffic. Southbound traffic arrives every 55±5 seconds and takes 15±5 seconds to pass the T-junction. Northbound traffic arrives every 60±5 seconds and takes 15±5 seconds to pass.
Simulate the traffic at the T-junction for 10 minutes.
1.Determine the transit time of northbound cars turning at the T-junction.
2.Tabulate the actual Erlang service times.
3.Find the maximum number of cars queuing in the lane, waiting to make a left turn.
Listing
; GPSS World Sample File - TRAFFIC.GPS, by Gerard F. Cummings
***********************************************************************
**
*Traffic at a T-Junction *
***********************************************************************
*Erlang Service Times ...Hyperexponential Arrivals *
*Time Unit is 1/100 Second *
***********************************************************************
*A Hyperexponential Probability Distribution Follows
Hyper FVARIABLE (410+((RN2’L’234)#(1343-410)))#(Exponential(2,0,1))
*f(t) = .234(1/4.10) exp(-t/4.1) + .766(1/13.43) exp(-t/13.43)
***********************************************************************
Aisle STORAGE 8
Mergetime TABLE MP2,100,100,20 Crosstime TABLE MP1,100,100,20 Transit TABLE M1,1000,1000,9 Arrivals TABLE V$Hyper,200,200,20
***********************************************************************
GENERATE V$Hyper,,300 ;Hyperexponential QUEUE First
GATE SNF Aisle ;Is there room in the aisle? SEIZE Southlane ;Crosses highway
DEPART First MARK 1
*———Erlang Distribution—————————————————————— ADVANCE (Gamma(3,0,4,90)) ;Erlang K=4 waiting time
*;Mean = 360 time units
*———————————————————————————————————
TABULATE Crosstime ;Record crossing time ENTER Aisle ;Stand in center aisle RELEASE Southlane
QUEUE Two ;Queue for northlane SEIZE Northlane
DEPART Two
LEAVE Aisle MARK 2
* ————Erlang Distribution———————————————————— ADVANCE (Gamma(4,0,5,80)) ;Erlang K=5 waiting time
*;Mean = 400 time units
*——————————————————————————————————
RELEASE Northlane
TABULATE Mergetime ;Merge time to north flow TABULATE Transit
TABULATE Arrivals TERMINATE
***********************************************************************
GENERATE 5000,500,,,10 ;Southbound traffic SEIZE Southlane
ADVANCE 1200,300 ;Time to pass junction RELEASE Southlane
TERMINATE
***********************************************************************
GENERATE 6000,500,,,10 ;Northbound traffic
SEIZE Northlane
ADVANCE 1200,300 ;Time to pass junction RELEASE Northlane
TERMINATE
***********************************************************************
GENERATE 6000 ;Xact every minute TERMINATE 1
***********************************************************************
There are 100 time units in a second. After the Functions, Tables, and Variables are defined, the model is composed of three segments. Transactions in the top segment represent traffic arriving at the T-junction, Transactions in the second segment represent southbound traffic on the highway, Transactions in the third segment represent northbound traffic on the highway, and Transactions in the bottom segment time the simulation by decrementing the Termination Count once per simulated minute.
Running the Simulation
To run the simulation and create a Standard Report,
CHOOSE File / Open
and in the dialog box
SELECT TRAFFIC
and then
SELECT Open
Next, create the simulation.
CHOOSE Command / Create Simulation
then
CHOOSE Command / START
and in the dialog box, replace the 1.
TYPE 10
SELECT OK
The simulation will end when 10 minutes of traffic has been simulated.
When the simulation ends, GPSS World writes a report to the default report file, Traffic.1.1. As discussed in Chapter 1, the Report extension will vary depending on saved simulations and previously existing reports. For our purposes, we will assume that this is the first time the simulation has been created and run giving an extension of 1.1.
This report will be automatically displayed in a window. If you close the window, you can reopen it by using the GPSS World File / Open in the Main Menu. Then you
should choose Report in the "Files of type" drop down box at the bottom of the window. GPSS World reports are written in a special format. If you wish to edit the report, you will have to copy its contents to the clipboard and from there into a word processor. You will not be able to open the file directly in a word processor.
Discussion of Results
The transit times of northbound cars turning at the T-junction are tabulated in Table Transit. The average time was nearly 25 seconds. Times are in units of 0.01 seconds.
The actual Erlang service times were tabulated in Tables Crosstime and Mergetime.
The crossing times had a mean of 3.63 seconds and a standard deviation of 0.39 seconds. The merging times had a mean of 4.04 seconds and a standard deviation of 0.47 seconds.
From the Queue Entity First we see that the maximum number of cars queuing in the lane, waiting to make a left turn was 8. The average time spent waiting was about 11.5 seconds.
Inside the Simulation
Let 's now explore the ending condition of the simulation which generated the Standard Report above. If you are not at the end of the simulation, please translate the model and run it again.
First, look at the average transit time.
CHOOSE Command / SHOW
and in the dialog box
TYPE TB$Transit
Next, the standard deviation of transit times.
CHOOSE Command / SHOW
and in the dialog box
TYPE TD$Transit
Now let’s open some graphics windows.
CHOOSE Window / Simulation Window / Table Window and in the drop-down box in the dialog box
CLICK ON The Down Arrow at the Right End of the Box
CLICK ON Transit
SELECT OK
This is the Table Window for the Transit Table which shows the distribution of total times to travel through the intersection.
CHOOSE Window / Simulation Window / Table Window and in the drop-down box in the dialog box
CLICK ON The Down Arrow at the Right End of the Box
CLICK ON Crosstime
SELECT OK
This is the Table Window which collects the times taken to cross the highway. If you wish, you may open the other Table Windows, Mergetime, and Arrivals, in the same manner. When you are done looking at the various Table Windows, close them.
CLICK ON The X-Upper Right of Each Window
One way to watch the dynamics at the intersection is to view through the Facilities Window and the Storages Window.
CHOOSE Window / Simulation Window / Facilities Window
then
CHOOSE Command / START and in the dialog box, replace the 1.