SimPy Discrete-Event Simulation
An expert-level skill for building, testing, and analyzing bounded process-based discrete-event simulations with SimPy.
Data & AnalyticsAdvanced★ 33,030⑂ 3,248AI score 8/10Last updated: Aug 9, 2026
What it does
Guides the full lifecycle of a process-based (generator) discrete-event model on SimPy 4.1.2.
- Core semantics: deterministic event ordering in
Environment, theEvent/Timeout/Processlifecycle,AnyOf/AllOfcondition values, and correctinterrupt()handling. - Resource modeling: a comparison table for
Resource,PriorityResource,PreemptiveResource,Container,Store,FilterStore, andPriorityStore, includingPreemptedcause fields. - Bounded execution by default: mandatory caps on time, entities, events, and replications; explains the half-open boundary of
env.run(until=number)and how to report unfinished entities. - Measurement and statistics: time-weighted averages (area under the state path), monitor non-interference tests, and replication-level Student-t confidence intervals.
- Bundled safe CLIs: a built-in queue scenario, replication runner, event-trace summarizer, and config validator — no network calls, no execution of user-supplied Python.
Who it's for
- Industrial engineers and operations analysts sizing queues and throughput for call centers, clinics, factories, or warehouses.
- Data analysts comparing inventory policies, service levels, or server capacity via simulation.
- Researchers who must defend simulation results methodologically: warm-up, replication count, seed manifests, and stated limitations.
- Python developers who keep hitting bugs from misunderstanding SimPy's event ordering or preemption rules.
Examples
- Teller staffing study: with 15-minute mean interarrivals and 6-minute mean service, run 30 replications for 2 vs. 3 servers, compare 95% intervals on mean wait, and get a warm-up recommendation to remove initialization bias.
- Machine failure modeling: inject breakdowns via
process.interrupt(), preserve remaining work on resume, and evaluate output across preventive-maintenance intervals with deterministic verification tests. - Fixing instrumentation: convert an event-sample average of queue length into a proper time-weighted average, then add unit tests proving the monitor does not alter event order.
· · · Install guide · · ·
Install in the Claude app (no terminal)
- Download the ZIP with the button below.
- In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
- Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
Install in Claude Code
Let Claude do it — paste this into Claude Code
Install the skill I found on Claude Skill Mart. Copy the skills/simpy folder from the GitHub repo K-Dense-AI/scientific-agent-skills into my ~/.claude/skills/simpy/. When it's done, tell me in one line what this skill can do.
Install with a command instead
git clone https://github.com/K-Dense-AI/scientific-agent-skills.git && mkdir -p ~/.claude/skills && cp -r scientific-agent-skills/skills/simpy ~/.claude/skills/⚠ This is a third-party skill. Check the source repository before installing.
- Open a terminal and cd into your working directory.
- Clone the repository:
git clone https://github.com/K-Dense-AI/scientific-agent-skills.git - Create the skills folder:
mkdir -p ~/.claude/skills - Copy the skill:
cp -r scientific-agent-skills/skills/simpy ~/.claude/skills/ - Set up the pinned environment (Python 3.13 recommended,
uvrequired):uv venv --python 3.13 && source .venv/bin/activate && uv pip install "simpy==4.1.2" - Verify:
python -c "import simpy; print(simpy.__version__)" - Restart Claude Code and try a prompt such as "Build a bounded SimPy queue model with 2 servers and report mean wait."
- To use the bundled CLIs, inspect options first:
python ~/.claude/skills/simpy/scripts/bounded_queue_scenario.py --help.
View source on GitHub ↗License: MIT