MATLAB Simulation of Queueing Models with Comprehensive Code Implementation

Resource Overview

Learn about MATLAB simulation of queueing models with detailed explanation and complete code for M/M/s/k model implementation, including arrival/service time generation and system state tracking.

Detailed Documentation

This article provides a comprehensive guide to MATLAB simulation of queueing models, focusing on detailed implementation of the M/M/s/k model with complete source code to facilitate effective learning and mastery of this modeling approach.

First, we introduce the M/M/s/k queueing model. This model applies to systems where customer arrivals follow a Poisson distribution, service times follow an exponential distribution, with s service channels and maximum queue capacity k. Key input parameters include customer arrival rate (λ), service rate (μ), number of servers (s), and maximum queue length (k). The simulation employs random number generators for arrival and service processes while tracking system states through event-driven programming.

We then detail the MATLAB implementation methodology for M/M/s/k simulation. The process begins with generating exponential random variables using MATLAB's exprnd() function for inter-arrival times and service durations. The core algorithm maintains event lists using priority queues, manages server allocation through state variables, and implements queue discipline with FIFO (First-In-First-Out) logic. Complete code includes statistical collection for performance metrics like average waiting time and server utilization rates.

Through studying this material and practicing with the provided code, readers will gain practical skills in implementing M/M/s/k models and can adapt the simulation framework to real-world queueing system optimization, ultimately improving system efficiency and service quality.