F19 · Topic 3.16
Queue policy simulator
1. Predict first
Predict remaining queue for arrivals[3,0,4,1] with capacity 2.
Change it · step through · explain
Change an input, predict what will happen, then advance one step. Read why the state changes, reset and experiment. This fixed teaching model does not save progress or award XP.
Ready · Make a prediction
- Input 13,0,4,1Waiting
- Input 22Waiting
Ready to experiment
Why: Predict the first change, then advance one step.
Try this: Try capacity 0 and an empty arrivals list. Try a busy tick followed by zero arrivals.
2. Build your procedure
Write a simulation loop with arrivals before service. Record remaining queue after each tick, totalserved and peak end-of-tick queue.
Use AP CSP pseudocode, a language you know, or precise plain language. Your code is not executed here. Use the classroom assignment to save your response.
3. Check boundaries
| Input | Expected | Why this case |
|---|---|---|
| [3,0,4,1]; capacity2 | Queues[1,0,2,1]; served 7; peak 2 | Backlog carries between ticks. |
| [3,0,4,1]; capacity3 | Queues[0,0,1,0]; served 8; peak 1 | Controlled capacity comparison. |
| [0,0]; capacity2 | Queues[0,0]; served0 | No phantom customers. |
4. Explain and reflect
Use the output to recommend a policy, then give one limitation that could reverse the real decision.
Model limits: A fixed discrete-time queue with arrivals before service; it does not estimate individual waiting times or actual school staffing needs.