Git Product home page Git Product logo

queue_simulation's Introduction

Simple queue simulation

Source code for my blog post Why queues are inevitable See the blog post for context.

A few notes about the terminology: "Machine" means a processing unit, which can be a care team in hospital care, or a DNA sequencing machine at the NGI. "Task" is in the health care a patient with a particular disease to be treated, while it is a sample (or set of samples) at NGI.

This code is general for more than one machine per facility, but in the blog post only the case involving one machine is discussed. In this implementation, only one single duration value is possible for all tasks.

The base.py file contains the classes that form the building blocks for the simulation. The procedure to generate PNG files is also located here. It relies on the Python Imaging Library.

The statistics.py file contains functions to compute mean and standard deviations of a list of values, and is essentially stolen from the standard module with the same name in Python 3.4 and newer.

The graphs.py file contains the code to produce the PNG files shown in the blog post. Those files are also in this repo.

The simulate.py file contains code to produce average numbers for various scenarios. Those were intended to be presented in plots in the blog post, but were left out, in the end. They were not needed to make the point. You can view them using e.g. Plotly. They contain data in the following columns:

  1. Utilization, in fractions.
  2. The parameter given by the CSV file name. An average of 20 runs.
  3. The (sample) standard deviation, using the data from 20 runs.

queue_simulation's People

Contributors

pekrau avatar

Watchers

 avatar  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.