Coder Social home page Coder Social logo

pyqueuesimu's Introduction

pyqueuesimu ๐Ÿ“Š

pyqueuesimu is a Python tool for simulating queues. It allows users to simulate queues with different parameters and observe the results.

pyqueuesimu was developed as part of TELECOM Nancy's course "Performance evaluation". The subject is available here.

Table of Contents ๐Ÿ“ƒ

Installation ๐Ÿ’ป

To install pyqueuesimu, follow these steps:

  1. Clone the repository to your local machine.
  2. Navigate to the project directory.
  3. Create a virtual environment to avoid polluting your system: python3 -m venv .venv (python -m venv .venv in Windows)
  4. Activate the virtual environment: source .venv/bin/activate (.venv/Scripts/activate in Windows)
  5. Install the project: pip install .

Usage ๐Ÿš€

To use pyqueuesimu, run the pyqueuesimu command followed by the desired parameters. Here are some examples:

# Run a simulation with 8 clients and a service time of 1.5 seconds per client, observing for 10 seconds.
pyqueuesimu cli 8 1.5 --observation-duration 10

# Run a simulation with 100 clients and a service time of 2 seconds per client, observing for 60 seconds with a GUI.
pyqueuesimu gui 100 2 --observation-duration 60

# Run a simulation with GUI and coherent values based on the given k (default is 2).
pyqueuesimu gui-example --k=2

The full list of parameters is available with the following command: pyqueuesimu --help

Examples ๐Ÿ“ˆ

Here are some examples of pyqueuesimu in action:

cli

The cli command allows outputting all the results to the command-line interface. It's mostly useful with small numbers to avoid too many lines.

pyqueuesimu cli 1 1.5 --observation-duration 10

Result of the execution of the cli command

gui

The gui command works the same as cli but uses matplotlib to show the arrivals and departures.

pyqueuesimu gui 100 2 --observation-duration 60

Result of the execution of the gui command

gui-example

The gui-example runs the queue simulation with GUI and coherent values based on the given k (default is 2). The arrival rate is (324 - 24*k) requests/second and a service takes (0.5 * k + 1) ms/request.

pyqueuesimu gui-example --k=2

Result of the execution of the gui-example command

cli-confidence-interval-on-stats-95-percent

Compute stats on the queue simulation with a confidence interval of 95%. To use the example with k=2, we can use the following command:

pyqueuesimu cli-confidence-interval-on-stats-95-percent 276 500 --observation-duration 60

Result of the execution of the cli-confidence-interval-on-stats-95-percent command

With a limited buffer size

You can limit the buffer size using the --buffer-size parameter.

pyqueuesimu gui 10 15 --observation-duration 10 --buffer-size 0

Every red line indicates that the client was lost due to buffer limitation.

Result of the execution of the gui command with buffer size specified - plot

The loss rate will be shown for statistical purposes.

Result of the execution of the gui command with buffer size specified - loss rate

License ๐Ÿ“œ

pyqueuesimu is released under the MIT License. See LICENSE for details.

pyqueuesimu's People

Contributors

le-chartreux avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.