A general-purpose discrete event simulation (DES) framework for Node.js, written in TypeScript.
Simloop provides a minimal, type-safe API for building simulations of real-world systems. You define events, entities, and handlers — the framework runs the event loop.
- Type-safe — generic
TEventMapgives full autocomplete and type checking on event scheduling and handling - Simple API — define handlers with
sim.on(), schedule events withctx.schedule() - Deterministic — seeded PRNG ensures reproducible results
- Built-in primitives — Resource (seize/delay/release) and Queue (FIFO/priority, bounded capacity, overflow policies) with auto-collected stats
- 11 probability distributions — uniform, gaussian, exponential, poisson, bernoulli, zipf, triangular, weibull, lognormal, erlang, geometric
- Simulation control — lifecycle management, custom stop conditions (
stopWhen), warm-up period with automatic stats reset - Observability — built-in statistics (mean, variance, min, max, count) and pluggable logging
- Zero dependencies, dual format — no runtime deps, ESM and CJS
For the full API reference, guides, and examples visit the documentation site:
MIT