Agent-Based Queueing Simulation

Decision Sciences
Introduced by
Macal, C. M. & North, M. J. (hybrid formalization); queueing theory rooted in Erlang (1909)
Year
2000s
Type
Hybrid simulation — agent-based + queueing
Family
Simulation / optimization

What does it do?

Agent-Based Queueing Simulation (AB-QS) combines agent-based modelling with queueing concepts to represent systems in which entities such as patients, customers or jobs wait for and compete over shared service points.

Each entity is modelled as an agent with its own attributes and decision rules, so entities need not be statistically identical, as they are in classical queueing formulas. The method is most useful when system behaviour depends on how individuals respond to the state of the queue.

The intuition behind the method

Classical queueing formulas such as M/M/1 and M/M/c treat customers as interchangeable and assume fixed arrival and service distributions. In many services, customers respond to the queue they see: some refuse to join a long line, some leave after waiting, and some have priority. AB-QS represents each entity as an agent that observes the system state and acts on its own rules. Congestion and delay patterns then arise from many local interactions rather than being imposed as global assumptions. This bottom-up view matches the general agent-based approach, in which collective system behaviour is observed as the result of agent behaviours and interactions.

History

Queueing theory is usually traced to Erlang's work on telephone exchanges, published in 1909. Agent-based modelling grew out of work on complex adaptive systems and self-organisation. Combining agent-based and queueing ideas became more common as simulation software and growing computing power made hybrid models easier to build. No single originator of the hybrid method is established, so it is best described as a practice that emerged from both traditions rather than attributed to one author. Macal and North's tutorial is a general reference for agent-based modelling and simulation, not for the queueing hybrid.

When to use it

Choose AB-QS when entities differ in ways that change their behaviour at the queue, such as balking, reneging, priority classes or routing preferences, and when those differences affect the outcome of interest. It also suits questions about emergent effects, such as congestion that spreads across linked stages, or about how waiting is distributed across subgroups of agents. Examples include patient flow in healthcare, security screening, call-centre staffing and supply-chain bottlenecks. Do not use it when entities are statistically identical and an analytical formula such as M/M/1 or M/M/c answers the question, because the added complexity is not justified. Avoid it also when data on behavioural parameters, such as patience distributions or routing preferences, cannot be obtained or reasonably estimated, since uncalibrated rules can produce misleading results.

Limitations and considerations

  • Behavioural rules such as balking or reneging need parameters, for example patience distributions, that are rarely observed directly and must be estimated from logs or assumed.
  • Run time grows with the number of agents and the number of replications, so large systems may require high-performance computing.
  • Validation is difficult: confirming that emergent behaviour matches real dynamics usually requires detailed observational data, which may not exist.
  • Too few replications or poorly managed random seeds lead to unreliable estimates and confidence intervals, so the reported precision may not reflect the true uncertainty.

Source conditions do not replace independent scientific review or validation by an analysis engine.

Strengths

  • Represents heterogeneous entity behaviour, such as balking, reneging and priority, that classical queueing formulas cannot express directly.
  • Shows emergent system-level phenomena that arise from local agent decisions, without requiring a global equation for the system.
  • Supports what-if policy tests by changing agent rules or queue configurations and observing the effect on entity-level outcomes.
  • Can represent multi-stage networks with routing and feedback, where a delay at one stage changes arrivals at another.
  • Produces entity-level output, which allows waiting times and abandonment to be compared across agent subgroups.

Applications

  • Illustrative example: emergency department patient flow with heterogeneous patient severity and reneging behaviour.
  • Illustrative example: airport security lane planning that accounts for traveller variability and adaptive routing.
  • Illustrative example: call-centre staffing with agent-level skill differences and customer patience.
  • Illustrative example: bottleneck analysis in multi-stage production queues with machine breakdowns.

How it works

How it works

1

Define the agent types in the system, such as customers, servers and shared resources, and give each its attributes, for example a priority class or a patience level. Arrival rates belong to the arrival process or the environment rather than to individual agents, so they should be specified at that level. Together with the number of queues, servers and routing rules, this population specification replaces the homogeneity assumption of classical M/M/c models.

2

Model the queueing infrastructure: queue disciplines (FIFO, priority, shortest-job-first), the number of servers, service-time distributions (exponential, Erlang or empirical), and routing between service stages. Queues are shared resources that agents compete for, so capacity and overflow rules must be stated explicitly.

3

Program the agent decision rules that govern how agents respond to queue state: balking (refusing entry when the queue is judged too long), reneging (leaving after waiting too long), jockeying (switching to a shorter queue), and adaptive routing. These behavioural rules are what distinguish AB-QS from purely stochastic queueing models.

4

Execute the simulation over a defined time horizon. The engine advances a global clock, processes arrival and departure events, applies agent behavioural rules at each decision point, and updates queue states. Several independent replications, each with its own random seed, are run so that the variability of the output can be estimated. If steady-state statistics are wanted, discard the warm-up period; if the question concerns a transient period such as a daily peak, keep the whole run and report it as transient.

5

Aggregate outputs across replications: the mean and variance of waiting time, queue length distributions, server utilisation, throughput, and agent-level outcomes such as the fraction balking or reneging. Report each mean with a confidence interval computed over independent replications. Treat a difference between scenarios as meaningful only when the intervals clearly separate or a formal comparison supports it. Assess sensitivity to behavioural parameters by varying the agent rules.

Common pitfalls

  • Assuming behavioural parameters, such as patience distributions, without empirical data can produce plausible-looking but unreliable results.
  • Ignoring warm-up bias: if the run starts from empty queues, the early period distorts steady-state statistics unless it is discarded.
  • Confusing model detail with validity: each added behavioural rule adds parameters, and without validation evidence it does not improve accuracy.
  • Running too few replications and reporting point estimates without confidence intervals understates the uncertainty in the output.

Frequently asked questions

How does AB-QS differ from standard discrete-event simulation?

Discrete-event simulation typically models the system as a process through which entities are routed and served, although entities may carry attributes and state-dependent rules. AB-QS places more emphasis on autonomous agents with their own decision rules that respond to the queue state, for example by balking or reneging. The difference is one of degree and emphasis rather than kind, and the two approaches can be combined.

How many replications are needed?

There is no fixed number that applies to all models. Run a pilot set of replications to estimate the output variance, then add replications until the confidence intervals for the outputs of interest are narrow enough for the decision. Rare events, such as extreme congestion, usually need considerably more replications than average waiting time does.

Can AB-QS be used for optimization, not just analysis?

Yes. AB-QS is often coupled with metaheuristics (genetic algorithms, simulated annealing) or response-surface methods to optimize queue configuration parameters (number of servers, scheduling rules) while honoring agent behavioral constraints. This is sometimes called simulation-based optimization.

What software supports agent-based queueing simulation?

AnyLogic supports both agent-based and queueing (process) modelling in one environment, which is why it is commonly used for this method. Arena, Simul8, and SIMIO support queueing, while NetLogo and Mesa (Python) support agent-based modeling; combining both paradigms in those tools typically requires custom code.

When should I prefer a classical M/M/c formula over AB-QS?

Use analytical queueing formulas when entities are homogeneous, arrivals are Poisson, service times are exponential, and you need a quick steady-state estimate. AB-QS is warranted when those assumptions fail: heterogeneous behavior, non-Markovian service, or transient (non-steady-state) analysis.

Related methods

Sources

  1. Macal, C. M., & North, M. J. (2010). Tutorial on agent-based modelling and simulation. Journal of Simulation, 4(3), 151–162.

    Open DOI reference
  2. Agent-based model. Wikipedia.

    Open publication reference