{"id":20071494,"url":"https://github.com/matbme/petriengine","last_synced_at":"2025-07-13T20:34:21.662Z","repository":{"id":60943330,"uuid":"531728117","full_name":"matbme/PetriEngine","owner":"matbme","description":null,"archived":false,"fork":false,"pushed_at":"2022-11-24T16:04:59.000Z","size":52,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-02T11:49:17.309Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/matbme.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-09-02T00:27:26.000Z","updated_at":"2022-10-06T22:58:40.000Z","dependencies_parsed_at":"2023-01-22T14:46:05.382Z","dependency_job_id":null,"html_url":"https://github.com/matbme/PetriEngine","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/matbme/PetriEngine","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matbme%2FPetriEngine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matbme%2FPetriEngine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matbme%2FPetriEngine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matbme%2FPetriEngine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matbme","download_url":"https://codeload.github.com/matbme/PetriEngine/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matbme%2FPetriEngine/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265199996,"owners_count":23726750,"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-13T14:29:34.317Z","updated_at":"2025-07-13T20:34:21.623Z","avatar_url":"https://github.com/matbme.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Petri Net Engine\n\nThis is a simple implementation of a Petri Net Engine simulator in Rust with a declarative framework.\n\n## Usage\n\nThe macro `petri_net!` is used to create a new net with the declarative framework. An example declaration\ncan be seen below.\n\n```rust\nlet pn = petri_net! {\n    places =\u003e [L1, L2\u003c2\u003e, L3\u003c1\u003e, L4, L5, L6, L7\u003c10\u003e, L8, L9, L10, L11, L12, L13], // The values in \u003c\u003e represent the tokens at the initial stage\n    transitions =\u003e [Ta, Tb, Tc, Td, Te, Tf, Tg],\n    connections =\u003e [\n        (2) L1 -\u003e Ta,  // A regular arc with weight 2\n        Ta -\u003e L4,\n        L4 -\u003e Td,\n        L7 \u003e\u003e Td, // A reset arc\n        Td -\u003e L11,\n        L11 -\u003e Tg,\n        Tg -\u003e L12,\n        Tb -\u003e L1,\n        Tb -\u003e L5,\n        L5 -\u003e Te,\n        Te -\u003e L8,\n        L8 -\u003e Td,\n        L8 -\u003e Tg,\n        Te -\u003e L9,\n        L9 -\u003e Tg,\n        Te -\u003e L10,\n        Tg -\u003e L13,\n        L13 -\u003e Tf,\n        L10 -\u003e Tf,\n        L2 -\u003e Tb,\n        Tf -\u003e L2,\n        Tf -\u003e L6,\n        (2) L6 @ Te, // An inhibitor arc with weight 2\n        L3 -\u003e Tc,\n        Tc -\u003e L6\n    ]\n};\n\n// The simulation object takes ownership of the net\nlet simul = net::Simulation::new_interactive(pn);\nsimul.run();\n```\n\n## Running\n\n```sh\n$ cargo run\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatbme%2Fpetriengine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatbme%2Fpetriengine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatbme%2Fpetriengine/lists"}