This simulation project models a customer queue system using Python and SimPy. It simulates customers arriving at a service point, waiting in a queue if necessary, being served, and then leaving the system. The project also includes visualizations of waiting times and provides statistical analysis of the system's performance.
This project requires the following dependencies:
- SimPy: A process-based discrete-event simulation library.
- Matplotlib: A plotting library for creating visualizations.
- Tabulate: A library for formatting data into tables.
You can install these dependencies via pip: pip install simpy matplotlib tabulate
This version shows the simulation for 11 customers with given interarrival times and given random service times arrays with values.
To run the simulation, execute the Python script exact_numbers.py. Make sure you have Python installed on your system.
python exact_numbers.py
This version shows the simulation for 100 customers with randomly generated interarrival times and randomly generated random service times arrays with values.
To run the simulation, open the Jupyter Notebook theProject.ipynb in Jupyter Notebook or Jupyter Lab and execute the cells.
The simulation will output the following:
- A table showing various metrics for each customer, including arrival time, service time, waiting time in queue, time spent in the system, etc.
- Histograms displaying the distribution of queue time and system time.
Additionally, the script calculates and prints various performance metrics, such as average waiting time in queue, probability of waiting, probability of idle server, average service time, average interarrival time, average time a customer spends in the queue, and average time a customer spends in the system.
num_customers: The number of customers to simulate.interarrival_times: A list representing the interarrival times of customers.random_service_times: A list representing the service times of customers.
You can adjust these parameters in the script according to your requirements.
Feel free to contribute to this project by adding new features, improving the simulation logic, or optimizing the code. Fork the repository, make your changes, and submit a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.