DESimpy
A synchronous discrete event simulation (DES) framework in Python (DESimpy).
Overview
DESimPy provides the core components of DES.
Processes in DESimPy are defined by methods owned by Python objects inherited from the Event abstract base class. These processes can be used to model system-level or component level changes in a modelled system. Such systems might include customers or patients flowing through services, vehicles in traffic, or agents competing in games.
DESimPy implements time-to-event simulation where the next event in a schedule is processed next regardless of the amount of time in the simulated present to that event. This constrasts with "time sweeping" in which a step size is used to increment foreward in time. It is possible to combine time-to-event with time sweeping (see Palmer & Tian 2021), however this package does not provide any explicit support for that.
Installation
pip install desimpy
Quickstart
Here is a small example to show the basic logic. This example is the simple clock process presented in the SimPy documentation.
from desimpy import EventScheduler
def clock(env: EventScheduler, name: str, tick: int | float) -> None:
"""Clock simulation process."""
def action() -> None:
"""Schedule next tick of the clock."""
print(name, env.current_time)
env.timeout(tick, action)
env.timeout(0, action=action)
env = EventScheduler()
clock(env, "fast", 0.5)
clock(env, "slow", 1)
event_log = env.run_until_max_time(2)
Design
- Avoid performance overhead of coroutines.
- Do not change the past (i.e. event log should not be changed during simulation).
- Event schedule ordering is purely temporal order of events elapsing.
- Built-in event logging.
- Can be turned off for better performance.
- Future schedule is mutable to simulate interruptions.
- Activating events.
- Deactivating events.
- Cancelling events.
Metadata
Release files for DESimpy 0.48.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| desimpy-0.48.0.tar.gz | 31.3 kB | Without provenance | Details for desimpy-0.48.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| desimpy-0.48.0-py3-none-any.whl | Python 3 | none | any | Details for desimpy-0.48.0-py3-none-any.whl |
Total release size: 42.9 kB
Release files / desimpy-0.48.0.tar.gz
| Download URL | desimpy-0.48.0.tar.gz |
|---|---|
| Size | 31.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
14fd602bc1e0a13b0d776db922cd78e300a8d4f4f7e4706879d9a3a1280f84b5
|
|
BLAKE2b-256 checksum How to use checksums |
513229517b6aa0beed010eb1a70ce5ef2c12fff87e18bed03085fd9cb9422010
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.3
|
Release files / desimpy-0.48.0-py3-none-any.whl
| Download URL | desimpy-0.48.0-py3-none-any.whl |
|---|---|
| Size | 11.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a25aa755aaa95114f1b4c2e83cdc0b668f3417d43ffc515415422156f7e86834
|
|
BLAKE2b-256 checksum How to use checksums |
a48e390dd8facd3e4c48bac424caf4c2a5aa69ef2207e154e6b9032982984e95
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.3
|
Security for DESimpy 0.48.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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.