chiaha-SLX Lab 3: The tool crib
Time: 45–55 minutes
You need: a browser, a chiaha-SLX sign-in, and the M/G/1 priority formula (Cobham's formula) for the last part.
Open it: https://slx.chiaha.com/slx?open=deck/tool-crib
Learning goals
- Model two classes of customers sharing one server, one class served first.
- Measure who gains and who pays when you change the priority order.
- See why serving short jobs first lowers the average wait.
- Check a priority queue against Cobham's formula.
The problem
A factory tool crib has one clerk. Two kinds of mechanics come to the window:
| Arrive every | Clerk takes | Priority | |
|---|---|---|---|
| Class 1 | 420 ± 360 seconds | 300 ± 90 seconds | 1 |
| Class 2 | 360 ± 240 seconds | 100 ± 30 seconds | 2 |
All times are spread evenly over their range. A waiting mechanic with the higher priority number is served first; within a class, first come first served. A mechanic already at the window is never interrupted. The crib is modeled for one 8-hour shift, 28,800 seconds.
Find these lines in the model:
| Line in the model | What it means |
|---|---|
shift = 28800 |
the run length, in seconds |
poisson = FALSE |
TRUE switches to random (exponential) arrivals, used in tasks 4 and 5 |
rv_uniform(Arrive1, 60.0, 780.0) priority = 1 |
class 1 arrivals and their priority |
rv_uniform(Arrive2, 120.0, 600.0) priority = 2 |
class 2 arrivals and their priority |
rv_expo(Arrive1, 600.0) priority = 1 and rv_expo(Arrive2, 400.0) priority = 2 |
the same, for the random-arrivals version |
departed1, waited1, departed2, waited2, busy |
mechanics who reached the window, their total seconds in line, per class; seconds of service |
Measures
Tick Show final values and set Runs to 5. For each run:
- Class 1 mean wait =
waited1 ÷ departed1(seconds); class 2 likewise - Mean wait, all mechanics =
(waited1 + waited2) ÷ (departed1 + departed2) - Utilization =
busy ÷ shift
Average each over the five runs.
Before you run
Q1. How busy should the clerk be? Add up each class's share: mean service time ÷ mean time between arrivals. What does that tell you to expect?
Tasks
Keep Seed at 1 and Runs at 5.
- As written. Class 2 (the short jobs) goes first. Run and record the four measures.
- Swap the priorities. In the two
rv_uniform(...)arrival lines, give class 1priority = 2and class 2priority = 1. Run and record. - No priority. Set both to
priority = 1, so the clerk serves in arrival order. Run and record. - Random arrivals, long run. Open the original again (Model button) or
undo your edits. Change
poisson = FALSEtopoisson = TRUEandshift = 28800toshift = 2880000(100 shifts). Arrivals are now exponential with means 600 and 400 seconds; service is unchanged. Run and record. - Random arrivals, class 1 first. Keep task 4's edits and swap the
priorities in the two
rv_expo(...)lines (class 1priority = 2, class 2priority = 1). Run and record.
Questions
Q2. Compare tasks 1, 2 and 3. For each class, which order is best and which is worst? Which order gives the lowest mean wait over all mechanics?
Q3. If every mechanic's time costs the factory the same, which order should the crib use? Explain in one or two sentences why serving the short jobs first helps.
Q4. Utilization barely changes between tasks 1, 2 and 3. Why doesn't the order change how busy the clerk is?
Q5. Tasks 4 and 5 are an M/G/1 queue with two non-preemptive priority classes. Use Cobham's formula to compute each class's mean wait for both orders, and compare with your runs. (For a uniform time on [a, b], E[S²] = (b − a)²/12 + mean².)
The answer key is shown to the course's instructor when signed in.