Skip to main content

SimulSI

CI PyPI Python Docs License: MIT

Simulation Intelligence - Model the system. Simulate the future.

SimulSI is a general-purpose, reproducible simulation and scenario experimentation framework for Python. You describe a system - customers and tellers, patients and doctors, jobs and machines, aircraft and gates, requests and servers - as discrete-event processes; SimulSI runs it, measures it, and helps you answer what if? with replications, confidence intervals, scenario comparisons, Monte Carlo and sensitivity analysis.

from simulsi import Experiment, Scenario, Simulation, model
from simulsi.randomness import Exponential


@model(duration=480, parameters={"arrival_rate": 1.0, "tellers": 3})
def bank(sim: Simulation, p):
    tellers = sim.resource("teller", capacity=p.tellers)
    arrivals, service = sim.stream("arrivals"), sim.stream("service")

    def customer(sim):
        yield sim.request(tellers)                       # wait for a teller
        yield Exponential(mean=2.6).sample(service)      # being served
        sim.release(tellers)

    def source(sim):
        while True:
            yield Exponential(rate=p.arrival_rate).sample(arrivals)
            sim.process(customer(sim))

    sim.process(source(sim))


result = Experiment(
    bank,
    [Scenario("baseline"), Scenario("four_tellers", {"tellers": 4})],
    replications=30,
    seed=42,
).run()
print(result.format_summary(["resource.teller.wait.mean", "resource.teller.utilization"]))
print(result.compare("baseline", metrics=["resource.teller.wait.mean"]).format())

Why SimulSI?

Discrete-event engines tell you what happened in one run. Decisions need more: how sure are we, which scenario is better, which input matters most, and can someone else reproduce this? SimulSI is built experiment-first:

Reproducible by construction Every run is determined by its seed. Named random streams (sim.stream("arrivals")) are derived from the seed with NumPy's SeedSequence, so adding a resource never shifts another stream. Serial and parallel runs give identical numbers.
Scenario comparison Scenarios share replication seeds (common random numbers) and comparisons use paired confidence intervals, which are usually much tighter than comparing independent runs.
Statistics built in t and bootstrap CIs, Wilson intervals for probabilities, "have I run enough replications?" advice, convergence curves, batch means for long runs.
Monte Carlo & sensitivity Propagate input uncertainty (random or Latin hypercube sampling, vectorised or per simulation run). One-at-a-time, finite-difference, correlation and standardised-regression sensitivity.
Provenance Each experiment records id, model name/version, git commit, timestamp, seeds, parameters, runtime and environment. Results export to JSON, CSV and Parquet.
Model introspection snapshot() of live state, structured event logs, observed flow graphs (arrival -> queue -> service -> departure), entity state machines, and model validation with a smoke run (unreleased resources, possible deadlocks, zero capacities, unreached states).
Beyond queues Continuous Levels with exact threshold crossings, movement on road and grid networks (simulsi.spatial), event-driven wait_until(..., on=[...]), animated GIF replays.
Decision support Cost/revenue models on top of metrics; an Objective adapter that hands models to scipy.optimize, OR-Tools, evolutionary or Bayesian optimisers without depending on any of them.
Local-first No LLMs, API keys, telemetry or network access. Core dependencies: NumPy, SciPy, pydantic, PyYAML. Plotting, pandas, Parquet and the web dashboard are optional.

SimulSI is not a replacement for mature engines such as SimPy or Salabim, or for commercial packages; see how SimulSI differs.

Try it without installing

Run SimulSI in your browser - Python and SimulSI run locally in the page via Pyodide (WebAssembly), with ready-made airline, epidemic, flowchart and Pareto examples.

Installation

Python 3.11+, from PyPI:

pip install simulsi             # core (includes the CLI and the web dashboard)
pip install "simulsi[viz]"      # + matplotlib plots
pip install "simulsi[all]"      # + pandas, Parquet, matplotlib, Plotly

With Docker (dashboard and CLI, no Python needed; the image is published for each release):

docker run --rm -p 127.0.0.1:8642:8642 ghcr.io/yashjindal11/simulsi        # dashboard on http://localhost:8642
docker run --rm -v "$PWD:/work" ghcr.io/yashjindal11/simulsi run model.py  # any CLI command

From source (for development):

git clone https://github.com/Yashjindal11/simulsi.git && cd simulsi
python -m venv .venv
.venv/bin/pip install -e ".[dev]"     # everything needed to run the tests

Command line

simulsi init my-study                          # starter model.py + experiment.yaml
simulsi validate my-study/experiment.yaml      # schema check + model smoke run
simulsi run examples/queue.py -p servers=3     # one replication, metrics table
simulsi experiment my-study/experiment.yaml    # scenarios x replications, comparison, saved results
simulsi analyze my-study/results/service-desk --precision 0.05
simulsi visualize my-study/results/service-desk --out plots
simulsi models                                 # built-in models and their what-if presets
simulsi whatif builtin:epidemic --presets      # how outputs change across scenarios
simulsi benchmark                              # events/sec on this machine
simulsi ui my-study/results/service-desk       # local dashboard on 127.0.0.1

Experiments are described in YAML - data only, validated against a strict schema:

model: model.py:service_desk
simulation: {seed: 42, duration: 480}
experiment: {replications: 30, workers: 4}
parameters: {arrival_rate: 0.9}
scenarios:
  - {name: high_demand, parameters: {arrival_rate: 1.3}}
  - {name: extra_server, parameters: {servers: 3}}

Built-in models

Fifteen ready-to-run models, each with what-if presets that show how the system reacts when a parameter changes:

