Skip to main content

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:

  1. yields the awaited object expr to its caller;
  2. suspends execution at that point;
  3. resumes later when send(value) is called on it; an thend
  4. returns the value passed to send() as the result of the await expression 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


Download files

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

Source Distribution

asimpy-0.17.1.tar.gz (465.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

asimpy-0.17.1-py3-none-any.whl (16.1 kB view details)

Uploaded Python 3

File details

Details for the file asimpy-0.17.1.tar.gz.

File metadata

  • Download URL: asimpy-0.17.1.tar.gz
  • Upload date:
  • Size: 465.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for asimpy-0.17.1.tar.gz
Algorithm Hash digest
SHA256 c2ba40ec2a0d88cfe2d3a0fd9dabdc3a078dba8d8ac0ebc849c2af516a292d77
MD5 ffbf0ac2b32e7ed0e9852bb39751383b
BLAKE2b-256 191d85945ce2172d7c8680f2459460befbe8e97ed5dd9f640ed663139677e9a6

See more details on using hashes here.

File details

Details for the file asimpy-0.17.1-py3-none-any.whl.

File metadata

  • Download URL: asimpy-0.17.1-py3-none-any.whl
  • Upload date:
  • Size: 16.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for asimpy-0.17.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a1c832bb6a40ca1c53c7efbd193a9a96de4359452311a9afa6c51763e72f042e
MD5 d0f5deb9d40865d26bca0a79cffa6287
BLAKE2b-256 2a72d7a42ce78f9f4b2d5636f441f820a280e9db7005d90b936e2660492bc9cb

See more details on using hashes here.

Supported by

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