chiaha-SLX Lab 5: Customers who leave
Time: 40–50 minutes
You need: a browser, a chiaha-SLX sign-in, and the M/M/1 formulas.
Open it: https://slx.chiaha.com/slx?open=gpss/reneging
Learning goals
- Model customers who give up waiting (reneging) with a timed wait.
- Compare two fixes, more patience and a faster server, by what they do to lost customers.
- Remove the reneging and check the model against M/M/1.
- See how reneging hides a queue: short waits for those served, lost customers instead.
The problem
A one-chair barber shop is open 480 minutes. Customers arrive at random, on average every 15 minutes (exponential gaps); a haircut takes on average 12 minutes (exponential). A customer who finds the barber busy waits, but only for so long: customer number n gives up after 2 + 6 × (n mod 100) ÷ 100 minutes. In one day (around 32 customers) that is from about 2 to about 4 minutes. A customer who gives up leaves and doesn't come back.
This model is written in plain SLX rather than as a GPSS deck. The wait until
line does the work: the customer waits until the barber is free or its
patience runs out, whichever comes first.
| Line in the model | What it means |
|---|---|
double patience = 2.0 + 6.0 * (id % 100) / 100.0; |
how long this customer will wait, in minutes |
wait until (!busy or time >= arrived_at + patience); |
wait for the barber, or give up |
advance rv_expo(2, 12.0); |
a haircut, mean 12 minutes |
advance rv_expo(1, 15.0); |
time to the next customer, mean 15 minutes |
advance 480.0; |
the run length, in minutes |
served, reneged, served_time, renege_wait |
customers served, customers who left, their total minutes in the shop (served), total minutes waited before leaving |
Measures
Tick Show final values and set Runs to 5. For each run:
- Share who left =
reneged ÷ (served + reneged) - Mean time in shop, served =
served_time ÷ served(minutes, waiting plus haircut) - Mean wait before leaving =
renege_wait ÷ reneged(minutes)
Average each over the five runs.
Before you run
Q1. If nobody ever left, this would be an M/M/1 queue with λ = 1/15 and μ = 1/12 per minute. Work out the utilization, the mean time in the shop W and the mean wait in line Wq.
Tasks
Keep Seed at 1 and Runs at 5. Each task starts from the original model.
- As written. Run and record served, reneged and the three measures.
- More patience. Change
double patience = 2.0 + 6.0todouble patience = 5.0 + 6.0(3 minutes more for everyone). Run. - A faster barber. Change
rv_expo(2, 12.0)torv_expo(2, 10.0). Run. - Both. Make both changes. Run.
- Nobody leaves, one day. In the original, replace
2.0 + 6.0 * (id % 100) / 100.0with1.0e9(patience longer than any run). Run. - Nobody leaves, a long run. Keep task 5's edit and change
advance 480.0;toadvance 480000.0;(1,000 days). Run. Record the mean time in shop and served per 480 minutes (served × 480 ÷ 480000).
Questions
Q2. In task 1, what share of customers left? How long did they wait before giving up, and how does that compare with their patience?
Q3. Task 2 gave everyone 3 more minutes. Why did it change the share who left so little? (Hint: a customer who arrives while a haircut is under way waits for the rest of it. With exponential haircuts, how long is the rest on average?)
Q4. Which helped more, more patience or a faster barber? What did doing both achieve?
Q5. Compare task 6 with your M/M/1 answer to Q1, then compare task 5 with task 6. Why is one day so far from the formula?
Q6. In task 1, customers who were served spent about a third of the time in the shop that they did in task 5. Is the shop with reneging "better"? What would you report to the owner instead of the mean time in the shop?
The answer key is shown to the course's instructor when signed in.