Process-based discrete-event simulation framework in Python.

MITAuto-check passed

Install Simpy

skills CLI
$ npx skills add zLanqing/codex-claude-academic-skills --skill simpy -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install zLanqing/codex-claude-academic-skills simpy --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/zLanqing/codex-claude-academic-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/scientific-toolkit-skill/references/scientific-skills/simpy .claude/skills/simpy && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
simpy
GitHub stars
4.6k
Used in
11 other repos
Token cost
~3k tokens
SKILL.md length
723 words
Files
8 (incl. scripts, references)
Skills in repo
17
Repo updated
First seen
Licence
MIT

At a glance

Process-based discrete-event simulation framework in Python.

  • Works in 7 steps: Environment → Processes → Events → …
  • Building simulations of systems with processes
  • SKILL.md covers Overview, When to Use This Skill, Quick Start and Core Concepts, plus 6 more sections
  • Runs Python scripts from its folder

What it does

Simpy is an agent skill from zLanqing/codex-claude-academic-skills. Process-based discrete-event simulation framework in Python. Use this skill when building simulations of systems with processes, queues, resources, and time-based events such as manufacturing systems, service operations, network traffic, logistics, or any system where entities interact with shared resources over time.

Its SKILL.md is about 3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 9 other files, including scripts and reference files (for example `references/events.md`, `references/monitoring.md` and `references/process-interaction.md`).

It works with Python. The repository describes itself as: 本仓库包含三个面向学术科研人员的Skills,覆盖从文献阅读、论文写作到科学计算的完整研究工作流。office-academic-skill 负责论文阅读报告与学术 PPT/Word 文档生成;research-writing-skill 提供论文写作、润色与审稿回复辅助;scientific-toolkit-skill 整合 MATLAB/Python… The licence is MIT.

When your agent uses it

  • Building simulations of systems with processes
  • Time-based events such as manufacturing systems
  • Service operations
  • Network traffic

Example prompts

  • “/simpy”

Requirements

  • Python 3

Workflow steps

7 steps, taken from the step headings in SKILL.md.

  1. Environment
  2. Processes
  3. Events
  4. Define the System
  5. Implement Process Functions
  6. Set Up Monitoring
  7. Run and Analyze

What it can do on your machine

Read from SKILL.md and the folder at commit 7ed6377. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 2 files in scripts/ (Python), which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Simpy loads about 3k tokens when it runs, and up to ~16k if it reads all its reference files. Until then it costs about 81 tokens; SKILL.md has 723 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~81
When it runs · the whole SKILL.md, loaded when a task matches
~3k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~16k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from zLanqing/codex-claude-academic-skills at commit 7ed6377, republished under its MIT licence (© zLanqing). 723 words, ~3,042 tokens.

