Semester
Subject
Year
Tribhuwan University
2079
Bachelor Level / Third Year / Fifth Semester / Science
(Simulation and Modeling)
Full Marks: 60
Pass Marks: 24
Time: 3 Hours
Candidates are required to give their answers in their own words as for as practicable.
The figures in the margin indicate full marks.
Long Answers Questions
A transaction is a dynamic entity in GPSS that moves through the block diagram representing temporary objects flowing through the system (such as customers, jobs, messages, etc.).
GENERATE block and destroyed by the TERMINATE blockA facility is a system resource in GPSS that can be used by only one transaction at a time, representing single-server entities like a barber, a machine, or a counter.
SEIZE blockRELEASE blockKey Statistics Collected:
Problem Statement:
GENERATE 15,3 → Customers arrive every 15±3 min
↓
QUEUE BARBERQ → Join the waiting line
↓
SEIZE JOEY → Capture the barber (facility)
↓
DEPART BARBERQ → Leave the waiting line
↓
ADVANCE 18,2 → Get haircut (18±2 min)
↓
RELEASE JOEY → Free the barber
↓
TERMINATE 1 → Customer leaves the system
Timer Segment:
GENERATE 540 → Generate one transaction after 540 min
↓
TERMINATE 1 → Stop simulation
* Joey Barbershop Simulation
* Simulation time: 9 hours = 540 minutes
SIMULATE
* Customer Segment
GENERATE 15,3 ;Customers arrive every 15±3 min
QUEUE BARBERQ ;Enter the queue
SEIZE JOEY ;Capture barber facility
DEPART BARBERQ ;Leave the queue
ADVANCE 18,2 ;Haircut takes 18±2 min
RELEASE JOEY ;Release the barber
TERMINATE 0 ;Customer exits system
* Timer Segment
GENERATE 540 ;Timer transaction at 540 min
TERMINATE 1 ;Decrement TG1 counter
* Control Statement
START 1 ;Run until 1 termination from timer
END
| Block | Purpose |
|---|---|
GENERATE 15,3 |
Creates transactions (customers) at mean 15 min, spread ±3 min |
QUEUE BARBERQ |
Collects queue statistics (waiting time, queue length) |
SEIZE JOEY |
Transaction captures the single-server facility "JOEY" |
DEPART BARBERQ |
Removes transaction from queue statistics collection |
ADVANCE 18,2 |
Holds transaction for service time (18±2 min) |
RELEASE JOEY |
Frees the facility for the next transaction |
TERMINATE |
Removes transaction from the model |
START 1 |
Runs simulation until termination counter reaches 1 |
This model uses one facility (JOEY) representing the single barber. Since service time (18 min avg) exceeds inter-arrival time (15 min avg), we expect high utilization and queue buildup. The simulation runs for exactly 540 minutes (9 hours), after which GPSS automatically generates statistics on facility utilization, queue length, and waiting times.
Short Answers Questions