Skip to content
Tutorials Center
My learning

Topics

Lesson 38 of 38 ยท Projects and Practice

Project: A Call Center Staffing Tool

Combine Erlang C, a half-hourly demand forecast and a simulation check into a staffing planner, then compare analytic and simulated service levels.

In this project you build a small but realistic staffing planner. Given a forecast of calls for each half hour of a day, it chooses the number of agents needed in each period to hit an 80/20 service target (80 percent of calls answered within 20 seconds), reports the cost in agent-hours, and then checks a few periods with a simulation. You will use Erlang C from the staffing lesson and the simulation skills from this chapter.

Step 1: Erlang C and the staffing function

We reuse the formulas: offered load a = ฮป/ฮผ, probability of waiting from Erlang C, service level SL(t) = 1 - C e^{-(cฮผ - ฮป)t}. The function agents_needed returns the smallest c meeting the target.

Step 2: A demand forecast

Real demand is not constant. Here is an invented but typical shape: a morning peak, a lunch dip, an afternoon bump. Values are calls per half hour (labelled as sample data, not real statistics).

Python Planner: agents needed per half hour

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Read the table. The peak slot needs the most agents, and occupancy is higher in busy slots than in quiet ones.

Step 3: Check one slot by simulation

The analytic plan assumes steady state inside each half hour and exponential handling times. A simulation can test a single period with realistic features. Here we simulate the peak slot with Erlang C's assumptions (exponential handling times, no abandonment) to compare with the formula. This is a validation simulation: if it disagrees with the formula, there is a bug in one of them.

Python Simulate the busiest slot and compare

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The planner chose 19 agents for the 110-call slot. Try c = 17 and c = 18 to see the service level drop below the 0.80 target.

Step 4: Extensions to try

  1. Breaks and shrinkage. Multiply the agents needed by 1 / (1 - shrinkage), for example 30 percent shrinkage, and round up.
  2. Abandonment. Add a patience time to each waiting caller (exponential with mean 90 s). Callers who wait longer leave. Measure the abandonment rate and how it improves the service level for the others.
  3. Variable handling times. Replace exponential handling times with a mixture (80 percent short, 20 percent long, same mean) and see how many extra agents are needed. Link this with the P-K lesson on variability.
  4. Cost. Add an agent cost per hour and a penalty per abandoned call, and find the cost-minimizing staffing level in each slot.

This tool uses invented demand and handling times. In a real project you would estimate arrival rates and handling-time distributions from your own logs before trusting the output.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Why is staffing computed separately for each half hour?

    Steady-state formulas fit a period with roughly constant arrival rate; peaks need more agents than the daily average.
  2. 2. What is the purpose of the validation simulation?

    Agreement in the base case builds trust before adding realistic extensions.
  3. 3. Applying 25 percent shrinkage to 15 needed agents gives how many scheduled agents?

    15 / (1 - 0.25) = 20.
  4. 4. Adding customer abandonment to the model will typically

    Callers who give up shorten the line, so Erlang C overestimates waits.

Summary

  • A staffing planner turns a half-hourly forecast into agents per slot using Erlang C.
  • Validate the formula and code with a simulation under identical assumptions.
  • Extensions: shrinkage, abandonment, variable handling times and costs.
  • Always base real inputs on measured data.

Back to the Queueing Theory track