Download SKILL.mdSave it as .claude/skills/simpy/SKILL.md (or your agent's skills folder). This skill also uses 7 other files; get the full folder from GitHub.
name
simpy
description
Process-based discrete-event simulation framework in Python. Use this skill when building simulations of systems with processes, queues, resources, and time-based events such as manufacturing systems, service operations, network traffic, logistics, or any system where entities interact with shared resources over time.
license
MIT license
metadata.skill-author
K-Dense Inc.

SimPy - Discrete-Event Simulation

Overview

SimPy is a process-based discrete-event simulation framework based on standard Python. Use SimPy to model systems where entities (customers, vehicles, packets, etc.) interact with each other and compete for shared resources (servers, machines, bandwidth, etc.) over time.

Core capabilities:

  • Process modeling using Python generator functions
  • Shared resource management (servers, containers, stores)
  • Event-driven scheduling and synchronization
  • Real-time simulations synchronized with wall-clock time
  • Comprehensive monitoring and data collection

When to Use This Skill

Use the SimPy skill when:

  1. Modeling discrete-event systems - Systems where events occur at irregular intervals
  2. Resource contention - Entities compete for limited resources (servers, machines, staff)
  3. Queue analysis - Studying waiting lines, service times, and throughput
  4. Process optimization - Analyzing manufacturing, logistics, or service processes
  5. Network simulation - Packet routing, bandwidth allocation, latency analysis
  6. Capacity planning - Determining optimal resource levels for desired performance
  7. System validation - Testing system behavior before implementation

Not suitable for:

  • Continuous simulations with fixed time steps (consider SciPy ODE solvers)
  • Independent processes without resource sharing
  • Pure mathematical optimization (consider SciPy optimize)

Quick Start

Basic Simulation Structure
python
import simpy

def process(env, name):
    """A simple process that waits and prints."""
    print(f'{name} starting at {env.now}')
    yield env.timeout(5)
    print(f'{name} finishing at {env.now}')

# Create environment
env = simpy.Environment()

# Start processes
env.process(process(env, 'Process 1'))
env.process(process(env, 'Process 2'))

# Run simulation
env.run(until=10)
Resource Usage Pattern
python
import simpy

def customer(env, name, resource):
    """Customer requests resource, uses it, then releases."""
    with resource.request() as req:
        yield req  # Wait for resource
        print(f'{name} got resource at {env.now}')
        yield env.timeout(3)  # Use resource
        print(f'{name} released resource at {env.now}')

env = simpy.Environment()
server = simpy.Resource(env, capacity=1)

env.process(customer(env, 'Customer 1', server))
env.process(customer(env, 'Customer 2', server))
env.run()

Core Concepts

1. Environment

The simulation environment manages time and schedules events.

python
import simpy

# Standard environment (runs as fast as possible)
env = simpy.Environment(initial_time=0)

# Real-time environment (synchronized with wall-clock)
import simpy.rt
env_rt = simpy.rt.RealtimeEnvironment(factor=1.0)

# Run simulation
env.run(until=100)  # Run until time 100
env.run()  # Run until no events remain
2. Processes

Processes are defined using Python generator functions (functions with yield statements).

python
def my_process(env, param1, param2):
    """Process that yields events to pause execution."""
    print(f'Starting at {env.now}')

    # Wait for time to pass
    yield env.timeout(5)

    print(f'Resumed at {env.now}')

    # Wait for another event
    yield env.timeout(3)

    print(f'Done at {env.now}')
    return 'result'

# Start the process
env.process(my_process(env, 'value1', 'value2'))
3. Events

Events are the fundamental mechanism for process synchronization. Processes yield events and resume when those events are triggered.

Common event types:

  • env.timeout(delay) - Wait for time to pass
  • resource.request() - Request a resource
  • env.event() - Create a custom event
  • env.process(func()) - Process as an event
  • event1 & event2 - Wait for all events (AllOf)
  • event1 | event2 - Wait for any event (AnyOf)

Resources

SimPy provides several resource types for different scenarios. For comprehensive details, see references/resources.md.

Resource Types Summary
Resource TypeUse Case
ResourceLimited capacity (servers, machines)
PriorityResourcePriority-based queuing
PreemptiveResourceHigh-priority can interrupt low-priority
ContainerBulk materials (fuel, water)
StorePython object storage (FIFO)
FilterStoreSelective item retrieval
PriorityStorePriority-ordered items
Quick Reference
python
import simpy

env = simpy.Environment()

# Basic resource (e.g., servers)
resource = simpy.Resource(env, capacity=2)

# Priority resource
priority_resource = simpy.PriorityResource(env, capacity=1)

# Container (e.g., fuel tank)
fuel_tank = simpy.Container(env, capacity=100, init=50)

# Store (e.g., warehouse)
warehouse = simpy.Store(env, capacity=10)

Common Simulation Patterns

Pattern 1: Customer-Server Queue
python
import simpy
import random

def customer(env, name, server):
    arrival = env.now
    with server.request() as req:
        yield req
        wait = env.now - arrival
        print(f'{name} waited {wait:.2f}, served at {env.now}')
        yield env.timeout(random.uniform(2, 4))

def customer_generator(env, server):
    i = 0
    while True:
        yield env.timeout(random.uniform(1, 3))
        i += 1
        env.process(customer(env, f'Customer {i}', server))

env = simpy.Environment()
server = simpy.Resource(env, capacity=2)
env.process(customer_generator(env, server))
env.run(until=20)
Pattern 2: Producer-Consumer
python
import simpy

def producer(env, store):
    item_id = 0
    while True:
        yield env.timeout(2)
        item = f'Item {item_id}'
        yield store.put(item)
        print(f'Produced {item} at {env.now}')
        item_id += 1

def consumer(env, store):
    while True:
        item = yield store.get()
        print(f'Consumed {item} at {env.now}')
        yield env.timeout(3)

env = simpy.Environment()
store = simpy.Store(env, capacity=10)
env.process(producer(env, store))
env.process(consumer(env, store))
env.run(until=20)
Pattern 3: Parallel Task Execution
python
import simpy

def task(env, name, duration):
    print(f'{name} starting at {env.now}')
    yield env.timeout(duration)
    print(f'{name} done at {env.now}')
    return f'{name} result'

def coordinator(env):
    # Start tasks in parallel
    task1 = env.process(task(env, 'Task 1', 5))
    task2 = env.process(task(env, 'Task 2', 3))
    task3 = env.process(task(env, 'Task 3', 4))

    # Wait for all to complete
    results = yield task1 & task2 & task3
    print(f'All done at {env.now}')

env = simpy.Environment()
env.process(coordinator(env))
env.run()

Workflow Guide

Step 1: Define the System

Identify:

  • Entities: What moves through the system? (customers, parts, packets)
  • Resources: What are the constraints? (servers, machines, bandwidth)
  • Processes: What are the activities? (arrival, service, departure)
  • Metrics: What to measure? (wait times, utilization, throughput)
Step 2: Implement Process Functions

Create generator functions for each process type:

python
def entity_process(env, name, resources, parameters):
    # Arrival logic
    arrival_time = env.now

    # Request resources
    with resource.request() as req:
        yield req

        # Service logic
        service_time = calculate_service_time(parameters)
        yield env.timeout(service_time)

    # Departure logic
    collect_statistics(env.now - arrival_time)
Step 3: Set Up Monitoring

Use monitoring utilities to collect data. See references/monitoring.md for comprehensive techniques.

python
from scripts.resource_monitor import ResourceMonitor

# Create and monitor resource
resource = simpy.Resource(env, capacity=2)
monitor = ResourceMonitor(env, resource, "Server")

# After simulation
monitor.report()
Step 4: Run and Analyze
python
# Run simulation
env.run(until=simulation_time)

# Generate reports
monitor.report()
stats.report()

# Export data for further analysis
monitor.export_csv('results.csv')

Advanced Features

Process Interaction

Processes can interact through events, process yields, and interrupts. See references/process-interaction.md for detailed patterns.

Key mechanisms:

  • Event signaling: Shared events for coordination
  • Process yields: Wait for other processes to complete
  • Interrupts: Forcefully resume processes for preemption
Show full SKILL.md (279 more words)Show less
Real-Time Simulations

Synchronize simulation with wall-clock time for hardware-in-the-loop or interactive applications. See references/real-time.md.

python
import simpy.rt

env = simpy.rt.RealtimeEnvironment(factor=1.0)  # 1:1 time mapping
# factor=0.5 means 1 sim unit = 0.5 seconds (2x faster)
Comprehensive Monitoring

Monitor processes, resources, and events. See references/monitoring.md for techniques including:

  • State variable tracking
  • Resource monkey-patching
  • Event tracing
  • Statistical collection

Scripts and Templates

basic_simulation_template.py

Complete template for building queue simulations with:

  • Configurable parameters
  • Statistics collection
  • Customer generation
  • Resource usage
  • Report generation

Usage:

python
from scripts.basic_simulation_template import SimulationConfig, run_simulation

config = SimulationConfig()
config.num_resources = 2
config.sim_time = 100
stats = run_simulation(config)
stats.report()
resource_monitor.py

Reusable monitoring utilities:

  • ResourceMonitor - Track single resource
  • MultiResourceMonitor - Monitor multiple resources
  • ContainerMonitor - Track container levels
  • Automatic statistics calculation
  • CSV export functionality

Usage:

python
from scripts.resource_monitor import ResourceMonitor

monitor = ResourceMonitor(env, resource, "My Resource")
# ... run simulation ...
monitor.report()
monitor.export_csv('data.csv')

Reference Documentation

Detailed guides for specific topics:

  • references/resources.md - All resource types with examples
  • references/events.md - Event system and patterns
  • references/process-interaction.md - Process synchronization
  • references/monitoring.md - Data collection techniques
  • references/real-time.md - Real-time simulation setup

Best Practices

  1. Generator functions: Always use yield in process functions
  2. Resource context managers: Use with resource.request() as req: for automatic cleanup
  3. Reproducibility: Set random.seed() for consistent results
  4. Monitoring: Collect data throughout simulation, not just at the end
  5. Validation: Compare simple cases with analytical solutions
  6. Documentation: Comment process logic and parameter choices
  7. Modular design: Separate process logic, statistics, and configuration

Common Pitfalls

  1. Forgetting yield: Processes must yield events to pause
  2. Event reuse: Events can only be triggered once
  3. Resource leaks: Use context managers or ensure release
  4. Blocking operations: Avoid Python blocking calls in processes
  5. Time units: Stay consistent with time unit interpretation
  6. Deadlocks: Ensure at least one process can make progress

Example Use Cases

  • Manufacturing: Machine scheduling, production lines, inventory management
  • Healthcare: Emergency room simulation, patient flow, staff allocation
  • Telecommunications: Network traffic, packet routing, bandwidth allocation
  • Transportation: Traffic flow, logistics, vehicle routing
  • Service operations: Call centers, retail checkout, appointment scheduling
  • Computer systems: CPU scheduling, memory management, I/O operations

© zLanqing, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 7 other files (scripts, references) in scientific-toolkit-skill/references/scientific-skills/simpy of zLanqing/codex-claude-academic-skills.

  • SKILL.md
  • references/events.md
  • references/monitoring.md
  • references/process-interaction.md
  • references/real-time.md
  • references/resources.md
  • scripts/basic_simulation_template.py
  • scripts/resource_monitor.py

Open the folder on GitHubat commit 7ed6377

Used in 11 other repositories

We found 16 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 11 other GitHub owners. This page covers the copy in zLanqing/codex-claude-academic-skills, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Simpy next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Simpy compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Simpy this skillzLanqing/codex-claude-academic-skills4.6k11 repos~3kAutomated safety check: PassMIT
MCP Server Builderanthropics/skills180k62 repos~2.3kAutomated safety check: PassApache-2.0
PDF Processinganthropics/skills180k48 repos~2kAutomated safety check: PassProprietary
NotebookLM Research AssistantPleasePrompto/notebooklm-skill7.8k13 repos~2.4kAutomated safety check: NotesMIT
Manim Video Productionbrowser-use/video-use28k6 repos~3kAutomated safety check: PassMIT
Code Review ChecklistshareAI-lab/learn-claude-code78k5 repos~1.1kAutomated safety check: PassMIT

Similar skills

  • MCP Server Builder

    anthropics/skills

    Official

    Guides the design and implementation of Model Context Protocol servers in TypeScript or Python, from tool naming and error messages to evaluation.

    180k GitHub starsUsed in 62 repos~2.3k tokens
    Agent WorkflowsAuto-check passed
  • PDF Processing

    anthropics/skills

    Official

    Handles everyday PDF jobs in Python and on the command line: extract text and tables, merge, split, rotate, watermark, fill forms, encrypt and OCR.

    180k GitHub starsUsed in 48 repos~2k tokens
    Documents & OfficeAuto-check passed
  • NotebookLM Research Assistant

    PleasePrompto/notebooklm-skill

    Lets Claude Code ask questions of your Google NotebookLM notebooks through browser automation and return answers grounded in your uploaded sources.

    7.8k GitHub starsUsed in 13 repos~2.4k tokens
    Knowledge ManagementAuto-check: notes
  • Manim Video Production

    browser-use/video-use

    Produces math and technical explainer videos with Manim Community Edition: concept animations, equation derivations, algorithm walkthroughs and data stories.

    28k GitHub starsUsed in 6 repos~3k tokens
    Media & CreativeAuto-check passed
  • Code Review Checklist

    shareAI-lab/learn-claude-code

    Reviews code against a five-part checklist covering security, correctness, performance, maintainability and testing, and reports findings in a fixed format.

    78k GitHub starsUsed in 5 repos~1.1k tokens
    DevelopmentAuto-check passed
  • PPT Master

    hugohe3/ppt-master

    Generates editable PowerPoint decks, rebuilds slides from images, fills .pptx templates and polishes existing presentations through routed workflows.

    58k GitHub starsUsed in 1 repo~2.5k tokens
    Documents & OfficeAuto-check passed

More from zLanqing/codex-claude-academic-skills

All 17 skills in this repo
  • Matplotlib

    zLanqing/codex-claude-academic-skills

    Low-level plotting library for full customization. An agent skill from zLanqing/codex-claude-academic-skills.

    4.6k GitHub starsUsed in 17 repos~2.9k tokens
    Auto-check passed
  • Scikit Learn

    zLanqing/codex-claude-academic-skills

    Machine learning in Python with scikit-learn. An agent skill from zLanqing/codex-claude-academic-skills.

    4.6k GitHub starsUsed in 17 repos~3.9k tokens
    Auto-check passed
  • Networkx

    zLanqing/codex-claude-academic-skills

    Comprehensive toolkit for creating, analyzing, and visualizing complex networks and graphs in Python.

    4.6k GitHub starsUsed in 16 repos~3.2k tokens
    Auto-check passed
  • Seaborn

    zLanqing/codex-claude-academic-skills

    Statistical visualization with pandas integration. An agent skill from zLanqing/codex-claude-academic-skills.

    4.6k GitHub starsUsed in 16 repos~4.9k tokens
    Auto-check passed
  • Timesfm Forecasting

    zLanqing/codex-claude-academic-skills

    Zero-shot time series forecasting with Google's TimesFM foundation model.

    4.6k GitHub starsUsed in 6 repos~7.5k tokens
    Auto-check: notes
  • Statsmodels

    zLanqing/codex-claude-academic-skills

    Statistical models library for Python. An agent skill from zLanqing/codex-claude-academic-skills.

    4.6k GitHub starsUsed in 16 repos~4.9k tokens
    Auto-check passed

Works with

Questions about Simpy

What does Simpy do?

Process-based discrete-event simulation framework in Python. Simpy is an agent skill from zLanqing/codex-claude-academic-skills. Process-based discrete-event simulation framework in Python.

When should I use Simpy?

Simpy fits situations like: building simulations of systems with processes; time-based events such as manufacturing systems; service operations; network traffic.

How do I install Simpy in Claude Code?

Run `npx skills add zLanqing/codex-claude-academic-skills --skill simpy -a claude-code`. Or copy the skill folder (scientific-toolkit-skill/references/scientific-skills/simpy in zLanqing/codex-claude-academic-skills) into .claude/skills/simpy in your project. Claude Code loads it when a task matches its description.

How do I install Simpy in Codex?

Run `npx skills add zLanqing/codex-claude-academic-skills --skill simpy -a codex`. Or copy the skill folder (scientific-toolkit-skill/references/scientific-skills/simpy in zLanqing/codex-claude-academic-skills) into .agents/skills/simpy in your project. Codex loads it when a task matches its description.

Can I use Simpy in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add zLanqing/codex-claude-academic-skills --skill simpy -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/simpy, .gemini/skills/simpy, .github/skills/simpy and .opencode/skills/simpy in your project.

What does Simpy need to run?

Going by SKILL.md and its folder, Simpy needs Python for the scripts in its folder. Our summary lists: Python 3.

Does Simpy access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Simpy safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Simpy use?

Simpy is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Simpy use?

About 3k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 13k tokens, read only when the agent opens those files.

What are the alternatives to Simpy?

Skills that share tags, products or a category with Simpy: MCP Server Builder (anthropics/skills, 180k stars), PDF Processing (anthropics/skills, 180k stars), NotebookLM Research Assistant (PleasePrompto/notebooklm-skill, 7.8k stars) and Manim Video Production (browser-use/video-use, 28k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Simpy?

zLanqing (a GitHub user) maintains it in zLanqing/codex-claude-academic-skills, which has 4,578 GitHub stars. The repository holds 17 skills in this directory. The repository was last updated on May 14, 2026.

Source: zLanqing/codex-claude-academic-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.