qtheory

Library for queuing theory calculation


Keywords
queue, queueing, theory
License
MIT
Install
pip install qtheory==1.0.0

Documentation

About The Library

It is a Python library implementing the Queueing theory calculations. As my term paper, I am developing a library, implementing the calculus of queuing theory. This library has the objective of characterising some queuing theory params as the queue arrival rate of clients, attendance rate and others... Implementing in python, this library receives a input file with queue data and gives the output answers. For the undergraduate thesis, I had toke some datas in a real queue and submited to the library as a input, to validate this project.

Files Organization

qtheory
β”œβ”€β”€ __init__.py
β”œβ”€β”€ _multiserver.py
β”œβ”€β”€ multiserver.py
β”œβ”€β”€ _singleserver.py
β”œβ”€β”€ singleserver.py
β”œβ”€β”€ _stats.py
β”œβ”€β”€ stats.py
β”œβ”€β”€ _utils.py
β”œβ”€β”€ README.md
└── requirements.txt

The Library Data Flow

PlantUML model

The Library Usage

It is a main.py exemple using the arrivals resources:

Code

import qtheory as q
import csv
import pandas as pd

def main():
    try:
        #lΓͺ a hora chegada do arquivo CSV
        datafile = open('dados.csv')
        df = pd.read_csv(datafile)
        arrival_times = df['horachegada'].values
        #This is the line numbers in the CSV file 
        # of the begnings of the evaluation intervals. 
        intervals_beginning = [0,130,220,385,501]

        #Evaluating arrivals data
        ans = q.arrivals_per_minutes(arrival_times, intervals_beginning)
        print(ans)

        ans = q.real_relative_frequencys(arrival_times, intervals_beginning)
        print(ans)

        ans = q.arrival_theoretical_comparation(arrival_times, intervals_beginning)
        print(ans)

    except ValueError as err:
        print(err.args)

if __name__ == "__main__":
    main()

Result

PlantUML model

The data file exemple (dados.csv)

PlantUML model