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).
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.

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

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 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}}

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
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.

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.3.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.3.0
File Size Uploaded
simulsi-0.3.0.tar.gz 261.3 kB Details

Built distribution (wheel)

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

Total release size: 485.6 kB

Release files / simulsi-0.3.0.tar.gz

Download URL simulsi-0.3.0.tar.gz
Size 261.3 kB
Tags Source
SHA-256 checksum
How to use checksums
75e0f4d12e9feecc7d1da413278acffc0cf517b735c58a5f4ded9e1bca017747
BLAKE2b-256 checksum
How to use checksums
85e84da66a9a412fd6b1a4e5fba9a214727cb4c190712e1a867da1df0a12285e
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 7, 2026.

Transparency log

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

Download URL simulsi-0.3.0-py3-none-any.whl
Size 224.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1799aea51979a56bffc685c55d5b007d32629c2445616551d3ddc589ffc6e4b4
BLAKE2b-256 checksum
How to use checksums
ffab03d88615b862cc4404f44e46daa990ab6d2cf67d044cc4d4c5deb9db15aa
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 7, 2026.

Transparency log

Release history Release notifications | RSS feed

0.9.0

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

This release

0.3.0 This release

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