Elective Simulation and Modeling

Simulation and ModelingUnit 38 min read

Queuing Systems: Models, Metrics & Real-World Applications

Unit 3 of Simulation and Modeling explores queuing theory fundamentals—arrival processes, service disciplines, performance metrics (Little’s Law, utilization), and classic models (M/M/1, M/M/c)—with Nepalese examples like eSewa payment queues and Pathao driver dispatch, plus hands-on calculations and validation techniq

Core Concepts

What is a Queuing System?

A queuing system is a mathematical model of a real-world scenario where customers (jobs, people, data packets) arrive, wait in a queue, and receive service from one or more servers. Key components:

FeedbackArrival ProcessQueueService DisciplineServer(s)Departure Process
Basic queuing system components with feedback loop (e.g., retries in M/M/c systems)

Real-world analogy: A Khalti payment queue at a bank ATM:

  • Customers (you) arrive randomly.
  • Queue forms if the server (ATM) is busy.
  • Service time depends on transaction complexity (fixed or variable).
  • Departure: you leave after payment confirmation.

Key Definitions and Metrics

1. Arrival Process

Describes how customers enter the system. Common models:

  • Poisson Process: Arrivals are random, independent, and occur at a constant average rate λ (customers/hour). Example: eSewa users logging in during peak hours (6–9 PM).
  • Deterministic: Fixed time intervals (e.g., buses arriving every 15 minutes at a bus stop).

2. Service Discipline

Rules for selecting the next customer to serve:

Discipline Description Example
FIFO First-In-First-Out (fair) Pathao driver dispatch
LIFO Last-In-First-Out (stack-like) Call-center callbacks
Priority High-priority customers first Emergency room triage
Random Served in random order Lottery system
Shortest Job First (SJF) Shortest service time first CPU scheduling in OS

3. Performance Metrics

Critical for evaluating system efficiency:

  • λ (Lambda): Arrival rate (customers/unit time).
  • μ (Mu): Service rate (customers/unit time per server).
  • ρ (Rho): Utilization factor = λ/μ (must be < 1 to avoid infinite queues).
  • L: Average number of customers in the system (queue + service).
  • Lq: Average number of customers in the queue (waiting).
  • W: Average time a customer spends in the system.
  • Wq: Average waiting time in the queue.

Little’s Law (the golden rule): Example: If 100 customers arrive/hour (λ = 100) and average wait time is 5 minutes (W = 5/60 hours), then customers in the system.


Classic Queuing Models

1. M/M/1 Model

  • M: Markovian (Poisson arrivals, exponential service times).
  • 1: Single server.
  • Assumptions:
    • Arrivals follow Poisson process (rate λ).
    • Service times are exponentially distributed (rate μ).
    • Infinite queue capacity (no customer is turned away).
    • FIFO discipline.
0.10.20.30.40.50.60.70.80.91123456789yρ = λ/μ < 1 (stable system)ρ → 1 (instability)
How L and W explode as ρ approaches 1 (critical for exam questions)

Key Formulas:

Worked Example: NTC Customer Service Call Center

  • Given:
    • Calls arrive at 12/hour (λ = 12).
    • Agent handles 15 calls/hour (μ = 15).
    • Single agent (M/M/1).
  • Calculate: Interpretation: On average, a caller waits 20 minutes before their call is answered, and there are 4 calls (including the one being served) in the system.

2. M/M/c Model

  • c: Multiple servers (e.g., multiple ATMs at a bank).
  • Key Formulas (for ): where is the probability of an empty system:
Customer 1Customer 2Customer 3Customer 4FRONTREARoutin
M/M/c queue with c=2 servers: Customers 1–2 served, 3–4 waiting (illustrates Erlang C formula)

Worked Example: Daraz Order Fulfillment Center

  • Given:
    • Orders arrive at 20/hour (λ = 20).
    • Each of 3 workers (c = 3) processes 10 orders/hour (μ = 10).
    • Poisson arrivals, exponential service.
  • Calculate:
    1. Utilization per server:
    2. Probability of empty system ():
    3. Average orders in system (): Interpretation: On average, 2.33 orders are in the system (queued or being processed).

In the Real World

  1. eSewa Payment Queues:

    • Idea Used: M/M/c model for handling multiple payment requests.
    • How: During Diwali, eSewa’s servers act as "c" servers processing transactions (service rate μ). If λ (transactions/minute) exceeds , queues form, increasing . eSewa uses load balancing (adding more servers) to keep low.
  2. Pathao Driver Dispatch:

    • Idea Used: Priority-based queuing (SJF-like for nearby riders).
    • How: Pathao’s algorithm prioritizes riders closest to available drivers (shortest "service time" to match). This reduces for urgent trips.
  3. Nepal Traffic at Kathmandu Ring Road:

    • Idea Used: M/M/1 with finite queue (traffic lights as servers).
    • How: Vehicles arrive at rate λ (cars/minute) at a signal. If the green light (service rate μ) is busy, cars queue. During peak hours (7–9 AM), approaches 1, causing gridlock. Solutions: add more lanes (increase μ) or optimize signal timing (reduce λ spikes).

Validation and Limitations

When to Use Queuing Models?

Scenario Suitable Model Why?
Single ATM at a bank M/M/1 Single server, random arrivals
Call center with 5 agents M/M/c Multiple servers, Poisson calls
Emergency room triage Priority Queuing Life-critical prioritization
Online exam proctoring (e.g., TU) M/G/1 Variable service times (cheating checks)

Limitations:

  • Assumptions: Real systems rarely fit Poisson/exponential perfectly (e.g., traffic has patterns).
  • Complexity: Models like M/G/1 (general service time) require numerical methods.
  • Human Behavior: Customers may abandon queues (e.g., Daraz shoppers leaving if > 5 minutes).

Exam Tip

  1. Memorize Little’s Law: Always relate , , and . Examiners love questions like: "If a bank has 20 customers on average and each spends 5 minutes, what’s the arrival rate?" Answer: customers/hour.

  2. Stability Check: Always ensure . If , the queue grows infinitely—instant fail if you ignore this.

  3. Real-World Mapping:

    • Single server: ATM, toll booth.
    • Multiple servers: Hospital wards, Daraz fulfillment centers.
    • Priority queues: ICU patients, VIP customers.
  4. Graphical Questions:

    • Sketch a queueing system diagram (like the Mermaid graph above) to explain scenarios.
    • Plot vs. to show how queues explode as approaches 1.
  5. Numerical Traps:

    • Watch units! Convert minutes to hours or vice versa.
    • For M/M/c, calculate step-by-step—examiners test this.

Based on the TU BIT syllabus for Simulation and Modeling, unit 3.

Discussion

Loading…