{"id":18157497,"url":"https://github.com/caellian/litesim","last_synced_at":"2025-04-07T02:42:39.729Z","repository":{"id":188385874,"uuid":"678649381","full_name":"Caellian/litesim","owner":"Caellian","description":"A discrete event simulation library","archived":false,"fork":false,"pushed_at":"2023-08-28T06:55:38.000Z","size":128,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-13T07:42:47.629Z","etag":null,"topics":["discrete-event-simulation","simulation","simulation-modeling"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/Caellian.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE_APACHE","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}},"created_at":"2023-08-15T03:20:49.000Z","updated_at":"2023-08-23T02:41:51.000Z","dependencies_parsed_at":"2024-12-20T14:47:08.758Z","dependency_job_id":"7d451e56-fff8-4024-927e-01da9d3fdacc","html_url":"https://github.com/Caellian/litesim","commit_stats":{"total_commits":18,"total_committers":1,"mean_commits":18.0,"dds":0.0,"last_synced_commit":"c6b8a3bf45262f7a24e83e559c24a50f8d06d476"},"previous_names":["caellian/litesim"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Caellian%2Flitesim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Caellian%2Flitesim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Caellian%2Flitesim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Caellian%2Flitesim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Caellian","download_url":"https://codeload.github.com/Caellian/litesim/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247584062,"owners_count":20962071,"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":["discrete-event-simulation","simulation","simulation-modeling"],"created_at":"2024-11-02T06:06:26.262Z","updated_at":"2025-04-07T02:42:39.706Z","avatar_url":"https://github.com/Caellian.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LiteSim\n\nA [discrete-event simulation](https://en.wikipedia.org/wiki/Discrete-event_simulation) library.\n\n## Features\n\nLiteSim is rougly based on [Discrete Event System Specification (DEVS)](https://en.wikipedia.org/wiki/DEVS) which allows a modular design of simulations.\n\n- A simulation is composed out of models which can communicate with each other through connections.\n- Multiple models can be composed together to form a more complex behavior.\n- Model inputs and outputs are type safe.\n\nIt's very easy and straightforward to implement new models through a single `Model` trait with `#[litesim_model]` annotation:\n```rust\npub struct Player;\n\n#[litesim_model]\nimpl\u003c's\u003e Model\u003c's\u003e for Player {\n    #[input(signal)]\n    fn receive(\u0026self, ctx: ModelCtx\u003c's\u003e) -\u003e Result\u003c(), SimulationError\u003e {\n        ctx.schedule_update(Now)?;\n        Ok(())\n    }\n\n    #[output(signal)]\n    fn send(\u0026self);\n\n    fn handle_update(\u0026mut self, ctx: ModelCtx\u003c's\u003e) -\u003e Result\u003c(), SimulationError\u003e {\n        log::info!(\n            \"Player {} got the ball at {}\",\n            ctx.model_id.as_ref(),\n            ctx.time\n        );\n        self.send(In(ctx.rand_range(0.0..1.0)))?;\n        Ok(())\n    }\n}\n```\n\n### Flags\n\nLiteSim supports multiple different time values which can be controlled through feature flags:\n\n- **f32** - flag: `time_f32`; default\n- **f64** - flag: `time_f64`\n- [**chrono**](https://github.com/chronotope/chrono) - flag: `time_chrono`\n\nSupport for `serde` is enabled through the `serde` feature flag.\n\nSupport for random value generation can be enabled through the `rand` feature flag.\n\n### Wanted features\n\n- **Serde** support for systems as well as simulations in progress.\n- **Backtracking** support for systems with models that support it.\n- **Multithreading** support\n\n## Alternatives\n\n- [sim](https://github.com/ndebuhr/sim) - initial inspiration for this library\n  - requires more boilerplate to implement models, but supports serde and WASM\n- [sequent](https://github.com/kindredgroup/sequent)\n  - supports backtracking and serde\n- [asynchronix](https://github.com/asynchronics/asynchronix)\n  - handles events as futures\n\n## License\n\nThis project is licensed under [zlib](./LICENSE_ZLIB), [MIT](./LICENSE_MIT), or [Apache-2.0](./LICENSE_APACHE) license, choose whichever suits you most.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaellian%2Flitesim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcaellian%2Flitesim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaellian%2Flitesim/lists"}