Skip to main content
https://travis-ci.org/Mallets/SimPype.svg?branch=master https://codecov.io/gh/Mallets/SimPype/branch/master/graph/badge.svg https://badge.fury.io/py/simpype.svg https://readthedocs.org/projects/simpype/badge/?version=latest
https://raw.githubusercontent.com/Mallets/SimPype/master/docs/_static/simpype_transparent.png

Overview

SimPype is a simulation framework based on SimPy that relies on the concepts of resource and pipe. SimPype decouples the resource from its queue (pipe) in such a way multiple queueing techniques can be used with the same resource. SimPype also allows to create both custom resource and pipe models that can be reused in multiple simulations.

SimPype supports only Python >= 3.6. Previous versions of Python are not supported. The quickest way to install SimPype is through pip3:

>>> pip3 install simpype

SimPype automatically installs SimPy as dependency.

SimPype documentation can be found on ReadTheDocs while the source code repository is available on GitHub.

Scope

SimPype is tailored to scenarios where the queueing disciplines and the resources occupation are key parts of the system under simulation. People queueing at a post office, supermarket, car wash, cafeteria, etc. are examples of such scenarios.

Concept

A SimPype simulation environment comprises at least one generator and one resource which are connected via a pipeline. The generator generates messages with a given arrival time. Those messages are firs enqueue in the resource pipe and next processed by the resources according with a service time.

A simple scenario with one generator and one resource can be defined as follows in a python3 console:

>>> import simpype
>>> import random
>>> sim = simpype.Simulation(id = 'overview')
>>> gen0 = sim.add_generator(id = 'gen0')
>>> gen0.random['arrival'] = {0: lambda: random.expovariate(1.0)}
>>> res0 = sim.add_resource(id = 'res0')
>>> res0.random['service'] = {0: lambda: random.expovariate(2.0)}
>>> p0 = sim.add_pipeline(gen0, res0)
>>> sim.run(until = 10)

The simulation steps can be summarized as follows:

  1. The generator waits a random arrival time and generates a message;

  2. The generator sends the message to the resource;

  3. The message is enqueued in the resource’s pipe;

  4. When the resource becomes available, the message is dequeued from the pipe;

  5. The message is served by the resource;

  6. The message leaves the resource after a random service time and is sent to the next resource (if any) - Go to step 3.

Any simulation steps can be customized as desired. Follows the tutorial to learn how to customize your simulation environment.

SimPype also provides a built-in logging system for your simulation that automatically logs the simulation steps 3, 4, and 5. The built-in system produces the logs in a tidy format where each variable is saved in its own column and each observation is saved in its own row:

>>> timestamp,message,seq_num,resource,event
... 0.000000000,gen0,0,res0,pipe.in
... 0.000000000,gen0,0,res0,pipe.out
... 0.030509067,gen0,0,res0,resource.serve
... 4.283987797,gen0,1,res0,pipe.in
... 4.283987797,gen0,1,res0,pipe.out
... 4.296562508,gen0,1,res0,resource.serve
... 4.944812881,gen0,2,res0,pipe.in
... 4.944812881,gen0,2,res0,pipe.out
... 5.128244999,gen0,2,res0,resource.serve
... 6.402898951,gen0,3,res0,pipe.in
... 6.402898951,gen0,3,res0,pipe.out
... 7.044417615,gen0,3,res0,resource.serve
... 7.561061272,gen0,4,res0,pipe.in
... 7.561061272,gen0,4,res0,pipe.out
... 7.729431178,gen0,5,res0,pipe.in
... 8.129979622,gen0,4,res0,resource.serve
... 8.129979622,gen0,5,res0,pipe.out
... 8.171601538,gen0,6,res0,pipe.in
... 8.886733703,gen0,5,res0,resource.serve
... 8.886733703,gen0,6,res0,pipe.out
... 8.949540209,gen0,6,res0,resource.serve

This data format is well-suited for being directly processed by data manipulation tools like pandas or tidyverse. SimPype does not provide any tools for parsing the data.

Metadata

Release files for simpype 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for simpype 1.1.0
File Size Uploaded Provenance
simpype-1.1.0.tar.gz 18.7 kB Without provenance Details

Release files / simpype-1.1.0.tar.gz

Download URL simpype-1.1.0.tar.gz
Size 18.7 kB
Tags Source
SHA-256 checksum
How to use checksums
4ed3e6fe713c7508d7962cb2100ef3542dc44ce1a00fd46030a4747a899151ab
BLAKE2b-256 checksum
How to use checksums
50df68d948ee16fa3fdca1515c55b5e5215a212ffd58bf3bcee1e9af9d41c3b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.1

Security for simpype 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page