Discrete event simulation using async/await
Project description
asimpy
A simple discrete event simulation framework in Python using async/await.
Thanks to the creators of SimPy for inspiration.
Core Concepts
Discrete event simulation (DES) simulates systems in which events occur at discrete points in time. The simulation maintains a virtual clock and executes events in chronological order. Unlike real-time systems, the simulation jumps directly from one event time to the next, skipping empty intervals. (Time steps are often referred to as "ticks".)
Async/Await
Python's async/await syntax enables cooperative multitasking without threads.
Functions defined as async def return coroutine objects when called.
These coroutines can be paused at await points and later resumed.
More specifically,
when a coroutine executes value = await expr, it:
- yields the awaited object
exprto its caller; - suspends execution at that point;
- resumes later when
send(value)is called on it; an thend - returns the value passed to
send()as the result of theawaitexpression inside the resumed coroutine.
asimpy uses this mechanism to pause and resume coroutines to simulate simultaneously execution.
This is similar to the yield-based mechanism used in SimPy.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file asimpy-0.19.0.tar.gz.
File metadata
- Download URL: asimpy-0.19.0.tar.gz
- Upload date:
- Size: 468.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
14231e4ab15d743387f1084f0f048e438443118fa324de27b6bde2777e94c77f
|
|
| MD5 |
281076296ab5a158305cff66ccf00f23
|
|
| BLAKE2b-256 |
9c20c2e733c0947da2e5dd662386e62e1a05c5d0d5c0cba3b0ada71837eee873
|
File details
Details for the file asimpy-0.19.0-py3-none-any.whl.
File metadata
- Download URL: asimpy-0.19.0-py3-none-any.whl
- Upload date:
- Size: 17.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a5e05f9028d7f5c5aaba2cf5910c05759c1307c58b45d41a2cde8bef9718efda
|
|
| MD5 |
c54bd537c4074bb9535946c92a428b73
|
|
| BLAKE2b-256 |
02f28a90424cf2f94df5a6ab8536e030f51f5b8c3648ef4221eeeed27b030e2e
|