Queueing Systems

Single-station queueing system analysis.

The qsys module provides exact and approximate formulas for single queueing systems such as M/M/c, M/G/1, G/G/1, and their variants.

Key function categories:

Single queueing system analysis functions.

This module provides analytical formulas and approximations for single queueing systems, including classical models like M/M/1, M/M/k, M/G/1, and various G/G/1 approximations.

Supported queueing systems: - qsys_mm1: M/M/1 queue (Poisson arrivals, exponential service) - qsys_mmk: M/M/k queue (Poisson arrivals, k exponential servers) - qsys_gm1: G/M/1 queue (general arrivals, exponential service) - qsys_mg1: M/G/1 queue (Poisson arrivals, general service) - Various G/G/1 approximations (Whitt, Allen-Cunneen, Kingman, etc.)

These functions compute exact results where available, or high-quality approximations for more general cases.

qsys_mm1(lambda_val, mu)[source]

Analyze M/M/1 queue (Poisson arrivals, exponential service).

Parameters:
  • lambda_val (float) – Arrival rate.

  • mu (float) – Service rate.

Returns:

Performance measures including:
  • L: Mean number in system

  • Lq: Mean number in queue

  • W: Mean response time

  • Wq: Mean waiting time

  • rho: Utilization (λ/μ)

Return type:

dict

qsys_mmk(lambda_val, mu, k)[source]

Analyze M/M/k queue (Poisson arrivals, k exponential servers).

Parameters:
  • lambda_val (float) – Arrival rate.

  • mu (float) – Service rate per server.

  • k (int) – Number of parallel servers.

Returns:

Performance measures including L, Lq, W, Wq, rho, P0.

Return type:

dict

qsys_gm1(lambda_val, mu, sigma_s_squared)[source]

Analyze G/M/1 queue (general arrivals, exponential service).

Parameters:
  • lambda_val (float) – Arrival rate.

  • mu (float) – Service rate.

  • sigma_s_squared (float) – Variance of service times.

Returns:

Performance measures including L, Lq, W, Wq, rho.

Return type:

dict

qsys_mg1(lambda_val, mu, sigma_s_squared)[source]

Analyze M/G/1 queue (Poisson arrivals, general service).

Parameters:
  • lambda_val (float) – Arrival rate.

  • mu (float) – Mean service rate.

  • sigma_s_squared (float) – Variance of service times.

Returns:

Performance measures including L, Lq, W, Wq, rho.

Return type:

dict

qsys_gig1_approx_lin(lambda_val, mu, ca_squared, cs_squared)[source]

G/G/1 queue approximation using linear interpolation.

Parameters:
  • lambda_val (float) – Arrival rate.

  • mu (float) – Service rate.

  • ca_squared (float) – Squared coefficient of variation of arrivals.

  • cs_squared (float) – Squared coefficient of variation of service.

Returns:

Approximate performance measures.

Return type:

dict

qsys_gig1_approx_kk(lambda_val, mu, ca_squared, cs_squared)[source]

G/G/1 queue approximation using Kraemer-Langenbach-Belz method.

Parameters:
  • lambda_val (float) – Arrival rate.

  • mu (float) – Service rate.

  • ca_squared (float) – Squared coefficient of variation of arrivals.

  • cs_squared (float) – Squared coefficient of variation of service.

Returns:

Approximate performance measures.

Return type:

dict

qsys_gig1_approx_whitt(lambda_val, mu, ca_squared, cs_squared)[source]

G/G/1 queue approximation using Whitt’s method.

Parameters:
  • lambda_val (float) – Arrival rate.

  • mu (float) – Service rate.

  • ca_squared (float) – Squared coefficient of variation of arrivals.

  • cs_squared (float) – Squared coefficient of variation of service.

Returns:

Approximate performance measures.

Return type:

dict

qsys_gig1_approx_allencunneen(lambda_val, mu, ca_squared, cs_squared)[source]

G/G/1 queue approximation using Allen-Cunneen method.

Parameters:
  • lambda_val – Arrival rate

  • mu – Service rate

  • ca_squared – Squared coefficient of variation of arrivals

  • cs_squared – Squared coefficient of variation of service

Returns:

Performance measures (W, rho)

Return type:

dict

qsys_gig1_approx_heyman(lambda_val, mu, ca_squared, cs_squared)[source]

G/G/1 queue approximation using Heyman method.

Parameters:
  • lambda_val – Arrival rate

  • mu – Service rate

  • ca_squared – Squared coefficient of variation of arrivals

  • cs_squared – Squared coefficient of variation of service

