मुख्य सामग्री पर जाएँ
Skillpedia
एनालिसिस और स्प्रेडशीट33k · #9030

simpy

यह क्या करती है

यह स्किल आपके एजेंट को SimPy से डिस्क्रीट-इवेंट सिमुलेशन बनाना सिखाती है, जो एक Python फ़्रेमवर्क है। यह उन इकाइयों का मॉडल बनाती है जो संसाधनों के लिए होड़ करती हैं। यह प्रक्रियाओं या क्षमता की योजना बनाने वाले विश्लेषकों और इंजीनियरों के लिए है।

कब इस्तेमाल करें

  • ✓जब आप सीमित स्टाफ़ का इंतज़ार करते ग्राहकों की कतार का मॉडल बनाना चाहें।
  • ✓जब आपको देखना हो कि कम या ज़्यादा मशीनों के साथ फ़ैक्टरी लाइन कैसे चलती है।
  • ✓जब आप लॉजिस्टिक्स या नेटवर्क सिस्टम की क्षमता की योजना बना रहे हों।

Skill का लिंक

https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/scientific/simpy/SKILL.md

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/scientific/simpy/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“तीन डॉक्टरों वाले क्लिनिक का सिमुलेशन बनाइए, जिसमें मरीज़ों का आना अनियमित हो, और मुझे औसत प्रतीक्षा समय बताइए।”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

आपका एजेंट प्रक्रियाओं को Python generator फ़ंक्शन के रूप में लिखता है, साझा संसाधन सेट करता है और सिमुलेशन घड़ी चलाता है। फिर वह समय से जुड़े आँकड़े इकट्ठा करके नतीजे बताता है।

तकनीकी सामग्री (मूल SKILL.md)

लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।

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

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

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.

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

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 Type Use Case
Resource Limited capacity (servers, machines)
PriorityResource Priority-based queuing
PreemptiveResource High-priority can interrupt low-priority
Container Bulk materials (fuel, water)
Store Python object storage (FIFO)
FilterStore Selective item retrieval
PriorityStore Priority-ordered items

Quick Reference

import simpy

env = simpy.En
अक्सर पूछे जाने वाले सवाल

डिस्क्रीट-इवेंट सिमुलेशन क्या है?

यह ऐसा मॉडल है जिसमें चीज़ें समय के खास बिंदुओं पर होती हैं, जैसे आगमन या समाप्ति, लगातार नहीं।

क्या यह रियल टाइम में चल सकता है?

हाँ। स्किल घड़ी के साथ सिंक्रोनाइज़ रियल-टाइम सिमुलेशन का ज़िक्र करती है।

क्या यह क्षमता योजना के लिए अच्छी है?

हाँ। स्किल सही संसाधन स्तर खोजने के लिए सिमुलेशन के उपयोग का ज़िक्र करती है।

जानकारी

लेखक का मूल विवरण

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.

repo: davila7/claude-code-templates

लोकप्रियता

GitHub स्टार
33k
रैंकिंग में स्थान
#9030
लाइसेंस
MIT
अपडेट की गई
2/11/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

owasp-security

33k

आपके एजेंट को वेब ऐप, API, मोबाइल, कंटेनर और AI एजेंट्स के लिए OWASP सुरक्षा मार्गदर्शन सिखाती है, ताकि वह आम कमज़ोरियाँ पहचान सके और सुधार सुझा सके।

कोडिंगसिक्योरिटी

agent-management

33k

आपके एजेंट को AI Maestro कमांड-लाइन से AI एजेंट बनाने, सूची देखने, hibernate और wake करने, नाम बदलने और हटाने देती है, हर एजेंट के जीवन-चक्र को संभालते हुए।

AI और एजेंटएजेंट

agent-messaging

33k

Agent Messaging Protocol का उपयोग करके AI एजेंट्स के बीच हस्ताक्षरित संदेश भेजने, प्राप्त करने और उनका जवाब देने देती है, ज़्यादातर आपकी अपनी मशीन पर।

AI और एजेंटएजेंट

docs-search

33k

आपके एजेंट को फ़ंक्शन सिग्नेचर, क्लास परिभाषा और कमेंट के लिए ऑटो-जनरेटेड कोड डॉक्यूमेंटेशन खोजने देती है, ताकि कोड बदलने से पहले वह असली API जाँच सके।

कोडिंगसामान्य कोडिंग

मिलती-जुलती skills