ES
← Back to Portfolio
Simulation & Operations Research June 2026

CAOS SimLab — A Didactic Lab for Simulation (DES & ABM)

Land straight in a running simulation, move the sliders, and watch the dynamics change. An open lab for Discrete-Event Simulation and Agent-Based Modeling — ten worked scenarios across six visualization families, each a pure function of (params, seed) so replay is exact, validated against theory where it exists.

Scenarios live
10 / 10 (queue, Schelling, SIR, ED flow, beer game, job-shop, haul, VRP, dispatch, MC/CI)
Visualization families
6 (queue · agent-grid · chart · flow · gantt · route)
Live lane
In-browser Pyodide (pure-Python, <3 s, trace <1 MB)
Determinism
(params, seed) → trace; byte-reproducible replay
Validation
M/M/c queue validated against Erlang-C
CAOS SimLab — A Didactic Lab for Simulation (DES & ABM) — Architecture
#simulation #des #abm #operations-research #simpy #mesa #pyodide #education

Business Context

Simulation and operations research are how teams reason about systems before building or changing them — queues, epidemics, schedules, routes, supply chains. But the gap between a slide-deck model and a trustworthy one is large, and it is exactly where decisions go wrong. A lab that makes the model legible, tunable, and validated turns simulation from a specialist black art into something a wider audience can learn, inspect, and trust.

Strategic Value

CAOS SimLab is a teaching instrument and a credibility statement at once: the same engine that powers the lessons powers the live app, so what you learn is what runs, and every result is reproducible from (params, seed). It demonstrates the discipline that separates a real simulation from a pretty animation — replications and confidence intervals, warm-up cuts for steady-state metrics, seed reproducibility, and validation against closed-form theory (the M/M/c queue against Erlang-C). The static deterministic-replay architecture (no backend, traces committed as data) makes it cheap to host and fully auditable.

The Challenge

Most simulation tutorials stop at a toy script, and most simulation tools hide the model behind a GUI. Neither teaches the thing that actually matters: how to model a system from zero — define a case, write the rules, run it, and read the dynamics honestly — including the parts demos skip, like the fact that a single run is noisy and an animation is a hypothesis, not evidence.

Our Approach

CAOS SimLab does both halves honestly. A from-zero curriculum teaches the real libraries (SimPy, Mesa, OR-Tools) — their utility, their pitfalls, and when each method applies — and a modern web app drops you into a running simulation you can tune live. One shared Python engine drives both: a run is a pure function of (params, seed) producing a compact trace, and the front end only animates the trace, so "replay is truth". A measured 3-gate rule decides each scenario's lane — light pure-Python scenarios run in the browser via Pyodide and re-run on every slider move; heavy ones (native solvers, large agent counts) are precomputed offline into a seeded trace and replayed with a scrubber under a clear "precomputed due to cost" banner.

Key Performance Indicators

KPIBaselineResultImpact
From script to running modelTutorials stop at a toy scriptLand in a live sim; tune params and watchLearn the method by running it
Trust in the resultA single, noisy run / pretty animationReplications + CIs, warm-up, seed-reproducibleHonest simulation, not a demo
Cost of a scenarioHidden or guessedMeasured 3-gate rule picks live vs precomputedEach lane choice is justified by numbers

Architecture

simlab architecture

simlab architecture

Land in a running simulation

CAOS SimLab is an open, didactic lab for Discrete-Event Simulation (DES) and Agent-Based Modeling (ABM). Instead of a toy script or a GUI that hides the model, you arrive directly in a running simulation, move the sliders, and watch the dynamics change — across ten worked scenarios, with a from-zero curriculum that teaches the real tools. Live at simlab.fasl-work.com.

Two lanes, decided by measurement

A run is a pure function of (params, seed) that produces a compact trace; the front end only animates it, so live and precomputed render through one code path — replay is truth. A measured 3-gate rule (pure-Python and under 3 s and trace under 1 MB) decides the lane:

  • Live — light scenarios run in your browser via Pyodide; edit parameters, re-run, watch it animate in real time. No server, nothing to install.
  • Precomputed — heavy scenarios (native solvers like OR-Tools, large agent counts) are run offline into a seeded trace and replayed with a timeline scrubber under a clear “precomputed due to cost” banner.

Honest simulation

The lab teaches what most demos skip: a single run is noisy, so results come from replications + confidence intervals; steady-state metrics need a warm-up cut; the same seed must reproduce the same result; and an animation is a hypothesis generator, not evidence. Each scenario validates against theory or a baseline where one exists — the M/M/c queue against the closed-form Erlang-C.

Live demo · Source on GitHub

Technology Stack

Python SimPy Mesa OR-Tools Pyodide TypeScript React Vite KaTeX

Visual assets for this project are not publicly available.