Nivaar Exam Prep

23-Ind-A6 Systems Simulation · December 2017

Question 6 of 8: Non-Preemptive Priority Queue: Hand Simulation

Nivaar worked solution (AI-drafted; not reviewed by a licensed engineer) · Last updated

Notes on this paper

Common Discrete/Continuous Distribution tables, Student-t and Chi-square tables were supplied with the exam; the values below are the same table values obtained by direct computation.

Reference texts: Banks, Carson, Nelson & Nicol, Discrete-Event System Simulation (5th ed., Pearson) — random-number/random-variate generation, input data analysis, output analysis (replications), comparing alternative systems, queueing simulation, and the simulation study life cycle.

Question 6 — Non-Preemptive Priority Queue: Hand Simulation (10 marks)

Question text not reproduced: the examination questions are © Engineers and Geoscientists BC. Open the official past paper (linked at the top of this page) to read the question, then follow the worked solution below.

Given. A single server, non-preemptive priority: whenever the server frees up, it picks the highest-priority customer currently waiting (FCFS within a priority class). Five arriving customers:

CustomerPriorityInterarrivalArrivalService Time
1High—00.7
2Low0.3—1.0
3Low0.5—0.8
4High0.3—1.0
5Low1.2—0.5

Find. (a) the completed Start/End-Service table; (b) mean waiting time for the two High-priority customers; (c) time-average queue length (waiting only, both priorities pooled in one physical line).

Approach. Chain the interarrival times into absolute arrival times, then hand-step the single server: at each service completion, serve the highest-priority customer among those already arrived and waiting (ties broken by earliest arrival).

  1. Arrival times. $A_1=0$; $A_2=0+0.3=0.3$; $A_3=0.3+0.5=0.8$; $A_4=0.8+0.3=1.1$; $A_5=1.1+1.2=2.3$.
  2. Customer 1 (High, arrives at 0, server idle). Starts immediately: Start$=0.0$, End$=0.0+0.7=0.7$.
  3. Server frees at 0.7. Only Customer 2 (Low) has arrived and is waiting $\Rightarrow$ served next: Start$=0.7$, End$=0.7+1.0=1.7$.
  4. Server frees at 1.7. Waiting: Customer 3 (Low, arrived 0.8) and Customer 4 (High, arrived 1.1). High priority pre-empts the queue order (not the customer in service) $\Rightarrow$ Customer 4 served next: Start$=1.7$, End$=1.7+1.0=2.7$.
  5. Server frees at 2.7. Waiting: Customer 3 (Low, since 0.8) and Customer 5 (Low, arrived 2.3). Both Low $\Rightarrow$ FCFS $\Rightarrow$ Customer 3 next: Start$=2.7$, End$=2.7+0.8=3.5$.
  6. Server frees at 3.5. Only Customer 5 remains: Start$=3.5$, End$=3.5+0.5=4.0$.
CustomerPriorityArrivalStart ServiceEnd Service
1High0.00.00.7
2Low0.30.71.7
3Low0.82.73.5
4High1.11.72.7
5Low2.33.54.0

(b) Average waiting time, High-priority. Customer 1 waits $0.0-0.0=0$; Customer 4 waits $1.7-1.1=0.6$. $$\overline{W}_{High} = \frac{0+0.6}{2} = \boxed{0.3}.$$

(c) Average queue length (both priorities, single physical line, waiting only). Tracking the number of customers waiting (excludes whoever is currently in service) against the clock over the whole $[0,4.0]$ run and time-weighting:

IntervalWaitingDuration
[0, 0.3)00.3
[0.3, 0.7)10.4
[0.7, 0.8)00.1
[0.8, 1.1)10.3
[1.1, 1.7)20.6
[1.7, 2.3)10.6
[2.3, 2.7)20.4
[2.7, 3.5)10.8
[3.5, 4.0)00.5
$$L_q = \frac{1}{T}\sum (\text{level}\times\text{duration}) = \frac{4.1}{4.0} = \boxed{1.025\ \text{customers}}.$$
QuantityResult
Average waiting time, High priority0.3
Average queue length (waiting-only, pooled)1.025
Check: "average queue length" is computed as the time-weighted number WAITING (excluding whoever is in service), the standard $L_q$ definition; the number IN SYSTEM ($L$, including the one in service) would instead average $1.025 + 700/4000\cdot1 \approx$ a higher figure since the server is busy for the full run — $L_q$ is used here since the question asks specifically about the shared "queue".