Skip to content

Mettiu88/simloop

Repository files navigation

Simloop

npm version license build npm bundle size types

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.

Features

  • Type-safe — generic TEventMap gives full autocomplete and type checking on event scheduling and handling
  • Simple API — define handlers with sim.on(), schedule events with ctx.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

Documentation

For the full API reference, guides, and examples visit the documentation site:

simloop.vercel.app

License

MIT

About

A general-purpose discrete event simulation (DES) framework for Node.js, written in TypeScript.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors