simpy
하는 일
SimPy는 대기열이나 생산 라인처럼 시간에 따라 진행되는 시스템을 시뮬레이션하는 도구입니다. 이런 시스템이 어떻게 움직이는지 이해하고 문제를 미리 예측하는 데 도움을 줍니다.
사용하는 경우
- ✓은행 대기 시간을 시뮬레이션하고 싶을 때.
- ✓공장에서 제품이 흘러가는 과정을 모델링할 때.
- ✓컴퓨터 네트워크의 트래픽을 분석하는 경우.
스킬 링크
https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/simpy/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“고객이 5분마다 도착하고 응대에 평균 3분이 걸리는 서비스 대기열을 시뮬레이션해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
고객 도착처럼 일어나는 사건과, 그 사건이 상담 직원 같은 자원과 어떻게 상호작용하는지 설명합니다. SimPy가 사건의 순서와 시간을 정리합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
SimPy
Scope
Use this skill for process-based discrete-event models where active entities yield events and contend for resources: queues, production systems, logistics, networks, service operations, inventory, and other event-driven systems.
SimPy supplies an event scheduler and modeling primitives. It does not choose a scientifically valid conceptual model, input distribution, warm-up, run length, replication count, estimand, or causal interpretation. Treat those as simulation-study methodology, not SimPy API behavior.
Current release and installation
Reviewed 2026-10-01 against current official documentation and the released source:
- Latest stable: SimPy 4.1.2, released on PyPI 2026-05-24; source tag
4.1.2points to commitf4381649. - Package metadata requires Python >=3.8 and classifies CPython 3.8-3.14 plus PyPy. SimPy has no runtime dependencies.
- 4.1.2 adds Python 3.13/3.14 support and modern-interpreter test fixes.
- Upstream and this skill are MIT-licensed.
Create a reproducible environment:
uv venv --python 3.13
source .venv/bin/activate
uv pip install "simpy==4.1.2"
python -c "import importlib.metadata; print(importlib.metadata.version('simpy'))"
Do not silently substitute the latest documentation build: it may describe an
unreleased development revision. Use the versioned 4.1.2 links in
references/sources.md.
Model workflow
- Define purpose and estimands. State the decision/question, system boundary, entities, resources, state, outputs, time units, and terminating event or steady-state target.
- Write a conceptual model first. Record assumptions, distributions, routing, priorities, initial conditions, and omitted mechanisms.
- Implement generators. A SimPy process is an event-yielding Python generator.
Register the generator object with
env.process(...). - Bound execution. Give every production run explicit time, entity, event, and
replication caps. Never call
env.run()on a model containing an endless process. A time horizon alone cannot stop an endlessyield env.timeout(0)loop: events keep running at the same simulation time. Add an event-count or no-time-progress guard, and wait on state-change events instead of zero-delay busy polling. - Separate random streams. Use local RNG instances for logically distinct stochastic sources; retain a seed manifest.
- Instrument deliberately. Observe state after the transition of interest, close time-weighted intervals at the horizon, and test that monitoring does not alter event order.
- Verify and validate. Test deterministic edge cases, conservation identities, traces, queue discipline, and analytical benchmarks; compare against system or expert evidence for the stated purpose.
- Run independent replications. Make intervals from replication-level estimates, not correlated entities within one run.
- Report limitations. Include initialization, unfinished entities, run length, seeds/streams, precision, sensitivity, and validation evidence. Never convert simulation association into a causal claim.
Read references/simulation-methodology.md before making inferential claims.
Minimal bounded model
import random
import simpy
HORIZON = 480.0
arrival_rng = random.Random(101)
service_rng = random.Random(202)
env = simpy.Environment()
server = simpy.Resource(env, capacity=2)
completed = []
def customer(arrival):
with server.request() as request:
yield request
wait = env.now - arrival
yield env.timeout(service_rng.expovariate(1 / 6.0))
completed.append((env.now, wait))
def arrivals():
for _ in range(10_000): # Entity cap.
delay = arrival_rng.expovariate(1 / 4.0)
if env.now + delay >= HORIZON:
return
yield env.timeout(delay)
env.process(customer(env.now))
env.process(arrivals())
env.run(until=HORIZON)
The numeric horizon is half-open: normal events scheduled exactly at 480.0 are
not processed. Report unfinished entities rather than silently treating them as
completed observations.
Core semantics
Environment and deterministic ordering
Environment is single-threaded. The queue is ordered by simulation time, event
priority, then a strictly increasing event ID. Same-time, same-priority events are
therefore processed FIFO in scheduling order. Model processes may represent
…
자주 묻는 질문
SimPy에서 '프로세스'는 무엇인가요?
프로세스는 시뮬레이션 시스템에서 일어나는 일련의 행동입니다. 예를 들어 고객이 줄을 서서 기다렸다가 응대를 받는 과정이 여기에 해당합니다.
SimPy는 사건이 언제 일어나는지 어떻게 아나요?
'이벤트 스케줄러'를 사용합니다. 앞으로 일어날 모든 행동을 정리해 올바른 시간 순서대로 실행합니다.
동시에 일어나는 일도 시뮬레이션할 수 있나요?
네, 동시에 일어날 수 있는 여러 사건과 상호작용을 모델링할 수 있습니다. 다만 내부적으로는 질서 있게 하나씩 처리합니다.
상세 정보
작성자의 원본 설명
Builds, inspects, tests, and analyzes bounded process-based discrete-event simulations with SimPy. Use for event scheduling, resource queues, interrupts, monitoring, independent replications, warm-up, and reproducible output analysis.
인기도
- GitHub 스타
- 51k
- 순위
- #3574
- 라이선스
- MIT
- 업데이트
- 2026. 10. 15.
댓글
- …
이 저장소의 다른 스킬
13c-metabolic-flux
51k탄소-13 동위원소 추적 데이터를 사용해 대사 흐름(플럭스)을 추정합니다. 세포 대사와 생화학 경로를 분석할 때 유용합니다.
adaptyv
51kAdaptyv API를 사용해 단백질 특성 분석 실험을 설계합니다. 비용을 추정하고, 서열을 제출하며, 실험실 결과를 확인하는 데 도움이 됩니다.
aeon
51k시계열 데이터에 대해 머신러닝 작업을 수행합니다. 순차 데이터를 분류하고, 예측하고, 이상을 탐지하고, 패턴을 찾을 때 유용합니다.
alphagenome
51k유전 변이에 대해 미리 계산된 게놈 영향을 조회합니다. 변이가 게놈에 주는 영향을 이해하도록 점수와 설명을 제공합니다.
비슷한 스킬
gitcrawl
394k에이전트가 저장된 GitHub 이슈와 풀 리퀘스트 보관본을 검색하고, 중복 항목을 묶고, GitHub에서 현재 상태를 확인하도록 돕습니다.
slacrawl
394k에이전트가 로컬 Slack 보관본에서 메시지를 검색하고 개수를 세며, 보관본이 얼마나 최신인지 확인하고 필요할 때 새로 고치도록 돕습니다.
goplaces
394k에이전트가 Google Places로 장소를 검색하고, 세부 정보와 리뷰를 가져오고, 장소 이름을 확인하며, 스크립트용 JSON을 출력하도록 돕습니다.