Skip to main content

Analysis of discrete-event models governed by timers.

Project description

ORIS for Python

This is a library for the analysis of discrete-event models governed by integer variables and continuous timers:

  • Variables hold positive or negative integers. They represent the observable state of the system. For example, the variable queue could store the current number of customers.

  • Timers track the continuous time to events that change state variables:

    • A timer is enabled if its guard is satisfied. In the queue example, the service timer is enabled when queue > 0.

    • The value of the timer is sampled according to a probability distribution; for example, Unif(1, 2) samples a random value between 1 and 2.

    • When the timer elapses, it can trigger a change in the state variables, for example, queue = queue-1 after service. This change can start other timers (because their guards are now satisfied) or disable them (the guards are not satisfied anymore).

The example of a single-server queue with capacity of 200, Poisson arrivals (exponential interarrival times) and uniform service times looks like this:

from oris import *

b = ModelBuilder()

# for each variable: name, initial value, min, max (defaults: 0, 0, 'inf')
b.var('queue', 1, 0, 200)

# for each timer: name, guard, distribution, state update
b.timer('arrival', 'True',    Exp(0.5),   'queue=min(queue+1, max_value(queue))')
b.timer('service', 'queue>0', Unif(1, 2), 'queue-=1')

m = b.build()

Once you have a model, you can

  • analyze its state space (e.g., can you reach a goal state within time 10?)
  • use simulation to evaluate rewards (e.g., average number of customers in the queue)

Learn more in the manual.

How to Install

To install ORIS: pip3.7 install oris --user --upgrade (you need Python 3.7)

To have a working Python 3.7 environment on Linux, macOS, or Windows, we recommend using miniconda and Jupyter notebooks:

  • Linux and macOS

    curl -O https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
    bash Miniconda3-latest-Linux-x86_64.sh -b -p $HOME/.miniconda
    $HOME/.miniconda/condabin/conda init bash
    bash
    

    For macOS, replace Linux with MacOSX in the first two commands. If you are using macOS Catalina, replace bash with zsh.

  • Windows: run the miniconda installer selecting "Add Anaconda to my PATH".

Now you can create an environment for ORIS:

conda config --set auto_activate_base false
conda create -y -n oris python=3.7 scipy matplotlib numba jupyter
conda activate oris
pip install oris

Every time you want to use ORIS, you can run:

conda activate oris
jupyter notebook

If you'd like to avoid installing anything at all: Just use ORIS inside Google Colaboratory. The only thing you need is:

!pip3 install oris

at the beginning of your notebook.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

oris-0.0.1.tar.gz (15.8 kB view details)

Uploaded Source

Built Distribution

oris-0.0.1-py3-none-any.whl (16.0 kB view details)

Uploaded Python 3

File details

Details for the file oris-0.0.1.tar.gz.

File metadata

  • Download URL: oris-0.0.1.tar.gz
  • Upload date:
  • Size: 15.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

File hashes

Hashes for oris-0.0.1.tar.gz
Algorithm Hash digest
SHA256 ee9d1e341ca1190cc49f21d3b67139effe09de66787620a536a08847b1308206
MD5 ad1987b66f5b1257eca414f09657f2bf
BLAKE2b-256 01f03fd0d3e170a8941df8fd714321156cca0fcf6642fd905454d5abe0abb98d

See more details on using hashes here.

File details

Details for the file oris-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: oris-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 16.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

File hashes

Hashes for oris-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a891ee0d62377a38ee07af8145200839ddc49f2c65a8af3f87fc9257877c8cb9
MD5 dfc24ad84b088964633c7308a9cf68cc
BLAKE2b-256 8b532df4a80bde42482459f8f5f7fe1cdb9238c73ba5bb7b04edf20acb7ab684

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page