简体   繁体   English

如何用并行过程记录模拟?

[英]How to document simulations with parallel processes?

I've been using the SimPy module for Python - that does Discrete Event Simulations. 我一直在使用适用于Python的SimPy模块-执行离散事件模拟。 Now, the code has gotten fairly large now and there are quite a few processes occurring in parallel that interact with one another. 现在,代码已经变得相当庞大,并且有许多并行发生的进程彼此交互。

How is the best way to show this in terms of documenting? 用文件证明这一点的最佳方法是什么? Class hierarchy structures don't adequately capture the interactions between the processes, and almost all auto-generation software gets stuck on the fact that all the code is effectively inheriting from the SimPy module, so a full SimPy documentation is generated for each class :/ 类层次结构不能充分捕获流程之间的交互,并且几乎所有自动生成软件都陷于这样一个事实,即所有代码都有效地继承自SimPy模块,因此为每个类生成了完整的SimPy文档:/

I imagine something like UML could be of use, but I'm not too clued up on that. 我想像UML这样的东西可能有用,但是我对此不太了解。 It would need to capture: 它需要捕获:

  • Processes 工艺流程
  • Events 大事记
  • Queues (including Processes waiting for resources...:) 队列(包括等待资源的进程... :)
  • Resources (like arrays that can be populated/depopulated etc. and have a certain capacity) 资源(如可以填充/填充的数组等,具有一定的容量)

So basically, any neat simulation code documenting tools? 那么,基本上,有没有简洁的仿真代码记录工具?

Cheers 干杯

The UML has state diagram and activitiy diagrams as well as sequence diagrams. UML具有状态图和活动图以及序列图。 Any of these would be appropriate. 这些中的任何一个都是合适的。 Usually, a combination of diagrams is required. 通常,需要组合图。

One state diagram for each class of objects. 每个对象类别都有一个状态图。 http://en.wikipedia.org/wiki/State_diagram http://en.wikipedia.org/wiki/State_diagram

Activity diagrams or sequence diagrams to show specific interactions or collaborations among objects. 活动图或序列图,用于显示对象之间的特定交互或协作。 http://www.agilemodeling.com/artifacts/activityDiagram.htm http://www.ibm.com/developerworks/rational/library/3101.html http://www.agilemodeling.com/artifacts/activityDiagram.htm http://www.ibm.com/developerworks/rational/library/3101.html

A class diagram is also appropriate to show static features of the classes and their relationships. 类图也适合于显示类的静态特征及其关系。 http://en.wikipedia.org/wiki/Class_diagram http://en.wikipedia.org/wiki/Class_diagram

The "whole thing" is often difficult to document. “整体”通常难以记录。

Use a combination of Diagrams and self-written prose. 结合使用图表和自写的散文。

Imho, you don't need to use UML. 恕我直言,您不需要使用UML。 If something non-UML transports your message in a clearer/simpler way, use whatever you like. 如果某些非UML以更清晰/更简单的方式传达您的消息,请使用您喜欢的任何东西。

Also write a short summary with all the basic concepts so that the reader gets a genereal idea what the intention of the system is and what its main components are. 还要写一个简短的摘要,其中包含所有基本概念,以使读者有个通俗的想法,系统的意图是什么,系统的主要组成部分是什么。

Then write more detailed articles about each component and cross-reference ot other articles. 然后写有关每个组件的更详细的文章,并交叉引用其他文章。

The article series Writing Great Documentation by Jacob Kaplan-Moss helped me a lot. Jacob Kaplan-Moss 撰写的文章系列写作卓越文档对我有很大帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM