You are on page 1of 2

http://www.minutemansoftware.com/tutorial/t6.

htm

Problem Statement
A simple telephone system has two external lines. Calls, which originate externally, arrive every 10060 seconds.
When the line is occupied, the caller redials after 51 minutes have elapsed. Call duration is 31 minutes. A tabulation
of the distribution of the time each caller takes to make a successful call is required. How long will it take for 200 calls
to be completed?

Listing
; GPSS World Sample File - TELEPHON.GPS, by Gerard F. Cummings
**************************************************************
*
* Telephone System Model
*
**************************************************************
* Simple Telephone Simulation
* Time Unit is one minute
Sets STORAGE 2
Transit TABLE M1,.5,1,20 ;Transit times
GENERATE 1.667,1 ;Calls arrive
Again GATE SNF Sets,Occupied ;Try for a line
ENTER Sets ;Connect call
ADVANCE 3,1 ;Speak for 3+/-1 min
LEAVE Sets ;Free a line
TABULATE Transit ;Tabulate transit time
TERMINATE 1 ;Remove a Transaction
Occupied ADVANCE 5,1 ;Wait 5 minutes
TRANSFER ,Again ;Try again
**************************************************************
Line by Line Description of Model Function
STORAGE - The Storage Entity Sets, with total capacity of 2, is set up to represent 2 external telephone lines.
TABLE - The Table Transit is defined, so that an on-line histogram of call times can be maintained. Just before a
Transaction is TERMINATEd, the "time in simulation" SNA, M1, is tabulated. This represents the duration from when
the caller first dialed, until he/she finished talking.
GENERATE - A Transaction that represents a call is created every 10060 seconds.
GATE - A GATE Block sends a Transaction to the Block Occupied when all lines are busy. This occurs when the
Storage Entity Sets is full, and represents a caller who must begin waiting before redialing.
ENTER - If either 0 or 1 unit of storage is in use, a Transaction passes through the GATE Block, and into the ENTER
Block, thereby using another storage unit. If all storage units are then in use, no more Transactions will be admitted by
the GATE Block. Each Transaction passing into the ENTER Block represents a call which has been successfully
connected.
ADVANCE - The Transaction then enters an ADVANCE Block, which simulates a call duration of 18060 seconds. It
will remain in this Block until the simulated time has passed.
LEAVE - When a Transaction enters the LEAVE Block, it makes one unit of the Storage Sets available to other
Transactions. This represents a newly available external line.
TABULATE - The TABULATE Block adds a call duration to the histogram of call times collected in Table Transit.
TERMINATE - The TERMINATE Block removes the Transaction from the simulation, after the call has been
completed.

ADVANCE - A Transaction comes to the ADVANCE Block labeled Occupied when it tried, and failed, to acquire a unit
of storage from the Storage Entity Sets. This represents a caller who must wait before redialing.
TRANSFER - The TRANSFER Block sends each Transaction to the GATE Block labeled Again. There, the
Transaction will try again to acquire a storage unit from the Storage Entity Sets. In other words, the caller will redial.
Transactions represent calls begun but not completed. If a new caller finds both lines busy, the GATE Block labeled
Again sends it to wait in the ADVANCE Block labeled Occupied for 5 minutes, or so. After the delay, the Transaction
jumps back up to the GATE Block to try again. Successful callers pass through the GATE Block, encounter a delay
which represents the call, and then leave the simulation.
Notice that the number of phone lines is modeled as a Storage Entity with a capacity of 2. Later, it will be very easy to
experiment with the effects of adding more lines.
If a call cannot be completed, the corresponding Transaction waits for 5 simulated minutes in the ADVANCE Block
labeled Occupied. The number of Transactions here represents the number of callers waiting to redial.
The TABLE statement will produce detailed information on the duration of call attempts. By tabulating the M1 SNA just
before each Transaction is TERMINATEd, we will build a histogram of how long callers took to complete their calls.

You might also like