Semester
Subject
Year
Tribhuwan University
2082
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
MARK block is used to record the current clock time in a specified parameter of a transaction, which can later be used to calculate transit time or time intervals.
Syntax: MARK A
TABULATE block is used to collect statistical data and record frequency distributions in a TABLE entity.
Syntax: TABULATE A
TABLE Definition Syntax: name TABLE A,B,C,D
Where A = variable, B = upper limit of first class, C = class width, D = number of classes
Given Data:
GENERATE → QUEUE → SEIZE → DEPART → ADVANCE → RELEASE → TABULATE → TERMINATE
The flow is:
* Coffee Shop Simulation Model
* Simulation time: 480 minutes (8 hours)
SIMULATE
* Define Table for Transit Time
THRUPUT TABLE MP1,0,1,20
* Customer Generation and Service
GENERATE 3,FN$XPDIS ;Customers arrive every 3 min (exponential)
MARK 1 ;Mark arrival time in parameter 1
QUEUE LINE ;Join the waiting line
SEIZE BARISTA ;Capture the barista
DEPART LINE ;Leave the queue
ADVANCE 2.5,FN$XPDIS ;Service time avg 2.5 min (exponential)
RELEASE BARISTA ;Free the barista
TABULATE THRUPUT ;Record transit time in table
TERMINATE ;Customer leaves
* Timer Segment
GENERATE 480 ;Generate one transaction at 480 min
TERMINATE 1 ;Decrement termination counter
* Control Statement
START 1 ;Run until counter reaches 0
END
| Block | Purpose |
|---|---|
| GENERATE 3 | Creates customers with inter-arrival time of 3 min |
| MARK 1 | Records arrival time in parameter 1 |
| QUEUE LINE | Collects queue statistics |
| SEIZE BARISTA | Customer occupies the single server |
| DEPART LINE | Removes customer from queue count |
| ADVANCE 2.5 | Simulates service time of 2.5 min |
| RELEASE BARISTA | Frees server for next customer |
| TABULATE THRUPUT | Records total time in system |
| TERMINATE 1 | Ends simulation after 480 minutes |
Conclusion: The MARK block timestamps transactions on arrival, and the TABULATE block records time-based statistics in tables. Together, they provide essential performance metrics like average time-in-system for the coffee shop simulation model.
Short Answers Questions