Lab-5 CSC 317 Simulation & Modelling
Lab-5 CSC 317 Simulation & Modelling
Lab-5 CSC 317 Simulation & Modelling (B.Sc. CSIT 5th Semester)
6. Save
9. Simulation Journal Window will appear-> it displays the date & time also say the Ready.
Santosh Sharma
Department of Computer Science & IT(CAB-Tech.)
Lab-5
Customers arrive at barber shop at the rate of 18 ± 6. Barbar serves each customer at the rate of 16 ± 4
minutes. Simulate system for queue of customer for one day (i.e. 8 hours).=480min
Output:
NAME VALUE
UNSPECIFIED
CHAIRS 10000.000
JOE 10001.000
Santosh Sharma
Department of Computer Science & IT(CAB-Tech.)
LABEL LOC BLOCK TYPE ENTRY COUNT CURRENT COUNT RETRY
1 GENERATE 26 0 0
2 QUEUE 26 0 0
3 SEIZE 26 0 0
4 DEPART 26 0 0
5 ADVANCE 26 1 0
6 RELEASE 25 0 0
7 TERMINATE 25 0 0
8 GENERATE 1 0 0
9 TERMINATE 1 0 0
FACILITY ENTRIES UTIL. AVE. TIME AVAIL. OWNER PEND INTER RETRY
DELAY
JOE 26 0.863 15.926 1 27 0 0 0
0
Block Entities:
Santosh Sharma
Department of Computer Science & IT(CAB-Tech.)
ii. Barber Shop simulation (simple).
Problem: Customers arrive at barber shop at the rate of 300 ± 100. Mechanic serves each
customer at the rate of 400 ± 200 minutes. Simulate system for queue of customer and measure
of waiting time for 1000 customers.
Model:
Output:
NAME VALUE
BARBER 10000.000
Block Entities:
Santosh Sharma
Department of Computer Science & IT(CAB-Tech.)
iii. Mechanic Shop simulation
Problem: Customers arrive at mechanic shop at the rate of 300 ± 200. Mechanic serves each
customer at the rate of 200 ± 50 minutes. Simulate system for queue of customer and
measure of waiting time for 1000 customers.
Model:
Output:
NAME VALUE
MECHANIC 10000.000
Santosh Sharma
Department of Computer Science & IT(CAB-Tech.)
FACILITY ENTRIES UTIL. AVE. TIME AVAIL. OWNER PEND INTER RETRY
DELAY
MECHANIC 1000 0.660 199.321 1 0 0 0 0
0
Block Entities:
Problem: Construct a GPSS simulation model to represent a basic telephone system with the following
characteristics: Calls are generated randomly, arriving on average every 100 time units with a standard
deviation of 20. The system has one phone line to process calls. If the line is available, calls are handled
immediately; otherwise, they join a queue. Each call takes an average of 50 time units to process, with a
standard deviation of 10. Once a call is completed, the line becomes available for the next queued call. The
simulation concludes after each call is processed.
Santosh Sharma
Department of Computer Science & IT(CAB-Tech.)
Model:
GENERATE 100,20 ; Generate calls every 100 units with a 20 unit standard deviation
ADVANCE 50,10 ; Call duration with a mean of 50 units and a 10 unit standard deviation
Output:
NAME VALUE
CALLQUEUE 10000.000
PHONE 10001.000
FACILITY ENTRIES UTIL. AVE. TIME AVAIL. OWNER PEND INTER RETRY
DELAY
PHONE 50 0.485 49.741 1 0 0 0 0
0
Santosh Sharma
Department of Computer Science & IT(CAB-Tech.)
QUEUE MAX CONT. ENTRY ENTRY(0) AVE.CONT. AVE.TIME AVE.(-0)
RETRY
CALLQUEUE 1 0 50 50 0.000 0.000 0.000 0
Model:
Output:
NAME VALUE
TURN 10000.000
FACILITY ENTRIES UTIL. AVE. TIME AVAIL. OWNER PEND INTER RETRY
DELAY
TURN 300 0.690 4.906 1 0 0 0 0
0
Block Entities:
Santosh Sharma
Department of Computer Science & IT(CAB-Tech.)
vi. Manufacturing Shop.
Problem: A machine tool in a manufacturing shop is turning out parts at the rate of every 5
minutes. As they are finished, the parts are turned over to an inspector who takes 4±3 minutes to
examine each one and rejects about 10% of the parts as faulty. Each part will be represented by a
transaction and the base time unit for the system is chosen as 1 minute. Simulate for 100 parts to
leave the system.
Model-1
GENERATE 5
ADVANCE 4, 3
ACC TERMINATE 1
REJ TERMIMATE 1
START 100
Output:
NAME VALUE
ACC 4.000
REJ 5.000
Santosh Sharma
Department of Computer Science & IT(CAB-Tech.)
Block Entities:
Model-2
GENERATE 5
SEIZE Insp
ADVANCE 4, 3
RELEASE Insp
TRANSFER 0.1 Acc, Rej
Acc TERMINATE 1
Rej TERMINATE 1
START 1000
Output:
GPSS World Simulation Report - Untitled Model 1.3.1
NAME VALUE
ACC 6.000
INSP 10000.000
REJ 7.000
Santosh Sharma
Department of Computer Science & IT(CAB-Tech.)
LABEL LOC BLOCK TYPE ENTRY COUNT CURRENT COUNT RETRY
1 GENERATE 1001 0 0
2 SEIZE 1001 1 0
3 ADVANCE 1000 0 0
4 RELEASE 1000 0 0
5 TRANSFER 1000 0 0
ACC 6 TERMINATE 906 0 0
REJ 7 TERMINATE 94 0 0
FACILITY ENTRIES UTIL. AVE. TIME AVAIL. OWNER PEND INTER RETRY
DELAY
INSP 1001 0.782 3.911 1 1001 0 0 0
0
Block Entities:
Santosh Sharma
Department of Computer Science & IT(CAB-Tech.)
Model -3
Modify the previous example using storages. (ENTER & LEAVE)
There are 3 inspectors
GENERATE 5
ENTER Ins,1
ADVANCE 4,3
LEAVE Ins, 1
TRANSFER 0.1, Acc, Rej
Acc TERMINATE 1
Rej TERMINATE 1
Ins STORAGE 3
START 1000
Output:
NAME VALUE
ACC 6.000
INS 10000.000
REJ 7.000
STORAGE CAP. REM. MIN. MAX. ENTRIES AVL. AVE.C. UTIL. RETRY
DELAY
Santosh Sharma
Department of Computer Science & IT(CAB-Tech.)
INS 3 3 0 2 1000 1 0.796 0.265 0 0
Block Entities:
Model-4
Modifying the previous example using storage & keeping queue statistics: There are 3 inspectors.
GENERATE 5
QUEUE Insq
ENTER Ins,1
DEPART Insq
ADVANCE 4,3
LEAVE Ins, 1
TRANSFER 0.1, Acc, Rej
Acc TERMINATE 1
Rej TERMINATE 1
Ins STORAGE 3
START 1000
Santosh Sharma
Department of Computer Science & IT(CAB-Tech.)
Output:
NAME VALUE
ACC 8.000
INS 10000.000
INSQ 10001.000
REJ 9.000
STORAGE CAP. REM. MIN. MAX. ENTRIES AVL. AVE.C. UTIL. RETRY
DELAY
INS 3 3 0 2 1000 1 0.796 0.265 0 0
Santosh Sharma
Department of Computer Science & IT(CAB-Tech.)
Block Entities:
Model-5
Simulate system for T time units and not for k Xacts to finish a service,
• This line states the objective of the simulation. It aims to run for a specific duration (T time
units) rather than until a certain number of transactions (Xacts) complete a service.
• This provides an example of the simulation duration: 8 hours, where each time unit
represents 1 minute.
GENERATE 5
QUEUE Insq
ENTER Ins,1
DEPART Insq
ADVANCE 4,3
LEAVE Ins, 1
TRANSFER 0.1, Acc, Rej
Acc TERMINATE 0
Rej TERMINATE 0
GENERATE 480
TERMINATE 1
Ins STORAGE 3
START 1
Santosh Sharma
Department of Computer Science & IT(CAB-Tech.)
Output:
NAME VALUE
ACC 8.000
INS 10000.000
INSQ 10001.000
REJ 9.000
STORAGE CAP. REM. MIN. MAX. ENTRIES AVL. AVE.C. UTIL. RETRY
DELAY
INS 3 3 0 2 95 1 0.779 0.260 0 0
Santosh Sharma
Department of Computer Science & IT(CAB-Tech.)
Block Entities:
Santosh Sharma
Department of Computer Science & IT(CAB-Tech.)