Skip to content

A python library implementing the Queueing theory calculations.

License

Notifications You must be signed in to change notification settings

jrdutra/qtheory

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Instalation

Python 3.7 PyPi

You can instal qtheory using PyPi by running the followed command line:

pip install qtheory

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.

Library Files Organization

qtheory
├── __init__.py
├── _multiserver.py
├── multiserver.py
├── _stats.py
├── stats.py
├── _utils.py
├── README.md
└── requirements.txt

Library Functions

As you can see in the diagram, circled by red, the qtheory public functions. By default, all functions started with "_", is private, and have to be used just by the library.

PlantUML model

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

About

A python library implementing the Queueing theory calculations.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages