simul
is a discrete-event simulation library aimed at high-level use-cases to
quickly simulate real-world problems and run simulated experiments.
simul
is a discrete-event simulator using incremental time progression,
with M/M/c queues for interactions
between agents. It also supports some forms of experimentation and simulated
annealing to replicate a simulation many times, varying the simulation
parameters.
Use-cases:
- Discrete-event simulation
- Complex adaptive systems
- Simulated annealing
- Job-shop scheduling
- Birth-death processes
- Computer experiments
- Other: simulating logistics, operations research problems, running experiments to approximate a global optimum, simulating queueing systems, distributed systems, performance engineering/analysis, and so on.
Usage
Warning
Experimental and unstable. Almost all APIs are expected to change.
Basic usage
[]
= "0.3.1"
use Simulation;
use *;
// Runs a simulation with a producer that produces work at every tick of
// discrete time (period=1), and a consumer that cannot keep up (can only
// process that work every third tick).
let mut simulation = new;
simulation.run;
Poisson-distributed example w/ Plotting
Here's an example of an outputted graph from a simulation run. In this
simulation, we show the average waiting time of customers in a line at a
cafe. The customers arrive at a Poisson-distributed arrival rate
(lambda<-60.0
) and a Poisson-distributed coffee-serving rate with the
same distribution.
This simulation maps to the real world by assuming one tick of discrete-simulation time is equal to one second.
Basically, the barista serves coffees at around 60 seconds per drink and the customers arrive at about the same rate, both modeled by a stochastic Poisson generator.
This simulation has a halt_check
condition of the simulation's time
being equal to 60*60*12
, representing a full 12-hour day of the cafe
being open.
This is a code example for generating the above.
use *;
use Poisson;
use *;
use *;
use PathBuf;
Contributing
Issues, bugs, features are tracked in TODO.org