Salabim is a package for discrete event simulation in Python.
It follows the methodology of process description as originally demonstrated in Simula
and later in Prosim, Must and Tomas.
The process interaction methods are also quite similar to SimPy 2.
The package comprises discrete event simulation, queue handling, resources, statistical sampling and monitoring. On top of that real time animation is built in.
The package comes with a number of sample models.
Salabim runs on
- PyPy platform
- Pythonista (iOS)
- PyDroid3 (Android)
The package is runs only under Python 3.4 and higher.
The following packages are required:
|Platform||Base functionality||Animation||Video (mp4, avi)||Animated GIF/PNG|
|CPython||Pillow, tkinter||opencv, numpy||Pillow|
|PyDroid3||Pillow, tkinter||opencv, numpy||Pillow|
Several CPython packages, like WinPython support Pillow out of the box. If not, install with:
pip install Pillow
Under Linux, Pillow can be installed with:
sudo apt-get purge python3-pil
sudo apt-get install python3-pil python3-pil.imagetk
For video production, installation of opencv and numpy may be required with
pip install opencv-python
pip install numpy
To add audio to a video (Windows only), installation of ffmpeg is required. Refer to www.ffmpeg.org for instructions and download.
Running models under PyPy is highly recommended for production runs, where run time is important. We have found 6 to 7 times faster execution compared to CPython. However, for development, nothing can beat CPython or Pythonista.
The preferred way to install salabim is from PyPI with:
pip install salabim
or to upgrade to a new version:
pip install salabim --upgrade
Alternatively, it is possible to install salabim directly from GitHub with the utility install salabim from github.py, which can be found in the GitHub repository.
You can find the package along with some support files and sample models on www.github.com/salabim/salabim.
From there you can directly download as a zip file and next extract all files.
Alternatively the repository can be cloned.
For Pythonista, the easiest way to download salabim is:
- Tap ‘Open in…’.
- Tap ‘Run Pythonista Script’.
- Pick this script and tap the run button
- Import file
- Possibly after short delay, there will be a salabim-master.zip file in the root directory
- Tap this zip file and Extract files
- All files are now in a directory called salabim-master
- Optionally rename this directory to salabim
Salabim itself is provided as one Python script, called salabim.py.
You may place that file in any directory where your models reside.
If you want salabim to be available from other directories, without copying the salabim.py script, either install from PyPI (see above) or run the supplied install salabim.py file or install salabim from github.py. In doing so, you will create (or update) a salabim directory in the site-package directory, which will then contain a copy of the salabim package.
Python is a widely used high-level programming object oriented language for general-purpose programming, created by Guido van Rossum and first released in 1991. An interpreted language, Python has a design philosophy that emphasizes code readability (notably using whitespace indentation to delimit code blocks rather than curly brackets or keywords), and a syntax that allows programmers to express concepts in fewer lines of code than might be used in languages such as C++ or Java. The language provides constructs intended to enable writing clear programs on both a small and large scale.
A good way to start learning about Python is https://www.python.org/about/gettingstarted/