4 releases (2 breaking)
new 0.3.1 | Feb 20, 2025 |
---|---|
0.3.0 | Feb 18, 2025 |
0.2.0 | Feb 17, 2025 |
0.1.0 | Feb 16, 2025 |
#61 in Simulation
119 downloads per month
110KB
1K
SLoC
desque
desque provides a lightweight framework for developing discrete-event simulations. Designed with a use case of "headless CLI" in mind, it comes with no unwanted bloat. The framework also enables running multiple repetitions across multiple threads by encouraging non-static data storage in simulation state.
For a quick example of how to get started with desque, check out the M/M/1 queue. This simple queueing model demonstrates how to define several event types that interact through shared system state and initialize an event that schedules further events to create dynamic behavior.
The CRN queues example showcases how a similar system can be set up for more advanced statistical analysis using the variance reduction technique known as common random numbers. This example also takes advantage of multithreading to run each server configuration up for comparison simultaneously.
The parallel event
example also demonstrates parallelization. This example has a main event type which
is able to schedule follow-on events from each thread it spawns using the features
in desque's threadsafe
module.
Detailed documentation explains the interface for all exported types and the requirements for template parameters in client code.
Compatibility
desque requires access to the Rust standard library. Rust language versions of at least 1.63.0 provide all necessary features for this library and its dev dependencies.
By default, desque has no runtime dependencies. However, enabling the ordered-float
feature adds a dependency on the ordered-float
crate to allow using its OrderedFloat
and NotNan
structs as time values in desque.
License
desque is distributed under the MIT license.