| Crates.io | quokkasim |
| lib.rs | quokkasim |
| version | 0.3.0-alpha.7 |
| created_at | 2025-05-11 08:40:23.476889+00 |
| updated_at | 2026-01-16 13:38:36.365001+00 |
| description | A Rust-based Discrete Event Simulation (DES) framework, which simplifies simulation for beginners, and provides excellent utilities for experienced modellers. |
| homepage | |
| repository | https://github.com/jajetloh/quokkasim |
| max_upload_size | |
| id | 1669213 |
| size | 261,433 |
A Rust-based Discrete Event Simulation (DES) framework, which simplifies simulation for beginners, and provides excellent utilities for experience modellers.
Powered by the NeXosim simulation engine for Rust.
Many frameworks, commercial applications and code libraries exist for performing simulation. QuokkaSim aims to be a free, open-source alternative, which leverages the performance, safety and features of Rust to minimise time spent by modellers on non-value-add tasks, such as fixing uninitialised components, and writing component boilerplate.
QuokkaSim does this by using a very flexible Stock-and-Flow approach.
Components are plug-and-play objects which can be easily configured and used straightaway in your model, alongside other components.
However, if our pre-defined components aren't suitable for your use case, you can easily create your own custom components that fit within the QuokkaSim framework using Definition Macros.
In QuokkaSim, we use Resources, Stocks and Processes to represent quantities of material and interacting entities.
Resources are quantities/tangible things that can move and change over the simulation, and that we are interested in tracking.
e.g. If we are simulating the operation of a Cafe with its staff and drinks being ordered:
e.g. If we are simulating a manufacturing plant:
Stocks are constructs that hold resources.
e.g. Using the Cafe example:
e.g. Using the manufacturing plant example:
Processes are constructs that interact with stocks, and importantly handle the movements of resources to and from stocks.
e.g. Using the Cafe example:
e.g. Using the Manufacturing example:
In many cases, we must ensure that resources are conserved as part of our simulation. Even when there are losses (e.g. spillage of drinks, energy lost as heat etc.), it is good practice to have processes still conserve these resources, and instead model these losses explicitly with Sinks or Sources.
Sources are processes that create resources.
e.g. Using the Cafe example:
Similarly, sinks are processes that destroy resources.
e.g. Using the Cafe example:
rust-analyzer LSP, which provides Intellisense and error detection whilst writing your code.quokkasim directory contains the main QuokkaSim crate code.quokkasim_examples directory contains uses of QuokkaSim code, which can be run to test functionality and copied to quickly spin up new models.
cargo run --bin [EXAMPLE_NAME e.g. discrete_queue]quokkasim_derive_macros directory contains Derive macros that are highly recommended for convenience when developing with QuokkaSim.