[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6JA35MC05YPS15CFJS7VG2X":3,"skill-same:01M6JA35MC05YPS15CFJS7VG2X":83},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":23,"publishedAt":48,"linkOnly":49,"markdownContent":50,"markdownBody":51,"frontMatter":52,"refName":62,"commitSha":63,"skillDirectory":64,"forksCount":56,"repositoryHtmlUrl":65,"repositoryHomepageUrl":6,"ownerHtmlUrl":66,"ownerBlogUrl":67,"ownerDescription":68,"updatedAt":69,"install":70,"resources":82},"01M6JA35MC05YPS15CFJS7VG2X","science-simpy",null,"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.","Flissel\u002Fvibemind-os","Flissel","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F104565236?v=4","01M6J8Q88NWAJGKPC5TEG9YCNV","Felix Baumann","01M6J8Q8D7XAFY44P70XTJFZBW",1,"MIT","https:\u002F\u002Fgithub.com\u002FFlissel\u002Fvibemind-os\u002Fblob\u002Fmaster\u002Fskills\u002Fscience\u002Fsimpy\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47],"simpy","science","science simpy","events","Simulations","2026","when","queues","source","true","traffic","event","manufacturing","resources","python","as","shared","time","imported","repo","system","simulation","network","framework","2026-11-10 10:12:30",false,"---\nname: science-simpy\ndescription: Process-based discrete-event simulation framework in Python. Use this\n  skill when building simulations of systems with processes, queues, resources, and\n  time-based events such as manufacturing systems, service operations, network traffic,\n  logistics, or any system where entities interact with shared resources over time.\napp: science\nrequires_approval: true\nagents:\n- '*'\ninputs: []\nexpected_state:\n  description: Imported skill — behavior matches source repo\n  verification_tool: none\nconfidence: 1.0\nattempts: 0\nsuccesses: 0\nlast_adjusted: '2026-05-11T21:21:45+00:00'\n---\n\n# SimPy - Discrete-Event Simulation\n\n## Overview\n\nSimPy 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.\n\n**Core capabilities:**\n- Process modeling using Python generator functions\n- Shared resource management (servers, containers, stores)\n- Event-driven scheduling and synchronization\n- Real-time simulations synchronized with wall-clock time\n- Comprehensive monitoring and data collection\n\n## When to Use This Skill\n\nUse the SimPy skill when:\n\n1. **Modeling discrete-event systems** - Systems where events occur at irregular intervals\n2. **Resource contention** - Entities compete for limited resources (servers, machines, staff)\n3. **Queue analysis** - Studying waiting lines, service times, and throughput\n4. **Process optimization** - Analyzing manufacturing, logistics, or service processes\n5. **Network simulation** - Packet routing, bandwidth allocation, latency analysis\n6. **Capacity planning** - Determining optimal resource levels for desired performance\n7. **System validation** - Testing system behavior before implementation\n\n**Not suitable for:**\n- Continuous simulations with fixed time steps (consider SciPy ODE solvers)\n- Independent processes without resource sharing\n- Pure mathematical optimization (consider SciPy optimize)\n\n## Quick Start\n\n### Basic Simulation Structure\n\n```python\nimport simpy\n\ndef process(env, name):\n    \"\"\"A simple process that waits and prints.\"\"\"\n    print(f'{name} starting at {env.now}')\n    yield env.timeout(5)\n    print(f'{name} finishing at {env.now}')\n\n# Create environment\nenv = simpy.Environment()\n\n# Start processes\nenv.process(process(env, 'Process 1'))\nenv.process(process(env, 'Process 2'))\n\n# Run simulation\nenv.run(until=10)\n```\n\n### Resource Usage Pattern\n\n```python\nimport simpy\n\ndef customer(env, name, resource):\n    \"\"\"Customer requests resource, uses it, then releases.\"\"\"\n    with resource.request() as req:\n        yield req  # Wait for resource\n        print(f'{name} got resource at {env.now}')\n        yield env.timeout(3)  # Use resource\n        print(f'{name} released resource at {env.now}')\n\nenv = simpy.Environment()\nserver = simpy.Resource(env, capacity=1)\n\nenv.process(customer(env, 'Customer 1', server))\nenv.process(customer(env, 'Customer 2', server))\nenv.run()\n```\n\n## Core Concepts\n\n### 1. Environment\n\nThe simulation environment manages time and schedules events.\n\n```python\nimport simpy\n\n# Standard environment (runs as fast as possible)\nenv = simpy.Environment(initial_time=0)\n\n# Real-time environment (synchronized with wall-clock)\nimport simpy.rt\nenv_rt = simpy.rt.RealtimeEnvironment(factor=1.0)\n\n# Run simulation\nenv.run(until=100)  # Run until time 100\nenv.run()  # Run until no events remain\n```\n\n### 2. Processes\n\nProcesses are defined using Python generator functions (functions with `yield` statements).\n\n```python\ndef my_process(env, param1, param2):\n    \"\"\"Process that yields events to pause execution.\"\"\"\n    print(f'Starting at {env.now}')\n\n    # Wait for time to pass\n    yield env.timeout(5)\n\n    print(f'Resumed at {env.now}')\n\n    # Wait for another event\n    yield env.timeout(3)\n\n    print(f'Done at {env.now}')\n    return 'result'\n\n# Start the process\nenv.process(my_process(env, 'value1', 'value2'))\n```\n\n### 3. Events\n\nEvents are the fundamental mechanism for process synchronization. Processes yield events and resume when those events are triggered.\n\n**Common event types:**\n- `env.timeout(delay)` - Wait for time to pass\n- `resource.request()` - Request a resource\n- `env.event()` - Create a custom event\n- `env.process(func())` - Process as an event\n- `event1 & event2` - Wait for all events (AllOf)\n- `event1 | event2` - Wait for any event (AnyOf)\n\n## Resources\n\nSimPy provides several resource types for different scenarios. For comprehensive details, see `references\u002Fresources.md`.\n\n### Resource Types Summary\n\n| Resource Type | Use Case |\n|---------------|----------|\n| Resource | Limited capacity (servers, machines) |\n| PriorityResource | Priority-based queuing |\n| PreemptiveResource | High-priority can interrupt low-priority |\n| Container | Bulk materials (fuel, water) |\n| Store | Python object storage (FIFO) |\n| FilterStore | Selective item retrieval |\n| PriorityStore | Priority-ordered items |\n\n### Quick Reference\n\n```python\nimport simpy\n\nenv = simpy.Environment()\n\n# Basic resource (e.g., servers)\nresource = simpy.Resource(env, capacity=2)\n\n# Priority resource\npriority_resource = simpy.PriorityResource(env, capacity=1)\n\n# Container (e.g., fuel tank)\nfuel_tank = simpy.Container(env, capacity=100, init=50)\n\n# Store (e.g., warehouse)\nwarehouse = simpy.Store(env, capacity=10)\n```\n\n## Common Simulation Patterns\n\n### Pattern 1: Customer-Server Queue\n\n```python\nimport simpy\nimport random\n\ndef customer(env, name, server):\n    arrival = env.now\n    with server.request() as req:\n        yield req\n        wait = env.now - arrival\n        print(f'{name} waited {wait:.2f}, served at {env.now}')\n        yield env.timeout(random.uniform(2, 4))\n\ndef customer_generator(env, server):\n    i = 0\n    while True:\n        yield env.timeout(random.uniform(1, 3))\n        i += 1\n        env.process(customer(env, f'Customer {i}', server))\n\nenv = simpy.Environment()\nserver = simpy.Resource(env, capacity=2)\nenv.process(customer_generator(env, server))\nenv.run(until=20)\n```\n\n### Pattern 2: Producer-Consumer\n\n```python\nimport simpy\n\ndef producer(env, store):\n    item_id = 0\n    while True:\n        yield env.timeout(2)\n        item = f'Item {item_id}'\n        yield store.put(item)\n        print(f'Produced {item} at {env.now}')\n        item_id += 1\n\ndef consumer(env, store):\n    while True:\n        item = yield store.get()\n        print(f'Consumed {item} at {env.now}')\n        yield env.timeout(3)\n\nenv = simpy.Environment()\nstore = simpy.Store(env, capacity=10)\nenv.process(producer(env, store))\nenv.process(consumer(env, store))\nenv.run(until=20)\n```\n\n### Pattern 3: Parallel Task Execution\n\n```python\nimport simpy\n\ndef task(env, name, duration):\n    print(f'{name} starting at {env.now}')\n    yield env.timeout(duration)\n    print(f'{name} done at {env.now}')\n    return f'{name} result'\n\ndef coordinator(env):\n    # Start tasks in parallel\n    task1 = env.process(task(env, 'Task 1', 5))\n    task2 = env.process(task(env, 'Task 2', 3))\n    task3 = env.process(task(env, 'Task 3', 4))\n\n    # Wait for all to complete\n    results = yield task1 & task2 & task3\n    print(f'All done at {env.now}')\n\nenv = simpy.Environment()\nenv.process(coordinator(env))\nenv.run()\n```\n\n## Workflow Guide\n\n### Step 1: Define the System\n\nIdentify:\n- **Entities**: What moves through the system? (customers, parts, packets)\n- **Resources**: What are the constraints? (servers, machines, bandwidth)\n- **Processes**: What are the activities? (arrival, service, departure)\n- **Metrics**: What to measure? (wait times, utilization, throughput)\n\n### Step 2: Implement Process Functions\n\nCreate generator functions for each process type:\n\n```python\ndef entity_process(env, name, resources, parameters):\n    # Arrival logic\n    arrival_time = env.now\n\n    # Request resources\n    with resource.request() as req:\n        yield req\n\n        # Service logic\n        service_time = calculate_service_time(parameters)\n        yield env.timeout(service_time)\n\n    # Departure logic\n    collect_statistics(env.now - arrival_time)\n```\n\n### Step 3: Set Up Monitoring\n\nUse monitoring utilities to collect data. See `references\u002Fmonitoring.md` for comprehensive techniques.\n\n```python\nfrom scripts.resource_monitor import ResourceMonitor\n\n# Create and monitor resource\nresource = simpy.Resource(env, capacity=2)\nmonitor = ResourceMonitor(env, resource, \"Server\")\n\n# After simulation\nmonitor.report()\n```\n\n### Step 4: Run and Analyze\n\n```python\n# Run simulation\nenv.run(until=simulation_time)\n\n# Generate reports\nmonitor.report()\nstats.report()\n\n# Export data for further analysis\nmonitor.export_csv('results.csv')\n```\n\n## Advanced Features\n\n### Process Interaction\n\nProcesses can interact through events, process yields, and interrupts. See `references\u002Fprocess-interaction.md` for detailed patterns.\n\n**Key mechanisms:**\n- **Event signaling**: Shared events for coordination\n- **Process yields**: Wait for other processes to complete\n- **Interrupts**: Forcefully resume processes for preemption\n\n### Real-Time Simulations\n\nSynchronize simulation with wall-clock time for hardware-in-the-loop or interactive applications. See `references\u002Freal-time.md`.\n\n```python\nimport simpy.rt\n\nenv = simpy.rt.RealtimeEnvironment(factor=1.0)  # 1:1 time mapping\n# factor=0.5 means 1 sim unit = 0.5 seconds (2x faster)\n```\n\n### Comprehensive Monitoring\n\nMonitor processes, resources, and events. See `references\u002Fmonitoring.md` for techniques including:\n- State variable tracking\n- Resource monkey-patching\n- Event tracing\n- Statistical collection\n\n## Scripts and Templates\n\n### basic_simulation_template.py\n\nComplete template for building queue simulations with:\n- Configurable parameters\n- Statistics collection\n- Customer generation\n- Resource usage\n- Report generation\n\n**Usage:**\n```python\nfrom scripts.basic_simulation_template import SimulationConfig, run_simulation\n\nconfig = SimulationConfig()\nconfig.num_resources = 2\nconfig.sim_time = 100\nstats = run_simulation(config)\nstats.report()\n```\n\n### resource_monitor.py\n\nReusable monitoring utilities:\n- `ResourceMonitor` - Track single resource\n- `MultiResourceMonitor` - Monitor multiple resources\n- `ContainerMonitor` - Track container levels\n- Automatic statistics calculation\n- CSV export functionality\n\n**Usage:**\n```python\nfrom scripts.resource_monitor import ResourceMonitor\n\nmonitor = ResourceMonitor(env, resource, \"My Resource\")\n# ... run simulation ...\nmonitor.report()\nmonitor.export_csv('data.csv')\n```\n\n## Reference Documentation\n\nDetailed guides for specific topics:\n\n- **`references\u002Fresources.md`** - All resource types with examples\n- **`references\u002Fevents.md`** - Event system and patterns\n- **`references\u002Fprocess-interaction.md`** - Process synchronization\n- **`references\u002Fmonitoring.md`** - Data collection techniques\n- **`references\u002Freal-time.md`** - Real-time simulation setup\n\n## Best Practices\n\n1. **Generator functions**: Always use `yield` in process functions\n2. **Resource context managers**: Use `with resource.request() as req:` for automatic cleanup\n3. **Reproducibility**: Set `random.seed()` for consistent results\n4. **Monitoring**: Collect data throughout simulation, not just at the end\n5. **Validation**: Compare simple cases with analytical solutions\n6. **Documentation**: Comment process logic and parameter choices\n7. **Modular design**: Separate process logic, statistics, and configuration\n\n## Common Pitfalls\n\n1. **Forgetting yield**: Processes must yield events to pause\n2. **Event reuse**: Events can only be triggered once\n3. **Resource leaks**: Use context managers or ensure release\n4. **Blocking operations**: Avoid Python blocking calls in processes\n5. **Time units**: Stay consistent with time unit interpretation\n6. **Deadlocks**: Ensure at least one process can make progress\n\n## Example Use Cases\n\n- **Manufacturing**: Machine scheduling, production lines, inventory management\n- **Healthcare**: Emergency room simulation, patient flow, staff allocation\n- **Telecommunications**: Network traffic, packet routing, bandwidth allocation\n- **Transportation**: Traffic flow, logistics, vehicle routing\n- **Service operations**: Call centers, retail checkout, appointment scheduling\n- **Computer systems**: CPU scheduling, memory management, I\u002FO operations\n\n","# SimPy - Discrete-Event Simulation\n\n## Overview\n\nSimPy 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.\n\n**Core capabilities:**\n- Process modeling using Python generator functions\n- Shared resource management (servers, containers, stores)\n- Event-driven scheduling and synchronization\n- Real-time simulations synchronized with wall-clock time\n- Comprehensive monitoring and data collection\n\n## When to Use This Skill\n\nUse the SimPy skill when:\n\n1. **Modeling discrete-event systems** - Systems where events occur at irregular intervals\n2. **Resource contention** - Entities compete for limited resources (servers, machines, staff)\n3. **Queue analysis** - Studying waiting lines, service times, and throughput\n4. **Process optimization** - Analyzing manufacturing, logistics, or service processes\n5. **Network simulation** - Packet routing, bandwidth allocation, latency analysis\n6. **Capacity planning** - Determining optimal resource levels for desired performance\n7. **System validation** - Testing system behavior before implementation\n\n**Not suitable for:**\n- Continuous simulations with fixed time steps (consider SciPy ODE solvers)\n- Independent processes without resource sharing\n- Pure mathematical optimization (consider SciPy optimize)\n\n## Quick Start\n\n### Basic Simulation Structure\n\n```python\nimport simpy\n\ndef process(env, name):\n    \"\"\"A simple process that waits and prints.\"\"\"\n    print(f'{name} starting at {env.now}')\n    yield env.timeout(5)\n    print(f'{name} finishing at {env.now}')\n\n# Create environment\nenv = simpy.Environment()\n\n# Start processes\nenv.process(process(env, 'Process 1'))\nenv.process(process(env, 'Process 2'))\n\n# Run simulation\nenv.run(until=10)\n```\n\n### Resource Usage Pattern\n\n```python\nimport simpy\n\ndef customer(env, name, resource):\n    \"\"\"Customer requests resource, uses it, then releases.\"\"\"\n    with resource.request() as req:\n        yield req  # Wait for resource\n        print(f'{name} got resource at {env.now}')\n        yield env.timeout(3)  # Use resource\n        print(f'{name} released resource at {env.now}')\n\nenv = simpy.Environment()\nserver = simpy.Resource(env, capacity=1)\n\nenv.process(customer(env, 'Customer 1', server))\nenv.process(customer(env, 'Customer 2', server))\nenv.run()\n```\n\n## Core Concepts\n\n### 1. Environment\n\nThe simulation environment manages time and schedules events.\n\n```python\nimport simpy\n\n# Standard environment (runs as fast as possible)\nenv = simpy.Environment(initial_time=0)\n\n# Real-time environment (synchronized with wall-clock)\nimport simpy.rt\nenv_rt = simpy.rt.RealtimeEnvironment(factor=1.0)\n\n# Run simulation\nenv.run(until=100)  # Run until time 100\nenv.run()  # Run until no events remain\n```\n\n### 2. Processes\n\nProcesses are defined using Python generator functions (functions with `yield` statements).\n\n```python\ndef my_process(env, param1, param2):\n    \"\"\"Process that yields events to pause execution.\"\"\"\n    print(f'Starting at {env.now}')\n\n    # Wait for time to pass\n    yield env.timeout(5)\n\n    print(f'Resumed at {env.now}')\n\n    # Wait for another event\n    yield env.timeout(3)\n\n    print(f'Done at {env.now}')\n    return 'result'\n\n# Start the process\nenv.process(my_process(env, 'value1', 'value2'))\n```\n\n### 3. Events\n\nEvents are the fundamental mechanism for process synchronization. Processes yield events and resume when those events are triggered.\n\n**Common event types:**\n- `env.timeout(delay)` - Wait for time to pass\n- `resource.request()` - Request a resource\n- `env.event()` - Create a custom event\n- `env.process(func())` - Process as an event\n- `event1 & event2` - Wait for all events (AllOf)\n- `event1 | event2` - Wait for any event (AnyOf)\n\n## Resources\n\nSimPy provides several resource types for different scenarios. For comprehensive details, see `references\u002Fresources.md`.\n\n### Resource Types Summary\n\n| Resource Type | Use Case |\n|---------------|----------|\n| Resource | Limited capacity (servers, machines) |\n| PriorityResource | Priority-based queuing |\n| PreemptiveResource | High-priority can interrupt low-priority |\n| Container | Bulk materials (fuel, water) |\n| Store | Python object storage (FIFO) |\n| FilterStore | Selective item retrieval |\n| PriorityStore | Priority-ordered items |\n\n### Quick Reference\n\n```python\nimport simpy\n\nenv = simpy.Environment()\n\n# Basic resource (e.g., servers)\nresource = simpy.Resource(env, capacity=2)\n\n# Priority resource\npriority_resource = simpy.PriorityResource(env, capacity=1)\n\n# Container (e.g., fuel tank)\nfuel_tank = simpy.Container(env, capacity=100, init=50)\n\n# Store (e.g., warehouse)\nwarehouse = simpy.Store(env, capacity=10)\n```\n\n## Common Simulation Patterns\n\n### Pattern 1: Customer-Server Queue\n\n```python\nimport simpy\nimport random\n\ndef customer(env, name, server):\n    arrival = env.now\n    with server.request() as req:\n        yield req\n        wait = env.now - arrival\n        print(f'{name} waited {wait:.2f}, served at {env.now}')\n        yield env.timeout(random.uniform(2, 4))\n\ndef customer_generator(env, server):\n    i = 0\n    while True:\n        yield env.timeout(random.uniform(1, 3))\n        i += 1\n        env.process(customer(env, f'Customer {i}', server))\n\nenv = simpy.Environment()\nserver = simpy.Resource(env, capacity=2)\nenv.process(customer_generator(env, server))\nenv.run(until=20)\n```\n\n### Pattern 2: Producer-Consumer\n\n```python\nimport simpy\n\ndef producer(env, store):\n    item_id = 0\n    while True:\n        yield env.timeout(2)\n        item = f'Item {item_id}'\n        yield store.put(item)\n        print(f'Produced {item} at {env.now}')\n        item_id += 1\n\ndef consumer(env, store):\n    while True:\n        item = yield store.get()\n        print(f'Consumed {item} at {env.now}')\n        yield env.timeout(3)\n\nenv = simpy.Environment()\nstore = simpy.Store(env, capacity=10)\nenv.process(producer(env, store))\nenv.process(consumer(env, store))\nenv.run(until=20)\n```\n\n### Pattern 3: Parallel Task Execution\n\n```python\nimport simpy\n\ndef task(env, name, duration):\n    print(f'{name} starting at {env.now}')\n    yield env.timeout(duration)\n    print(f'{name} done at {env.now}')\n    return f'{name} result'\n\ndef coordinator(env):\n    # Start tasks in parallel\n    task1 = env.process(task(env, 'Task 1', 5))\n    task2 = env.process(task(env, 'Task 2', 3))\n    task3 = env.process(task(env, 'Task 3', 4))\n\n    # Wait for all to complete\n    results = yield task1 & task2 & task3\n    print(f'All done at {env.now}')\n\nenv = simpy.Environment()\nenv.process(coordinator(env))\nenv.run()\n```\n\n## Workflow Guide\n\n### Step 1: Define the System\n\nIdentify:\n- **Entities**: What moves through the system? (customers, parts, packets)\n- **Resources**: What are the constraints? (servers, machines, bandwidth)\n- **Processes**: What are the activities? (arrival, service, departure)\n- **Metrics**: What to measure? (wait times, utilization, throughput)\n\n### Step 2: Implement Process Functions\n\nCreate generator functions for each process type:\n\n```python\ndef entity_process(env, name, resources, parameters):\n    # Arrival logic\n    arrival_time = env.now\n\n    # Request resources\n    with resource.request() as req:\n        yield req\n\n        # Service logic\n        service_time = calculate_service_time(parameters)\n        yield env.timeout(service_time)\n\n    # Departure logic\n    collect_statistics(env.now - arrival_time)\n```\n\n### Step 3: Set Up Monitoring\n\nUse monitoring utilities to collect data. See `references\u002Fmonitoring.md` for comprehensive techniques.\n\n```python\nfrom scripts.resource_monitor import ResourceMonitor\n\n# Create and monitor resource\nresource = simpy.Resource(env, capacity=2)\nmonitor = ResourceMonitor(env, resource, \"Server\")\n\n# After simulation\nmonitor.report()\n```\n\n### Step 4: Run and Analyze\n\n```python\n# Run simulation\nenv.run(until=simulation_time)\n\n# Generate reports\nmonitor.report()\nstats.report()\n\n# Export data for further analysis\nmonitor.export_csv('results.csv')\n```\n\n## Advanced Features\n\n### Process Interaction\n\nProcesses can interact through events, process yields, and interrupts. See `references\u002Fprocess-interaction.md` for detailed patterns.\n\n**Key mechanisms:**\n- **Event signaling**: Shared events for coordination\n- **Process yields**: Wait for other processes to complete\n- **Interrupts**: Forcefully resume processes for preemption\n\n### Real-Time Simulations\n\nSynchronize simulation with wall-clock time for hardware-in-the-loop or interactive applications. See `references\u002Freal-time.md`.\n\n```python\nimport simpy.rt\n\nenv = simpy.rt.RealtimeEnvironment(factor=1.0)  # 1:1 time mapping\n# factor=0.5 means 1 sim unit = 0.5 seconds (2x faster)\n```\n\n### Comprehensive Monitoring\n\nMonitor processes, resources, and events. See `references\u002Fmonitoring.md` for techniques including:\n- State variable tracking\n- Resource monkey-patching\n- Event tracing\n- Statistical collection\n\n## Scripts and Templates\n\n### basic_simulation_template.py\n\nComplete template for building queue simulations with:\n- Configurable parameters\n- Statistics collection\n- Customer generation\n- Resource usage\n- Report generation\n\n**Usage:**\n```python\nfrom scripts.basic_simulation_template import SimulationConfig, run_simulation\n\nconfig = SimulationConfig()\nconfig.num_resources = 2\nconfig.sim_time = 100\nstats = run_simulation(config)\nstats.report()\n```\n\n### resource_monitor.py\n\nReusable monitoring utilities:\n- `ResourceMonitor` - Track single resource\n- `MultiResourceMonitor` - Monitor multiple resources\n- `ContainerMonitor` - Track container levels\n- Automatic statistics calculation\n- CSV export functionality\n\n**Usage:**\n```python\nfrom scripts.resource_monitor import ResourceMonitor\n\nmonitor = ResourceMonitor(env, resource, \"My Resource\")\n# ... run simulation ...\nmonitor.report()\nmonitor.export_csv('data.csv')\n```\n\n## Reference Documentation\n\nDetailed guides for specific topics:\n\n- **`references\u002Fresources.md`** - All resource types with examples\n- **`references\u002Fevents.md`** - Event system and patterns\n- **`references\u002Fprocess-interaction.md`** - Process synchronization\n- **`references\u002Fmonitoring.md`** - Data collection techniques\n- **`references\u002Freal-time.md`** - Real-time simulation setup\n\n## Best Practices\n\n1. **Generator functions**: Always use `yield` in process functions\n2. **Resource context managers**: Use `with resource.request() as req:` for automatic cleanup\n3. **Reproducibility**: Set `random.seed()` for consistent results\n4. **Monitoring**: Collect data throughout simulation, not just at the end\n5. **Validation**: Compare simple cases with analytical solutions\n6. **Documentation**: Comment process logic and parameter choices\n7. **Modular design**: Separate process logic, statistics, and configuration\n\n## Common Pitfalls\n\n1. **Forgetting yield**: Processes must yield events to pause\n2. **Event reuse**: Events can only be triggered once\n3. **Resource leaks**: Use context managers or ensure release\n4. **Blocking operations**: Avoid Python blocking calls in processes\n5. **Time units**: Stay consistent with time unit interpretation\n6. **Deadlocks**: Ensure at least one process can make progress\n\n## Example Use Cases\n\n- **Manufacturing**: Machine scheduling, production lines, inventory management\n- **Healthcare**: Emergency room simulation, patient flow, staff allocation\n- **Telecommunications**: Network traffic, packet routing, bandwidth allocation\n- **Transportation**: Traffic flow, logistics, vehicle routing\n- **Service operations**: Call centers, retail checkout, appointment scheduling\n- **Computer systems**: CPU scheduling, memory management, I\u002FO operations\n\n",{"app":25,"name":5,"agents":53,"inputs":55,"attempts":56,"successes":56,"confidence":14,"description":7,"last_adjusted":57,"expected_state":58,"requires_approval":61},[54],"*",[],0,"2026-05-11T21:21:45+00:00",{"description":59,"verification_tool":60},"Imported skill — behavior matches source repo","none",true,"master","5f13b5d2b532c0ab6f847e3aa24d4bfe66f7d461","skills\u002Fscience\u002Fsimpy","https:\u002F\u002Fgithub.com\u002FFlissel\u002Fvibemind-os","https:\u002F\u002Fgithub.com\u002FFlissel","https:\u002F\u002Fvibemind.space","Co-founder & CTO, VibeMind - a voice-first agentic OS for non-technical founders. Agents that do the work, not describe it.","2026-11-11 05:34:01",{"source":8,"skillName":5,"commands":71,"prompt":81,"zipAvailable":61},[72,75,78],{"tool":73,"command":74},"npx","npx skills add Flissel\u002Fvibemind-os --skill science-simpy",{"tool":76,"command":77},"bunx","bunx skills add Flissel\u002Fvibemind-os --skill science-simpy",{"tool":79,"command":80},"pnpm","pnpm dlx skills add Flissel\u002Fvibemind-os --skill science-simpy","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FFlissel\u002Fvibemind-os\u002Fblob\u002Fmaster\u002Fskills\u002Fscience\u002Fsimpy\u002FSKILL.md",[],[84,92,99,127,135,149],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":48},"01M6JAA67M92TRE7GWDJDBTA9T","review","Review a change.","https:\u002F\u002Fgithub.com\u002FFlissel\u002Fvibemind-os\u002Fblob\u002Fmaster\u002Fspaces\u002Frowboat\u002Frowboat\u002Fpackages\u002Fopenai-plugin-runtime\u002Ftest\u002Ffixtures\u002Fcomplete-plugin\u002Fskills\u002Freview\u002FSKILL.md",[],[86,91],"change",{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":48},"01M6JAA3DZR55G8ZY493BE9NBB","triage","Triage a change.","https:\u002F\u002Fgithub.com\u002FFlissel\u002Fvibemind-os\u002Fblob\u002Fmaster\u002Fspaces\u002Frowboat\u002Frowboat\u002Fpackages\u002Fopenai-plugin-runtime\u002Ftest\u002Ffixtures\u002Fcomplete-plugin\u002Fskills\u002Fgroup\u002Ftriage\u002FSKILL.md",[],[94,91],{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":48},"01M6JA9XPVHENK0FQN7HBK54NV","zentrale-werkzeuge","Werkzeuge der Zentrale – nutzen bei GitHub-Fragen (Projekte updaten, Repos, Issues, PRs, Commits, CI\u002FActions-Status, README), bei Fragen zum eigenen Gitea (Sicherung\u002FSpiegel, Repos, Issues, Commits), wenn neueste Docs\u002FDoku zu einer Bibliothek oder einem Dienst geholt werden sollen, wenn ein Dashboard aus meinen Daten gebaut werden soll und wenn ich sage 'auf meinem PC suchen' oder 'such auf dem Rechner nach …'.","https:\u002F\u002Fgithub.com\u002FFlissel\u002Fvibemind-os\u002Fblob\u002Fmaster\u002Fspaces\u002Frowboat\u002Fdeploy\u002Fheadless\u002Fskills\u002Fzentrale-werkzeuge\u002FSKILL.md",[],[106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126],"zentrale werkzeuge","grep","file","README","list","fetch","todo","gitea","add","URL","mkdir","prs","commits","ci","actions","issues","status","repos","dashboard","github","docs",{"skillNo":128,"name":129,"nameZh":6,"description":130,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":131,"categories":132,"keywords":133,"publishedAt":48},"01M6JA9SQPX187CVC148SQT1SP","wissen-suchen","Bedeutungssuche im Rowboat-Wissen – IMMER zuerst nutzen, wenn nach Kunden, Kontakten, Themen, Interessen, Notizen oder 'was wissen wir über …' gefragt wird, besonders wenn die genauen Wörter unklar sind.","https:\u002F\u002Fgithub.com\u002FFlissel\u002Fvibemind-os\u002Fblob\u002Fmaster\u002Fspaces\u002Frowboat\u002Fdeploy\u002Fheadless\u002Fskills\u002Fwissen-suchen\u002FSKILL.md",[],[134],"wissen suchen",{"skillNo":136,"name":137,"nameZh":6,"description":138,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":139,"categories":140,"keywords":141,"publishedAt":48},"01M6JA9P6GNFPE21101SDZS3BT","reel-aus-material","Reel aus vorhandenen Laura-Videos: passende Stellen im Transkript finden; spricht dort eine Person, bleibt ihr Originalton (mit Untertiteln aus dem Transkript), sonst trägt ein eingesprochener Satz den Clip. Bei Aufträgen der Art 'material'.","https:\u002F\u002Fgithub.com\u002FFlissel\u002Fvibemind-os\u002Fblob\u002Fmaster\u002Fspaces\u002Fmarketing\u002Fvideo_claw\u002Fskills\u002Freel-aus-material\u002FSKILL.md",[],[142,143,144,145,146,147,148],"material","reel","reel aus material","person","videos","Art","clip",{"skillNo":150,"name":151,"nameZh":6,"description":152,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":153,"categories":154,"keywords":155,"publishedAt":48},"01M6JA9KSATRT42ACWT66514ZP","reel-aus-bildern","Reel ohne Filmmaterial: Titelkarte, 3–5 Markenbilder mit wechselnder Bewegung, Schlusskarte mit Handlung; Farben und Logo der Firma. Bei Aufträgen der Art 'bilder'.","https:\u002F\u002Fgithub.com\u002FFlissel\u002Fvibemind-os\u002Fblob\u002Fmaster\u002Fspaces\u002Fmarketing\u002Fvideo_claw\u002Fskills\u002Freel-aus-bildern\u002FSKILL.md",[],[143,156,157,147],"reel aus bildern","logo"]