# 离散事件模拟

离散事件模拟（DES）是一种建模方法，它将系统表示为随机、动态的模型，其状态变量仅在离散时间点上改变取值。<sup>[1](https://www.dmi.unict.it/messina/didat/DES_17_18/chapter1.pdf)</sup> 一次运行会生成系统的事件驱动轨迹，分析人员据此估计资源利用率、等待时间、队列长度、吞吐量、瓶颈和成本等量。<sup>[2](http://www.sce.carleton.ca/faculty/wainer/papers/1-s2.0-S0360835218303693-main.pdf)</sup> 由于到达时间和服务时长等输入是随机的，DES以统计方式回答假设性问题：通过改变患者流模式或服务策略，模型有助于在真实系统实施变更之前进行情景规划。<sup>[3](https://pmc.ncbi.nlm.nih.gov/articles/PMC7278318/)</sup> 自20世纪50年代末以来，DES已发展成为制造业、旅游业、金融和医疗领域最常用的经典运筹学技术之一。<sup>[4](https://www.tandfonline.com/doi/abs/10.1057/palgrave.jors.2602128)</sup>

| 关键事实 | 详情 |
|---|---|
| 模型类别 | 随机、动态；状态仅在离散事件时刻改变<sup>[1](https://www.dmi.unict.it/messina/didat/DES_17_18/chapter1.pdf)</sup> |
| 核心引擎 | 以优先队列实现的未来事件表；时钟从一个事件跳跃到下一个事件 |
| 典型输出 | 利用率、等待时间、队列长度、吞吐量、瓶颈、成本<sup>[2](http://www.sce.carleton.ca/faculty/wainer/papers/1-s2.0-S0360835218303693-main.pdf)</sup> |
| 世界观 | 事件调度、进程交互、活动扫描、三阶段<sup>[5](https://pythonhealthdatascience.github.io/des_rap_book/pages/intros/des.html)</sup> |
| 统计注意事项 | 使用不同随机种子的多次重复运行；预热处理；置信区间<sup>[5](https://pythonhealthdatascience.github.io/des_rap_book/pages/intros/des.html)</sup> |
| 主导领域 | 制造业中最常见的模拟方法<sup>[2](http://www.sce.carleton.ca/faculty/wainer/papers/1-s2.0-S0360835218303693-main.pdf)</sup>；急诊科是医疗保健领域的首要应用场景<sup>[5](https://pythonhealthdatascience.github.io/des_rap_book/pages/intros/des.html)</sup> |
| 并行同步 | 保守式（Chandy–Misra）与乐观式（Time Warp）<sup>[6](https://doi.org/10.1145/358598.358613)</sup><sup> • </sup><sup>[7](https://doi.org/10.1145/3916.3988)</sup> |

## 工作原理

下一事件模拟建立在五个概念之上：系统状态、事件、模拟时钟、事件调度和事件表（日历）。<sup>[8](https://www.dmi.unict.it/messina/didat/DES_17_18/leemis_chapter5.pdf)</sup> 未来事件表（FEL）保存未来事件的事件通知，始终按发生时间排序；在当前时刻\( t \)，已调度时间满足\( t \leq t_{1} \leq t_{2} \leq \cdots \leq t_{n} \)，位于\( t_{1} \)的事件是即将发生的事件；当两个或多个事件共享同一时间戳时，同时事件通常按FEL数据结构返回的顺序执行。<sup>[9](https://www.mi.fu-berlin.de/inf/groups/ag-tech/teaching/2012_SS/L_19540_Modeling_and_Performance_Analysis_with_Simulation/03.pdf)</sup> 该表通常（但并非必然）是以时间戳为键的优先队列。<sup>[8](https://www.dmi.unict.it/messina/didat/DES_17_18/leemis_chapter5.pdf)</sup>

标准循环为：从FEL中取出即将发生的事件通知；将时钟推进到其时间；执行事件，更新状态变量、实体属性和集合；生成后续事件并将其通知放入FEL；更新统计数据。<sup>[9](https://www.mi.fu-berlin.de/inf/groups/ag-tech/teaching/2012_SS/L_19540_Modeling_and_Performance_Analysis_with_Simulation/03.pdf)</sup> 每次状态变化期间时钟冻结，因此相对于模拟时间，变化是瞬时发生的，时间从事件时刻不连续地推进到下一个事件时刻。<sup>[8](https://www.dmi.unict.it/messina/didat/DES_17_18/leemis_chapter5.pdf)</sup>

## 实施方法

模型开发通常描述为六个步骤：构建概念模型、规范模型和计算模型，然后进行验证、确认和实验，其中步骤2至6需多次迭代。<sup>[1](https://www.dmi.unict.it/messina/didat/DES_17_18/chapter1.pdf)</sup> 验证（verification）追问计算模型是否正确实现了规范；确认（validation）追问其是否与被分析的系统相符。一种流行的非统计、类图灵确认技术将实际系统输出与格式相似的模型输出并排放置，请熟悉该系统的专家加以区分。<sup>[1](https://www.dmi.unict.it/messina/didat/DES_17_18/chapter1.pdf)</sup>

输入分析确定有依据的样本量，并对数据拟合分布。<sup>[10](https://link.springer.com/book/10.1007/978-0-85729-139-4)</sup> 到达通常建模为泊松过程，每区间平均\( \lambda \)个事件，到达间隔时间建模为指数分布。在一项对349个医疗保健DES案例的综述中，患者到达主要服从泊松分布，推荐的拟合优度检验为：连续数据用Kolmogorov–Smirnov检验，离散数据用卡方检验，尾部敏感分布用Anderson–Darling检验。<sup>[11](https://www.mdpi.com/2076-3417/15/4/1861)</sup>

输出分析必须考虑每次运行的随机性。需要以不同随机种子进行多次重复运行，以估计平均等待时间等输出的均值、变异性和不确定性。<sup>[5](https://pythonhealthdatascience.github.io/des_rap_book/pages/intros/des.html)</sup> 当模型不是从平衡态开始时，预热期会丢弃有偏的早期观测；MSER和N-Skart等方法从整个样本函数估计预热期。<sup>[12](https://-sage-cnpereading-com-443.webvpn1.xju.edu.cn/doi/10.1177/0037549713508334)</sup> 对于稳态置信区间，重复批均值法——少量重复运行并将观测值分组为批次——在大批量规模下产生有效区间，覆盖率与标准批均值法相当或更好。<sup>[13](https://onlinelibrary.wiley.com/doi/10.1002/nav.20158)</sup>

## 起源

DES最早出现于20世纪50年代末。<sup>[4](https://www.tandfonline.com/doi/abs/10.1057/palgrave.jors.2602128)</sup> 早期里程碑包括J. N. Buxton和J. G. Laski的控制与模拟语言（1962年，《The Computer Journal》）<sup>[14](https://doi.org/10.1093/comjnl/5.3.194)</sup>；[Harry Markowitz](https://www.edgepedia.org/zh/harry-markowitz)、Bernard Hausner和H. W. Karr的SIMSCRIPT报告（1962年，[兰德公司](https://www.edgepedia.org/zh/rand-corporation)），该报告在面向非专家的基于FORTRAN的语言中记录了事件世界观<sup>[15](https://doi.org/10.7249/rm3310)</sup>；R. W. Conway 1963年发表于《Management Science》的论文，将数字模拟的核心问题界定为模型构建和模型分析<sup>[16](https://doi.org/10.1287/mnsc.10.1.47)</sup>；以及[K. D. Tocher](https://www.edgepedia.org/zh/k-d-tocher)的教科书《模拟的艺术》（1964年）。后来的基础性工作包括Richard K. Nance 1971年发表于《Management Science》的时间流机制综述<sup>[17](https://doi.org/10.1287/mnsc.18.1.59)</sup>、James O. Henriksen 1977年改进的事件表算法<sup>[18](https://doi.org/10.5555/800289.811259)</sup>，以及Lee Schruben 1983年的事件图<sup>[19](https://doi.org/10.1145/182.358460)</sup>。

## 变体

**世界观。** DES支持三种基本世界观：活动导向、进程导向和事件导向，它们使用相同的建模原则，可以相互转换。常见的四分法增加了三阶段方法：基于活动（固定时间增量并检查条件）、基于事件（FEL及可变时间推进）、基于进程（每个实体一个进程，如SimPy和simmer），以及三阶段。<sup>[5](https://pythonhealthdatascience.github.io/des_rap_book/pages/intros/des.html)</sup> 在三阶段方法中，活动分为B类活动（必然发生，调度在FEL上）和C类活动（条件性）；阶段A将时钟推进到下一个B类事件，阶段B执行该时刻所有B类事件，阶段C扫描C类活动，从而避免了纯活动扫描中缓慢的重复扫描。<sup>[5](https://pythonhealthdatascience.github.io/des_rap_book/pages/intros/des.html)</sup> 事件图是一种图形化范式，直接对模型的FEL逻辑建模。<sup>[9](https://www.mi.fu-berlin.de/inf/groups/ag-tech/teaching/2012_SS/L_19540_Modeling_and_Performance_Analysis_with_Simulation/03.pdf)</sup>

**事件表数据结构。** 许多模型在管理事件表上花费的CPU时间超过模拟的任何其他方面。<sup>[8](https://www.dmi.unict.it/messina/didat/DES_17_18/leemis_chapter5.pdf)</sup> 候选结构包括数组、链表、树和堆<sup>[9](https://www.mi.fu-berlin.de/inf/groups/ag-tech/teaching/2012_SS/L_19540_Modeling_and_Performance_Analysis_with_Simulation/03.pdf)</sup>；堆排序<sup>[20](https://doi.org/10.1145/512274.3734138)</sup>和二项队列<sup>[21](https://doi.org/10.1145/359460.359478)</sup>是经典的优先队列基础。McCormack和Sargent使用交互保持模型——固定数量更新过程的叠加——分析了未来事件集算法。<sup>[22](https://doi.org/10.1145/358800.358803)</sup>

**并行DES。** 并行和分布式DES的同步机制分为保守式和乐观式。<sup>[23](https://www.informs-sim.org/wsc19papers/150.pdf)</sup> 通过空消息实现的保守同步源自Chandy和Misra 1981年的异步分布式模拟方案。<sup>[6](https://doi.org/10.1145/358598.358613)</sup> 主导的乐观方法是Jefferson 1985年虚拟时间论文中的Time Warp机制。<sup>[7](https://doi.org/10.1145/3916.3988)</sup> 在Time Warp中，每个逻辑进程维护一个本地虚拟时间时钟；一个乱序的滞后事件触发回滚，恢复进程状态并发送反消息以消除错误计算。<sup>[23](https://www.informs-sim.org/wsc19papers/150.pdf)</sup> 最近，统一虚拟时间统一了两种模式：逻辑进程在有前瞻信息时使用不可逆处理程序保守执行，否则使用可逆处理程序乐观执行，逐事件决定。<sup>[24](https://doi.org/10.1145/3505248)</sup>

## 应用

**医疗保健。** DES在卫生服务运营管理中的应用可追溯至20世纪80年代初，一项2017–2021年文献综述在卫生保健系统运营、[疾病进展建模](https://www.edgepedia.org/zh/disease-progression-modeling)、筛查建模和健康行为建模方面识别出933篇不重复的文章。<sup>[25](https://arxiv.org/abs/2211.00061)</sup> 急诊科是旗舰场景，反映了复杂的患者流和资源优化需求。<sup>[11](https://www.mdpi.com/2076-3417/15/4/1861)</sup> 卫生经济建模中DES的良好实践指南来自ISPOR-SMDM建模良好研究实践工作组。<sup>[26](https://doi.org/10.1016/j.jval.2012.04.013)</sup>

**制造业。** DES是应用于制造系统的最常见模拟方法，其使用频率远超其他方法。<sup>[2](http://www.sce.carleton.ca/faculty/wainer/papers/1-s2.0-S0360835218303693-main.pdf)</sup> 一项2025年的综述比较了九个面向生产的程序，发现FlexSim在大多数参数上领先，结合了照片级真实感3D可视化、自动瓶颈检测和开放API。<sup>[27](https://link.springer.com/article/10.1007/s42452-025-08012-y)</sup>

**计算机与电信系统。** 离散事件模拟是Verilog、VHDL和SystemC等硬件描述语言的基础。<sup>[28](https://ptolemy.berkeley.edu/projects/embedded/eecsx44/lectures/Fall2014/wk8-lec2-des.pdf)</sup>

**软件平台。** 在医疗保健领域，主要平台按时间顺序为SIMAN、ExtendSim、Arena和AnyLogic。<sup>[3](https://pmc.ncbi.nlm.nih.gov/articles/PMC7278318/)</sup> Arena在医疗保健案例研究中是主导选择，其次是Simul8，而AnyLogic以结合DES、基于智能体的建模和系统动力学的混合模拟见长。<sup>[11](https://www.mdpi.com/2076-3417/15/4/1861)</sup> 在开源生态系统中，simmer为R提供面向进程的DES。<sup>[29](https://doi.org/10.18637/jss.v090.i02)</sup>

## 局限与替代方案

DES区别于蒙特卡罗模拟——后者是随机的但静态的，状态的时间演化不重要。<sup>[1](https://www.dmi.unict.it/messina/didat/DES_17_18/chapter1.pdf)</sup> 相对于系统动力学（SD）——源自Forrester《工业动力学》的确定性、反馈导向范式<sup>[30](https://doi.org/10.2307/2281677)</sup>——DES需要多次重复运行且数据需求更高，使模型开发和运行相对耗时，而SD模型数据需求低得多，但其聚合和平均流率是显著局限；DES不显式寻求对反馈建模。<sup>[31](https://calhoun.nps.edu/server/api/core/bitstreams/1d97e21e-2f58-4ac0-8a18-8f1762bf5d26/content)</sup><sup> • </sup><sup>[32](https://strathprints.strath.ac.uk/58470/13/Morgan_Howick_Belton_EJOR_2016_mixing_discrete_event_simulation_and_system_dynamics.pdf)</sup> 相对于基于智能体的模拟，DES的实体和资源默认是被动的：它们不能相互交互或展示自适应行为，这使社会行为和决策的表示复杂化。<sup>[2](http://www.sce.carleton.ca/faculty/wainer/papers/1-s2.0-S0360835218303693-main.pdf)</sup> 相对于卫生经济学中的马尔可夫模型，DES的优势在于对有限资源的排队建模、捕捉个体患者病史、灵活的时间表示、竞争风险和同时多事件；其劣势是潜在的过度设定、增加的数据需求、专业昂贵软件，以及更多的开发、确认和计算时间。当排队和供应短缺不是问题的主要驱动因素时，马尔可夫建模仍是高效、易于确认的简约方法。<sup>[33](https://www.cambridge.org/core/journals/international-journal-of-technology-assessment-in-health-care/article/abs/markov-modeling-and-discrete-event-simulation-in-health-care-a-systematic-comparison/DF5D093D76CCD1E507AA514B65AA10E5)</sup>

常见失败模式包括无效的输入分布（通过正式拟合优度检验缓解<sup>[11](https://www.mdpi.com/2076-3417/15/4/1861)</sup>）、验证与确认缺口<sup>[1](https://www.dmi.unict.it/messina/didat/DES_17_18/chapter1.pdf)</sup>、忽略预热时对瞬态行为的误读<sup>[12](https://-sage-cnpereading-com-443.webvpn1.xju.edu.cn/doi/10.1177/0037549713508334)</sup>，以及以固定增量推进时间的实现中的时间步长伪影——模型可能纯粹因步长\( \Delta t \)不同而产生截然不同的结果。<sup>[31](https://calhoun.nps.edu/server/api/core/bitstreams/1d97e21e-2f58-4ac0-8a18-8f1762bf5d26/content)</sup>

一项2025年的科学映射研究将数字孪生技术、人工智能和生成式AI确定为近年来与DES集成的关键技术：DES作为底层引擎使数字孪生能够响应实时数据，而GenAI集成提出了从文本提示生成模拟模型的可能性。<sup>[34](https://www.mdpi.com/2073-8994/17/8/1272)</sup>

## References

1. [Chapter 1: Models (Leemis & Park, Discrete-Event Simulation: A First Course)](https://www.dmi.unict.it/messina/didat/DES_17_18/chapter1.pdf)
2. [An introductory guide for hybrid simulation modelers on the primary simulation methods in industrial engineering identified through a systematic review of the literature (Computers & Industrial Engineering)](http://www.sce.carleton.ca/faculty/wainer/papers/1-s2.0-S0360835218303693-main.pdf)
3. [The Diffusion of Discrete Event Simulation Approaches in Health Care Management in the Past Four Decades: A Comprehensive Review](https://pmc.ncbi.nlm.nih.gov/articles/PMC7278318/)
4. [Forty years of discrete-event simulation, a personal reflection (Brian W. Hollocks, Journal of the Operational Research Society, Vol 57, No 12, 2006)](https://www.tandfonline.com/doi/abs/10.1057/palgrave.jors.2602128)
5. [Discrete-event simulation (DES) – DES RAP](https://pythonhealthdatascience.github.io/des_rap_book/pages/intros/des.html)
6. [K. M. Chandy, J. Misra (1981). Asynchronous distributed simulation via a sequence of parallel computations. Communications of the ACM.](https://doi.org/10.1145/358598.358613)
7. [David R. Jefferson (1985). Virtual time. ACM Transactions on Programming Languages and Systems.](https://doi.org/10.1145/3916.3988)
8. [Chapter 5: Next-Event Simulation (Leemis & Park, Discrete-Event Simulation: A First Course)](https://www.dmi.unict.it/messina/didat/DES_17_18/leemis_chapter5.pdf)
9. [General Principles of Discrete-Event Simulation (FU Berlin lecture slides)](https://www.mi.fu-berlin.de/inf/groups/ag-tech/teaching/2012_SS/L_19540_Modeling_and_Performance_Analysis_with_Simulation/03.pdf)
10. [Introduction to Discrete Event Simulation and Agent-based Modeling (Theodore T. Allen, Springer, 2011)](https://link.springer.com/book/10.1007/978-0-85729-139-4)
11. [Systematic Review of Discrete Event Simulation in Healthcare and Statistics Distributions (MDPI Applied Sciences, 2025)](https://www.mdpi.com/2076-3417/15/4/1861)
12. [Factors affecting warm-up periods in discrete event simulation (Grassmann, Simulation, 2013)](https://-sage-cnpereading-com-443.webvpn1.xju.edu.cn/doi/10.1177/0037549713508334)
13. [Replicated batch means for steady-state simulations (Naval Research Logistics, 2006)](https://onlinelibrary.wiley.com/doi/10.1002/nav.20158)
14. [J. N. Buxton, J. G. Laski (1962). Control and Simulation Language. The Computer Journal.](https://doi.org/10.1093/comjnl/5.3.194)
15. [Markowitz, Harry Max, Hausner, Bernard, Karr, H. W. (1962). SIMSCRIPT: A Simulation Programming Language. RAND Corporation eBooks.](https://doi.org/10.7249/rm3310)
16. [R. W. Conway (1963). Some Tactical Problems in Digital Simulation. Management Science.](https://doi.org/10.1287/mnsc.10.1.47)
17. [Richard K. Nance (1971). On Time Flow Mechanisms for Discrete System Simulation. Management Science.](https://doi.org/10.1287/mnsc.18.1.59)
18. [James O. Henriksen (1977). An improved events list algorithm. NCSU Libraries Repository (North Carolina State University Libraries).](https://doi.org/10.5555/800289.811259)
19. [Lee Schruben (1983). Simulation modeling with event graphs. Communications of the ACM.](https://doi.org/10.1145/182.358460)
20. [J.W.J. Williams (1964). Algorithm 232: Heapsort. Communications of the ACM.](https://doi.org/10.1145/512274.3734138)
21. [Jean Vuillemin (1978). A data structure for manipulating priority queues. Communications of the ACM.](https://doi.org/10.1145/359460.359478)
22. [William M. McCormack, Robert G. Sargent (1981). Analysis of future event set algorithms for discrete event simulation. Communications of the ACM.](https://doi.org/10.1145/358800.358803)
23. [Time Warp Simulation on Multi-core Platforms](https://www.informs-sim.org/wsc19papers/150.pdf)
24. [David R. Jefferson, Peter Barnes (2022). Virtual Time III, Part 1: Unified Virtual Time Synchronization for Parallel Discrete Event Simulation. ACM Transactions on Modeling and Computer Simulation.](https://doi.org/10.1145/3505248)
25. [Discrete-Event Simulation in Healthcare Settings: a Review](https://arxiv.org/abs/2211.00061)
26. [Jonathan Karnon and colleagues (2012). Modeling using Discrete Event Simulation: A Report of the ISPOR-SMDM Modeling Good Research Practices Task Force-4. Value in Health.](https://doi.org/10.1016/j.jval.2012.04.013)
27. [Simulation software for smart manufacturing: a review (Discover Applied Sciences, 2025)](https://link.springer.com/article/10.1007/s42452-025-08012-y)
28. [EE 144/244: Discrete Event Simulation (Stavros Tripakis, UC Berkeley)](https://ptolemy.berkeley.edu/projects/embedded/eecsx44/lectures/Fall2014/wk8-lec2-des.pdf)
29. [Iñaki Ucar, Bart Smeets, Arturo Azcorra (2019). simmer: Discrete-Event Simulation for R. Journal of Statistical Software.](https://doi.org/10.18637/jss.v090.i02)
30. [J. W. P., Jay W. Forrester (1962). Industrial Dynamics.. Journal of the American Statistical Association.](https://doi.org/10.2307/2281677)
31. [Cross-paradigm simulation modeling: Challenges and successes (Heath, Brailsford, Buss, Macal, WSC 2011)](https://calhoun.nps.edu/server/api/core/bitstreams/1d97e21e-2f58-4ac0-8a18-8f1762bf5d26/content)
32. [A toolkit of designs for mixing Discrete Event Simulation and System Dynamics (Morgan, Howick, Belton, EJOR 2016)](https://strathprints.strath.ac.uk/58470/13/Morgan_Howick_Belton_EJOR_2016_mixing_discrete_event_simulation_and_system_dynamics.pdf)
33. [Markov modeling and discrete event simulation in health care: a systematic comparison](https://www.cambridge.org/core/journals/international-journal-of-technology-assessment-in-health-care/article/abs/markov-modeling-and-discrete-event-simulation-in-health-care-a-systematic-comparison/DF5D093D76CCD1E507AA514B65AA10E5)
34. [Computer Simulation Everywhere: Mapping Fifteen Years Evolutionary Expansion of Discrete-Event Simulation and Integration with Digital Twin and Generative Artificial Intelligence (MDPI Symmetry, 2025)](https://www.mdpi.com/2073-8994/17/8/1272)

---
*Initially written Sep 29, 2026 · Edited: Oct 15, 2026; Oct 21, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 人工智能与数据 › Algorithms and computational methods

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/discrete-event-simulation

English original: https://www.edgepedia.org/discrete-event-simulation
