Skip to main content

A simple DES modeling and simulation environment based on simpy, camunda modeler, and tkinter / pixi.js;

Project description

Camunda-Modeler-based creation of SimPy discrete event simulation models

Wouldn't it be cool to combine the block-based process modeling experience of commercial discrete event simulation packages with the amenities of proper IDE-based source-code editing? (Think Arena / Anylogic / ExtendSim / Plant Simulation / ... but with simple integration of third-party libraries, industry-standard interfaces, unit- and integration testing, dockerization, serverless execution in the cloud of your choice... and even actually working auto-completion! :D)

And all that not only for free, but using the worlds most popular language for data analytics and machine learning?

Casymda enables you to create SimPy3 simulation models, with help of BPMN and the battle-tested Camunda-Modeler.

Created BPMN process diagrams are parsed and converted to Python-code, combining visual oversight of model structure with code-based definition of model behavior. Immediately executable, including a token-based process animation, allowing for space-discrete entity movements, and ready to be wrapped as a gym-environment to let a machine-learning algorithm find a control strategy.

Further information and sample projects:

Installation

From PyPI:

pip install casymda

Features

  • connectable blocks for processing of entities
  • graphical model description via camunda modeler
  • process visualization browser-based or via tkinter
  • space-discrete tilemap-movements of entities
  • Gym-interface implementation for connection of reinforcment learning algorithms
  • gradually typed (checkout pyright for vscode)

Coming soon:

  • automated model generation from process event-logs via PM4Py

Examples

Basic features are illustrated as part of the example models (which also serve as integration tests):

  • basics:
    • bpmn-based generation of a simple model file
    • run the generated model
    • process visualization via tkinter
    • browser-based visualization (served with flask, animated with pixijs)
  • resources:
    • seize and release a resource via graphical modeling
  • tilemap:
  • gym:
    • RL essentials: let an agent learn how to sort fruits according to their type (built on gym and stable-baselines )

For setup just clone the repository and install casymda (virtual environment recommended). See basics-visual-run-tkinter for an example of how to cope with python-path issues.

Design

Development

This project trusts Black for formatting, Sonarqube for static code analysis, and pytest for unit & integration testing. Developed and tested on Linux (Ubuntu 18.04), Python 3.7.5. Tests can be carried out inside a docker-container, optionally including an installation from pypi to verify a successful upload.

Sonarqube

sonarqube server (public docker image):

docker-compose up sonarqube

sonar-scanner (public docker image):

docker-compose up analysis

(run a docker-based unit-test first for coverage-reporting)
(remember to share your drive via Docker-Desktop settings if necessary, to be re-applied after each password change)

Tests

pytest --cov-report term --cov=src/casymda/ tests/

For Docker-based tests see docker-compose.yml

docker-compose run unit-test
docker-compose run examples-test
docker-compose run examples-test-pypi

Virtual environment setup

python3 -m venv venv

Editable installation

pip install -e .

Publish to pypi

python setup.py sdist

twine upload dist/*

pip install twine if necessary,
remember to set the version in setup.py and src/casymda as required

Contact

fladdi.mir@gmx.de

feedback / ideas / discussion / cheering / complaints welcome

MIT License

2020

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

casymda-0.2.18.tar.gz (35.0 kB view details)

Uploaded Source

File details

Details for the file casymda-0.2.18.tar.gz.

File metadata

  • Download URL: casymda-0.2.18.tar.gz
  • Upload date:
  • Size: 35.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.7.5

File hashes

Hashes for casymda-0.2.18.tar.gz
Algorithm Hash digest
SHA256 c030fc1ba012cd60b33bb15f53898a58bda4c2f44c962774e91b739189fdb52f
MD5 19dd33de8fd2ad631df7cf66c024a10b
BLAKE2b-256 e87a821ad72bd0469986a0f1253d9370c926ca2d918909d95d8dfd89c2705dd1

See more details on using hashes here.

Supported by

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