Model What changes when you turn the knobs
builtin:airline schedule buffer, crews, gates, spares and storms vs on-time performance and delay propagation
builtin:airport_turnaround banked vs depeaked schedules, crews and refuelling rules vs turnaround critical path and delays
builtin:disruption_recovery after a hub storm: delay vs cancel vs spare aircraft, by cost, passenger delay and recovery time
builtin:epidemic R0, vaccination, beds and lockdown policy vs attack rate, hospital overflow and deaths
builtin:supply_chain lead times, forecasting and information sharing vs the bullwhip effect
builtin:ride_hailing fleet size, rush hours and surge pricing vs service level and driver earnings
builtin:cloud_autoscaling cold starts, scaling policy and traffic bursts vs SLO, errors and cost
builtin:traffic_signal cycle length, green split, fixed vs actuated control (checked against Webster)
builtin:emergency_department doctors, ward beds (boarding), fast track and surges vs waits and patients leaving unseen
builtin:restaurant table mix, flexible seating, reservations and cooks vs covers and walk-aways
builtin:ev_charging fast chargers and the site grid limit vs charging power, queues and balking
builtin:inventory the (s, S) reorder policy vs fill rate and cost
builtin:theme_park express passes, app-based routing and ride capacity vs waits and rides per visitor
builtin:warehouse discrete vs batch picking, packers and peaks vs on-time shipping
builtin:mmc the M/M/c queue (checked against Erlang C)
simulsi models airline                                      # parameters and presets
simulsi whatif builtin:airline --presets                    # compare every preset
simulsi whatif builtin:traffic_signal --vary cycle=30,60,90,120

See the model gallery for what each one shows. Simple process models can also be written as YAML flowcharts, no Python needed: simulsi whatif examples/flowcharts/clinic.yaml --presets.

Airline operations

simulsi.aviation turns a real flight schedule (CSV) into a stochastic model of the operation - aircraft rotations, crews, runways, gates, curfews, spares, standby crews and passenger connections:

  • day ahead: per-flight on-time and cancellation chances, delay ranges, fragile rotations, connection risk and alerts, under weather scenarios;
  • live twin: re-forecast the rest of the day from actual times, from a file or an http(s) status feed (simulsi aviation watch);
  • what-ifs and recovery: cancel, retime or swap aircraft, compared on the same disturbances, plus a greedy recovery search; disrupted passengers are rebooked on later flights;
  • planning: spares and standby crews, schedule buffers, schedule changes;
  • calibration: fit delays to history (including US BTS files), backtest with reliability tables, plug in an ML delay predictor;
  • ground and passengers: turnaround critical path, minimum connection time, overbooking, check-in staffing.
simulsi aviation example ops && cd ops
simulsi aviation forecast schedule.csv -c connections.csv --ops ops.yaml
simulsi aviation forecast schedule.csv -c connections.csv --ops ops.yaml --status status_1200.csv --now 12:00
simulsi aviation recover schedule.csv -c connections.csv --ops ops.yaml --status status_1200.csv --now 12:00

The dashboard has an Airline ops twin page with a Gantt chart of the rotations and recovery and reserve planning. See Airline operations and the BTS case study: Alaska, JetBlue and Delta over four months of public data, with honest results - small day-ahead skill, consistent gains from live re-forecasts.

Examples

Example Shows
queue.py Minimal M/M/c model checked against Erlang C
bank_queue.py Reneging customers, staffing scenarios, replication advice
hospital.py Priority triage, several resources, service levels
warehouse.py Time-varying demand, picking/packing buffers, backlog
manufacturing.py Breakdowns with a repair crew, blocking, cost model
transportation.py Shuttle loop, boarding capacity, left-behind passengers
aviation.py Synthetic airport gates, taxiway holds, tows, weather disruption
airline_ops.py Day-ahead forecast, live re-forecast at noon and a recovery search
python examples/hospital.py
python scripts/run_examples.py      # all of them, quick mode

Documentation

The full documentation, including an API reference for every public class and function, is at https://yashjindal11.github.io/simulsi/. The same pages are in docs/:

Status

SimulSI is alpha software (0.x) and the API may still change. It is tested on Python 3.11-3.13 (Linux, macOS, Windows in CI) with unit, property-based (Hypothesis), statistical, integration, CLI and performance tests - including checks of simulated M/M/c queues against closed-form Erlang-C results.

Citing

If SimulSI helps your work, please cite it - GitHub's Cite this repository button uses CITATION.cff.

Contributing

Issues and pull requests are welcome - see CONTRIBUTING.md and the Code of Conduct. For security reports see SECURITY.md.

License

MIT © 2026 Yash Jindal

Metadata

Release files for simulsi 0.9.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for simulsi 0.9.0
File Size Uploaded
simulsi-0.9.0.tar.gz 445.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for simulsi 0.9.0
File Interpreter ABI Platform
simulsi-0.9.0-py3-none-any.whl Python 3 none any Details

Total release size: 824.2 kB

Release files / simulsi-0.9.0.tar.gz

Download URL simulsi-0.9.0.tar.gz
Size 445.5 kB
Tags Source
SHA-256 checksum
How to use checksums
978b25fc467c73c2ed817aa2e65d35d9cda61cc404a25e7471a809f9ff02a36c
BLAKE2b-256 checksum
How to use checksums
981f33abbb2ccbaa4d929cb58922c2dbbc61cdd4d099dfd89d0aa298999622ed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.

Transparency log

Release files / simulsi-0.9.0-py3-none-any.whl

Download URL simulsi-0.9.0-py3-none-any.whl
Size 378.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
09c83bf9e7e56442e77cd62a641382395dd4bca2653b0d4a7f27c10ef054ed77
BLAKE2b-256 checksum
How to use checksums
da3939292357b7eae3cbc41a77544b1a40d90fbfa2ab45fad90047c47f6c9755
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.9.0 This release

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page