Returns:

Performance measures (W, rho)

Return type:

dict

qsys_gig1_approx_kobayashi(lambda_val, mu, ca_squared, cs_squared)[source]

G/G/1 queue approximation using Kobayashi method.

Parameters:
  • lambda_val – Arrival rate

  • mu – Service rate

  • ca_squared – Squared coefficient of variation of arrivals

  • cs_squared – Squared coefficient of variation of service

Returns:

Performance measures (W, rho)

Return type:

dict

qsys_gig1_approx_marchal(lambda_val, mu, ca_squared, cs_squared)[source]

G/G/1 queue approximation using Marchal method.

Parameters:
  • lambda_val – Arrival rate

  • mu – Service rate

  • ca_squared – Squared coefficient of variation of arrivals

  • cs_squared – Squared coefficient of variation of service

Returns:

Performance measures (W, rho)

Return type:

dict

qsys_gig1_ubnd_kingman(lambda_val, mu, ca_squared, cs_squared)[source]

G/G/1 queue upper bound using Kingman method.

Parameters:
  • lambda_val – Arrival rate

  • mu – Service rate

  • ca_squared – Squared coefficient of variation of arrivals

  • cs_squared – Squared coefficient of variation of service

Returns:

Upper bound performance measures (W, rho)

Return type:

dict

qsys_gigk_approx(lambda_val, mu, ca_squared, cs_squared, k)[source]

G/G/k queue approximation for k servers.

Parameters:
  • lambda_val – Arrival rate

  • mu – Service rate per server

  • ca_squared – Squared coefficient of variation of arrivals

  • cs_squared – Squared coefficient of variation of service

  • k – Number of servers

Returns:

Performance measures (W, rho)

Return type:

dict

qsys_gigk_approx_kingman(lambda_val, mu, ca_squared, cs_squared, k)[source]

G/G/k queue approximation using Kingman method.

Parameters:
  • lambda_val – Arrival rate

  • mu – Service rate per server

  • ca_squared – Squared coefficient of variation of arrivals

  • cs_squared – Squared coefficient of variation of service

  • k – Number of servers

Returns:

Performance measures (W, rho)

Return type:

dict

qsys_gg1(arrival_mean, arrival_scv, service_mean, service_scv)[source]

Analyze G/G/1 queueing system.

Parameters:
  • arrival_mean – Mean inter-arrival time

  • arrival_scv – Squared coefficient of variation of inter-arrival times

  • service_mean – Mean service time

  • service_scv – Squared coefficient of variation of service times

Returns:

Performance metrics including utilization, queue length, and waiting time

Return type:

dict

qsys_gig1_approx_gelenbe(arrival_mean, arrival_scv, service_mean, service_scv)[source]

G/G/1 approximation using Gelenbe’s method.

Parameters:
  • arrival_mean – Mean inter-arrival time

  • arrival_scv – Squared coefficient of variation of inter-arrival times

  • service_mean – Mean service time

  • service_scv – Squared coefficient of variation of service times

Returns:

Approximate performance metrics

Return type:

dict

qsys_gig1_approx_kimura(arrival_mean, arrival_scv, service_mean, service_scv)[source]

G/G/1 approximation using Kimura’s method.

Parameters:
  • arrival_mean – Mean inter-arrival time

  • arrival_scv – Squared coefficient of variation of inter-arrival times

  • service_mean – Mean service time

  • service_scv – Squared coefficient of variation of service times

Returns:

Approximate performance metrics

Return type:

dict

qsys_gig1_approx_klb(arrival_mean, arrival_scv, service_mean, service_scv)[source]

G/G/1 approximation using Kraemer-Langenbach-Belz formula.

Parameters:
  • arrival_mean – Mean inter-arrival time

  • arrival_scv – Squared coefficient of variation of inter-arrival times

  • service_mean – Mean service time

  • service_scv – Squared coefficient of variation of service times

Returns:

Approximate performance metrics

Return type:

dict

qsys_gig1_approx_myskja(arrival_mean, arrival_scv, service_mean, service_scv)[source]

G/G/1 approximation using Myskja’s method.

Parameters:
  • arrival_mean – Mean inter-arrival time

  • arrival_scv – Squared coefficient of variation of inter-arrival times

  • service_mean – Mean service time

  • service_scv – Squared coefficient of variation of service times

Returns:

Approximate performance metrics

Return type:

dict

qsys_gig1_approx_myskja2(arrival_mean, arrival_scv, service_mean, service_scv)[source]

G/G/1 approximation using Myskja’s refined method.

Parameters:
  • arrival_mean – Mean inter-arrival time

  • arrival_scv – Squared coefficient of variation of inter-arrival times

  • service_mean – Mean service time

  • service_scv – Squared coefficient of variation of service times

Returns:

Approximate performance metrics

Return type:

dict

qsys_gig1_lbnd(arrival_mean, arrival_scv, service_mean, service_scv)[source]

Lower bound for G/G/1 queue performance.

Parameters:
  • arrival_mean – Mean inter-arrival time

  • arrival_scv – Squared coefficient of variation of inter-arrival times

  • service_mean – Mean service time

  • service_scv – Squared coefficient of variation of service times

Returns:

Lower bounds on performance metrics

Return type:

dict

qsys_gigk_approx_cosmetatos(arrival_mean, arrival_scv, service_mean, service_scv, num_servers)[source]

G/G/k approximation using Cosmetatos method.

Parameters:
  • arrival_mean – Mean inter-arrival time

  • arrival_scv – Squared coefficient of variation of inter-arrival times

  • service_mean – Mean service time

  • service_scv – Squared coefficient of variation of service times

  • num_servers – Number of servers

Returns:

Approximate performance metrics

Return type:

dict

qsys_gigk_approx_whitt(arrival_mean, arrival_scv, service_mean, service_scv, num_servers)[source]

G/G/k approximation using Whitt’s method.

Parameters:
  • arrival_mean – Mean inter-arrival time

  • arrival_scv – Squared coefficient of variation of inter-arrival times

  • service_mean – Mean service time

  • service_scv – Squared coefficient of variation of service times

  • num_servers – Number of servers

Returns:

Approximate performance metrics

Return type:

dict

qsys_mg1k_loss(arrival_rate, service_mean, service_scv, buffer_size)[source]

M/G/1/k queue with finite buffer - compute loss probability.

Parameters:
  • arrival_rate – Arrival rate

  • service_mean – Mean service time

  • service_scv – Squared coefficient of variation of service times

  • buffer_size – Buffer capacity

Returns:

Performance metrics including loss probability

Return type:

dict

qsys_mmkk(arrival_rate, service_rate, num_servers, buffer_size)[source]

M/M/k/k Erlang loss system.

Parameters:
  • arrival_rate – Arrival rate

  • service_rate – Service rate per server

  • num_servers – Number of servers

  • buffer_size – System capacity (including servers)

Returns:

Performance metrics including blocking probability

Return type:

dict

qsys_mmm(arrival_rate, service_rate, num_servers)[source]

M/M/m infinite buffer multi-server queue.

Parameters:
  • arrival_rate – Arrival rate

  • service_rate – Service rate per server

  • num_servers – Number of servers

Returns:

Performance metrics

Return type:

dict

qsys_mminf(arrival_rate, service_rate)[source]

M/M/∞ infinite server queue.

Parameters:
  • arrival_rate – Arrival rate

  • service_rate – Service rate per server

Returns:

Performance metrics

Return type:

dict

qsys_mginf(arrival_rate, service_mean, service_scv)[source]

Analyzes M/G/∞ queue (infinite servers).

Computes performance metrics for a queue with Poisson arrivals, general service times, and infinite servers.

Parameters:
  • arrival_rate – Arrival rate.

  • service_mean – Mean service time.

  • service_scv – Squared coefficient of variation of service time.

Returns:

Performance metrics.

Return type:

dict

qsys_mm1k_loss(arrival_rate, service_rate, buffer_size)[source]

Analyzes M/M/1/K queue with finite buffer.

Computes performance metrics and loss probability for a single-server queue with Poisson arrivals, exponential service, and finite capacity.

Parameters:
  • arrival_rate – Arrival rate.

  • service_rate – Service rate.

  • buffer_size – Maximum system capacity (including server).

Returns:

Performance metrics including loss probability.

Return type:

dict

qsys_mg1k_loss_mgs(arrival_rate, service_mean, service_scv, buffer_size)[source]

Analyzes M/G/1/K queue using modified generating function method.

Computes loss probability and performance metrics for finite capacity queues with general service time distributions using the MGS (Modified Generating Function with Spectral) method.

Parameters:
  • arrival_rate – Arrival rate.

  • service_mean – Mean service time.

  • service_scv – Squared coefficient of variation of service time.

  • buffer_size – Maximum system capacity.

Returns:

Performance metrics including loss probability.

Return type:

dict