Initial release, published as simu-des
(imported as use simu::…).
Added
- Custom single-threaded async executor per
SimEnv— no tokio/async-std;
futures are polled on simulated time with deterministic(time, seq)
tie-breaking, so equal seeds give identical runs. SimEnv/EnvHandlesplit: the env owns the event loop (run/
run_until); the cloneable handle gives processesnow,timeout,event,
spawn, andrng.Timeoutfuture for simulated delays.EventTrigger/EventAwaitable— manual inter-process signalling with
multi-waiter support and a fire-before-await latch.- Resources (all
Rc-cloneable, noArc/Mutexneeded):Resource— FIFO-queued, capacity-limited pool with RAIIResourceGuard
release and direct-handoff semantics (a freed unit can never be stolen by a
same-tick fresh request).PriorityResource— priority-scheduled pool (lower number = higher
priority; FIFO within a level).PreemptiveResource— priority pool with cooperative-at-yield preemption
(guard.preempted()/is_preempted()).Container— reservoir of continuous quantity with strict head-of-line
FIFOput/get.
ProcessHandle<T>— observable spawn (tokio-JoinHandle-style): await the
value or drop to detach.AnyOf/AllOfcombinators withany_of!/all_of!macros.- Seeded, pluggable randomness:
RandomSourcetrait (SimEnv::with_source),
defaultStdRng, portableSplitMix64feed, and shared closed-form
sample::*transforms. monte_carlo::run— parallel replications onstd::threadby default, or
rayon's bounded pool via themonte-carlofeature.- Examples:
hospital(ER patient flow),brewery(process automation),
warehouse(forklift preemption, with browser visualization). - SimPy-parity harness (
compare/, repo only — excluded from the crate):
queue models match SimPy seed-by-seed to ~1e-15 in exact mode. - Criterion benchmark suite; 126 tests across unit + integration suites
(145 including doc-tests). - Documentation:
simu::tutorial— a "simu in 10 minutes" module modeled on
SimPy's intro (5 chapters, every snippet a doc-test) with four sub-60-line
intro_*examples; doc-examples on all core types (19 doc-tests total);
llms.txt+docs/simu-for-agents.mdfor AI coding assistants, including a
SimPy → simu translation table.