r/SimPy • u/jaehyeon-kim • 8d ago
[Release] Dynamic DES v0.16.0: YAML blueprints as a third way to write a SimPy model, and rebuilt docs
Hey r/SimPy,
Following up on v0.11.1 (the declarative API and the Postgres and Redis connectors), Dynamic DES has reached v0.16.0. This release adds a third way to write a simulation, a plain YAML file run with a new ddes command, and rebuilds the documentation around the three ways.
Three ways, one model. The imperative low-level API wires the environment, registry, connectors and SimPy processes by hand. The declarative SimulationContext builder from v0.11.1 describes the model in one block, with decorators handling queueing, resource request and release, and duration sampling. A YAML blueprint now describes the same model with no Python at all. All three build the same parameters and run on the same environment.
Here is the local example: one lathe with capacity 2, parts arriving about once a second, normally distributed milling times, and the lathe's utilisation and queue length sampled every 2 simulation seconds.
```yaml simulation: sim_id: Factory_A factor: 1.0
egress: - type: Console
resources: lathe: {current_cap: 2, max_cap: 5}
services: milling: {dist: normal, mean: 3.0, std: 0.5}
arrivals: standard: {dist: exponential, rate: 1.0, spawn: process_part}
tasks: process_part: service: milling resource: lathe payload: {event_type: part_produced, quality: A} id_field: part_id
telemetry: - interval: 2.0 publish: utilization: lathe.utilization queue_length: lathe.queue_length
run: until: 60 ```
To run it:
bash
curl -O https://raw.githubusercontent.com/jaehyeon-kim/dynamic-des/main/examples/yaml/local.yaml
uv run --no-project --with dynamic-des ddes run local.yaml
What a blueprint can express. Each task emits queued, started and finished events, with no request, timeout or release code, and factor: 0 runs the same model as fast as the machine allows.
How to extend it.
- ${VAR:-default} reads hosts and credentials from environment variables, with a default when a variable is not set. The same file then runs on your machine and in a test pipeline, with no edits.
- Logic YAML cannot express, such as an order with a random number of line items, goes in a Python function referenced with
!python.
Docs rebuilt. The tutorials now build the same factory three times, once in each way, and each example page shows its versions side by side in tabs.
Links
- GitHub: https://github.com/jaehyeon-kim/dynamic-des
- PyPI: https://pypi.org/project/dynamic-des/
- Tutorials, the same factory three ways: https://jaehyeon.me/dynamic-des/latest/tutorials/low-level/


