This repository contains Python implementations and simulations of M/M/s queueing models with both infinite and finite capacity systems. It also includes plotting functions for visualizing queue metrics and a simple discrete-event simulation for real-time queue behavior.
- Computes classic queueing metrics such as:
- ( P_0 ): Probability of zero customers in the system.
- ( L_q ): Average number of customers waiting in the queue.
- ( W_q ): Average waiting time in the queue.
- ( W ): Total average time in the system.
- ( L ): Average number of customers in the system.
- Uses input parameters: arrival rate (( \lambda )), service rate (( \mu )), and number of servers (( s )).
- Raises error if system stability condition (( \rho < 1 )) is violated.
- Extends the infinite queue to account for finite system capacity ( m ).
- Calculates probabilities for all states up to capacity.
- Computes effective arrival rate considering blocking.
- Provides detailed metrics including blocking probability ( P_m ).
- Uses matplotlib to plot queue metrics ( L ), ( L_q ), ( W ), and ( W_q ) against varying system capacity ( m ).
- Visualizes how queue performance changes as capacity increases.
- Discrete event simulation modeling arrivals and service times using exponential distributions.
- Logs events with timestamps for arrivals, service starts, waiting, and service duration.
- Estimates arrival and service rates from simulated data.
- Useful for understanding dynamic behavior and performance estimation.
- Modify parameters like arrival rate, service rate, number of servers, and capacity in each function call.
- Run the scripts to compute analytics or perform simulations.
- Use the plotting script to visualize impact of system capacity.
- Analyze simulation logs for deeper insight into queue dynamics.
- Python 3.x
- math (standard library)
- matplotlib
- pandas
- random (standard library)
Install required libraries using pip if necessary: