Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionBoth sides next revision | ||
alvis:hdiagrams [2013/12/29 20:13] marcin | — (current) | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Hierarchical communication diagrams ====== | ||
- | |||
- | For the effective modelling, Alvis communication diagrams enable distributing parts of a diagram across multiple subdiagrams called **pages**. Pages are combined using the so-called **substitution mechanism**. An agent on one level can be replaced by a page on the lower level. Such a substituted agent is called **hierarchical** one. On the other hand, a part of a communication diagram can be treated as a module and represented by a single agent on a higher level. Thus, communication diagrams support both **top-down** and **bottom-up** approaches. | ||
- | |||
- | ===== Simple substitution ===== | ||
- | |||
- | The substitution mechanism is based on a **binding function** π that maps ports of a hierarchical agent to ports with the same names (called **join ports**) on the corresponding page. If the function is a bijection the substitution is called a **simple** one. | ||
- | |||
- | {{: | ||
- | |||
- | {{: | ||
- | |||
- | A hierarchical agent can be replaced with its subpage using the following algorithm (for the considered example): | ||
- | - Remove the agent B from the page D1 with all its connections. | ||
- | - Move the contents of the page D2 onto the page D1. | ||
- | - Add connections - If after removing of the agent B, from the page D1, it has been removed a connection between ports B.a (port a of agent B) and X.p, then we add a connection between ports X.p and π(B.a) with the same direction as the removed one. | ||
- | |||
- | {{: | ||
- | |||
- | |||
- | |||
- | ===== Extended substitution ===== | ||
- | |||
- | A port of a hierarhical agent may have assigned more than one join port on the subpage. In such a case the binding function π is not a bijection and the substitution is called an **extended** one. Of course all join ports that are connected with a port of the corresponding hierarchical agent must have the same names, and thus they must belong to different agents. | ||
- | |||
- | |||
- | The following figures present the communication diagram for a model of the well-known readers-writers problem. | ||
- | We have two kinds of agents called **readers** and **writers** respectively that use a shared resource called **library** here. At most, one writer can use the library at any time, but a few readers can use it at the same time. The considered model contains four readers and two writers. | ||
- | |||
- | {{: | ||
- | |||
- | {{: | ||
- | |||
- | {{: | ||
- | |||
- | |||
- | To present the way such pages are connected the so-called **page hierarchy graph** is used. Edges of a page hierarchy graph are labelled with names of hierarchical agents, while nodes represent pages in the corresponding model. The **System** node represents the top level page (so-called primary page) of the considered model. If a hierarchical communication diagram contains only one primary page it is a tree. Otherwise, it is a forest. | ||
- | |||
- | {{: | ||
- | |||
- | The result of replacing of agents **Readers** and **Writers** with their subpages is presented | ||
- | in the following figure. | ||
- | |||
- | {{: | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||