{"id":19289898,"url":"https://github.com/galenseilis/DESimpy","last_synced_at":"2025-04-22T05:31:59.736Z","repository":{"id":244477448,"uuid":"743326287","full_name":"galenseilis/DESimpy","owner":"galenseilis","description":"Discrete event simulation in synchronous Python (DESimpy).","archived":false,"fork":false,"pushed_at":"2025-04-22T02:36:54.000Z","size":2507,"stargazers_count":1,"open_issues_count":10,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-04-22T04:16:47.475Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://galenseilis.github.io/DESimpy/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/galenseilis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-01-15T01:23:57.000Z","updated_at":"2025-04-22T02:36:58.000Z","dependencies_parsed_at":"2024-06-15T01:28:30.036Z","dependency_job_id":"6f2c3a17-f67d-4c5a-b998-b54f04c55cc2","html_url":"https://github.com/galenseilis/DESimpy","commit_stats":null,"previous_names":["galenseilis/desimpy"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/galenseilis%2FDESimpy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/galenseilis%2FDESimpy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/galenseilis%2FDESimpy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/galenseilis%2FDESimpy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/galenseilis","download_url":"https://codeload.github.com/galenseilis/DESimpy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250175072,"owners_count":21387133,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T22:17:24.317Z","updated_at":"2025-04-22T05:31:59.730Z","avatar_url":"https://github.com/galenseilis.png","language":"Python","funding_links":[],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"readme":"# DESimpy\n\nA synchronous [discrete event simulation](https://en.wikipedia.org/wiki/Discrete-event_simulation) (DES) framework in Python (DESimpy).\n\n## Overview\n\nDESimPy provides the core components of DES.\n\nProcesses in DESimPy are defined implicitlyas sequences of events and state transitions. 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.\n\nDESimPy 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 \u0026 Tian 2021](https://www.semanticscholar.org/paper/Implementing-hybrid-simulations-that-integrate-in-Palmer-Tian/bea73e8d6c828e15290bc4f01c8dd1a4347c46d0)), however this package does not provide any explicit support for that.\n\n## Installation\n\n```bash\npip install desimpy\n```\n\n## Quickstart\n\nHere is a small example to show the basic logic. This example is the simple clock process presented in the [SimPy documentation](https://simpy.readthedocs.io/en/stable/index.html).\n\n```python\nfrom desimpy import EventScheduler\n\ndef clock(env: EventScheduler, name: str, tick: int | float) -\u003e None:\n    \"\"\"Clock simulation process.\"\"\"\n\n    def action() -\u003e None:\n        \"\"\"Schedule next tick of the clock.\"\"\"\n        print(name, env.current_time)\n        env.timeout(tick, action)\n\n    env.timeout(0, action=action)\n\nenv = EventScheduler()\n\nclock(env, \"fast\", 0.5)\nclock(env, \"slow\", 1)\n\nevent_log = env.run_until_max_time(2)\n```\n\n# Design\n\n- Avoid performance overhead of coroutines.\n- Do not change the past (i.e. event log should not be changed during simulation).\n- Event schedule ordering is purely temporal order of events elapsing.\n- Built-in event logging.\n    - Can be turned off for better performance.\n- Future schedule is mutable to simulate interruptions.\n    - Activating events.\n    - Deactivating events.\n    - Cancelling events.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgalenseilis%2FDESimpy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgalenseilis%2FDESimpy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgalenseilis%2FDESimpy/lists"}