happy-sim-explain-example
Walk through a library example with detailed explanation
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Walk through a library example with detailed explanation
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Run ruff linter and formatter on the project
Add observability (probes, trackers, charts) to a simulation
Analyze simulation results and provide insights
Help choose the right happysimulator components for a use case
Troubleshoot a broken or misbehaving simulation
Generate a complete simulation from a high-level description
| name | happy-sim-explain-example |
| description | Walk through a library example with detailed explanation |
Walk through a happysimulator example file, explaining how it works section by section.
m_m_1_queue.py — Classic M/M/1 queue with metastable failure demonstrationmetastable_state.py — True metastable failure with retrying client feedback loopretrying_client.py — Retry amplification causing sustained overloadincreasing_queue_depth.py — Stable vs unbounded queue growth under load rampdual_path_queue_latency.py — Fast/slow path routing with queue-depth awarenessload_aware_routing.py — Least-connections and weighted load distributiongc_caused_collapse.py — GC pauses triggering queue collapseraft_leader_election.py — Raft leader election, heartbeats, log replicationpaxos_consensus.py — Single-decree Paxos (Prepare/Promise, Accept/Accepted)flexible_paxos_quorums.py — Flexible Paxos with asymmetric quorumscrdt_convergence.py — GCounter eventual consistency after partitionchain_replication.py — Chain replication for strong consistencyprimary_backup_replication.py — Primary-backup with sync/async modesmulti_leader_replication.py — Multi-leader with conflict resolutiondistributed_lock_fencing.py — Distributed lock with fencing tokensswim_membership.py — SWIM gossip-based failure detectiondns_cache_storm.py — DNS cache expiration thundering herdtcp_congestion.py — TCP congestion control (Reno, Cubic, BBR)degraded_network.py — Impact of latency/loss on distributed performancebank_branch.py — Balking/reneging customers, shift-based staffingmanufacturing_line.py — Assembly line with conveyor, inspection, rework loophospital_er.py — ER triage with priority queuingcall_center.py — IVR routing, agent skills, abandonmentcoffee_shop.py — Order queue, barista stations, drink preprestaurant.py — Host stand, tables, kitchen, meal courseswarehouse_fulfillment.py — Order picking, packing, shipping zonessupply_chain.py — Multi-tier with inventory policiestheme_park.py — Attractions, FastPass, visitor routingairport_terminal.py — Security, check-in, boarding gatescar_wash, drive_through, grocery_store, hotel_operations, laundromat, parking_lot, pharmacy, blood_bank, elevator_system, urgent_carecpu_scheduling.py — FairShare vs PriorityPreemptive schedulingdisk_io_contention.py — Read/write queue prioritypage_cache_eviction.py — LRU/LFU eviction policiesconsumer_group.py — Kafka-style partition assignmentevent_log.py — Segment compaction, log-structured storagestream_processor.py — Windowing, aggregation, backpressurejob_scheduler_dag.py — DAG dependency resolutionbtree_vs_lsm.py — B-tree vs LSM read/write tradeoffslsm_compaction.py — Size-tiered vs leveled compactionwal_sync_policies.py — WAL sync (every write, batch, async)memtable_flush.py — Flush policies and write latency spikessstable_bloom_filter.py — Bloom filter effectivenesstransaction_isolation.py — MVCC isolation levelspower_outage_durability.py — WAL crash recoverycanary_deployment.py — Progressive traffic shift with rollbackrolling_deployment.py — Sequential server updatessaga_failure_cascade.py — Distributed transaction compensationservice_mesh_sidecar.py — Sidecar proxy with circuit breakinggc_pause_cascade.py — GC strategy impact on tail latencyidempotency_under_retries.py — Idempotency tokens under retry stormsoutbox_relay_lag.py — Outbox pattern relay lagauto_scaler.py — Scale-up/down policies with cooldownapi_gateway_bottleneck.py — Per-route rate limitingcold_start.py — Serverless cold start with warm poolinductor_burst_suppression.py — EWMA burst smoothingwork_stealing_pool.py — Work-stealing thread poolzipf_cache_cohorts.py — Cache behavior under Zipf accessmetric_collection_pipeline.py — Metrics buffering and batchingai_analysis.py — LLM-driven simulation analysisproduct_adoption.py — Innovator/majority adoption with social influenceopinion_dynamics.py — DeGroot convergence and bounded-confidence clusteringadverse_advertising_amplification.py — Negative advertising amplificationconsistent_hashing_basics.py — Consistent hashing vs round-robin cache affinityfleet_change_comparison.py — Hashing during server additions/removalsvnodes_analysis.py — Virtual node count impact on load distributionzipf_effect.py — Zipf patterns with consistent hashingvisual_debugger.py — Bursty M/M/1 with browser visualizationIf no example is specified, show the categories above and ask the user which one interests them.
Read the chosen example file completely.
Explain the example in these sections:
Overview — What system is being simulated and why it's interesting (2-3 sentences).
Architecture — What entities exist, how they connect, and how events flow through the pipeline. Mention which happysimulator components are used (e.g., QueuedResource, Source.poisson(), Network).
Key Patterns — Highlight interesting library patterns used:
yield delay, yield delay, [events], yield future)What to Watch For — What the output/plots demonstrate. What insight does this example teach? (e.g., "Notice how the queue recovers from the spike in the stable case but collapses in the metastable case")
Optionally run the example if the user wants to see the output:
python examples/<category>/<name>.py
Suggest related examples the user might want to explore next.