How to document simulation with parallel processes?

I use the SimPy module for Python, which performs discrete event modeling. Now the code has become quite large, and several processes are happening in parallel that interact with each other.

What is the best way to show this in terms of documentation? The structures of the class hierarchy do not adequately capture interactions between processes, and almost all automatic generation software focuses on the fact that all the code is effectively inherited from the SimPy module, therefore, for each class, full SimPy documentation is created: /

I suppose something like UML might be useful, but I'm not too good at it. He would have to fix:

  • The processes
  • Developments
  • Queues (including processes awaiting resources ... :)
  • Resources (e.g. arrays that can be filled / emptied, etc. and have a certain capacity)

So basically some neat documentation tools for modeling code?

Greetings

+4
source share
2 answers

UML has state and activity diagrams as well as sequence diagrams. Any of these would be appropriate. A combination of diagrams is usually required.

One state diagram for each feature class. http://en.wikipedia.org/wiki/State_diagram

Operational diagrams or sequence diagrams to display specific interactions or collaboration between objects. http://www.agilemodeling.com/artifacts/activityDiagram.htm http://www.ibm.com/developerworks/rational/library/3101.html

The class diagram is also suitable for displaying the static properties of classes and their relationships. http://en.wikipedia.org/wiki/Class_diagram

The “whole thing” is often difficult to document.

+2
source

Use a combination of diagrams and self-written prose.

IMHO, you do not need to use UML. If something non-UML conveys your message in a clearer / simpler way, use whatever you like.

Also write a brief summary with all the basic concepts so that the reader gets an idea of ​​what the intent of the system is and what are its main components.

Then write more detailed articles about each component and cross-reference other articles.

A series of articles Writing a great documentation by Jacob Kaplan-Moss helped me a lot.

0
source

Source: https://habr.com/ru/post/1334484/


All Articles