Activity: Staffing with Queueing Theory
Advanced Modeling Activities
We work through this together: the instructor types the code, and you type along. Before each run, write down a prediction; then run and check it.
The situation. The production system of the process view activities makes parts in four stations: preparation (2 workers, exponential with a mean of 8 minutes), build line 1 (2 workers, 30% of the parts) and line 2 (3 workers, 70%), both triangular with a mean of 5.33 minutes, and packaging (2 workers, 3.5 minutes on average). Parts arrive every 5 minutes on average, and spend about 31.6 minutes in the system.
Demand is expected to rise by 25%, to one part every 4 minutes. Can the system handle it, and with how few workers can it keep the average time in the system at 30 minutes or less?
Chapter 7 verifies a simulation with queueing theory: treat each station as a queue with \(c\) servers and Poisson arrivals, and approximate its wait in queue. The KSL’s GGcWhittApproximation class computes Whitt’s approximation for a GI/G/c queue from the mean time between arrivals, the mean service time, the number of servers, and the squared coefficients of variation of the time between arrivals and of the service time. We use it to predict, and the simulation to check.
Setup. Get the starter file StaffingWithTheory.kt from the code/ folder beside this activity. Put it in src/main/kotlin/student/activities in your KSL project, the package the file declares; create the folder if you do not have it. It holds the production system model, with the demand and the staffing as parameters, and a predict function that prints each station’s utilization and wait. The two parts marked TODO are what we write.
1. Check the method at today’s demand
TODO 1. We write
stationWaittogether, with oneGGcWhittApproximationper station. Run with today’s demand and staffing. How close is the predicted time in the system to the simulated one? Which station accounts for most of it?The prediction assumes Poisson arrivals at every station. Why is that exact for preparation, and only an approximation for packaging?
2. Demand rises by 25%
Before running, compute each station’s utilization at one part every 4 minutes with today’s staffing. Which station breaks?
TODO 2. Set the demand to one part every 4 minutes and run. What does the prediction say, and what does the simulation show? Why does the simulation not show an infinite time in the system?
3. Choose the staffing
How many preparation workers are needed? Predict the time in the system with that change alone.
The build lines are lightly used. Using predictions only (set
simulateTootofalse), find the fewest workers in all that keep the predicted time in the system at 30 minutes or less. Which stations can lose a worker, and which cannot?Simulate your plan. Does the simulation confirm the prediction? At which station do the prediction and the simulation differ most, and why?
4. Discuss
Why predict first and simulate second, rather than simulate every plan?
Name two things about the real system that the queueing approximation leaves out but a simulation could include.