Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Both sides next revision
alvis:hdiagrams [2017/01/11 22:37]
marcin removed
— (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. 
- 
-{{:alvis:paged1.png|}} Page D1 with hierarchical agents. 
- 
-{{:alvis:paged2.png|}} Subpage D2 for agent B. 
- 
-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. 
- 
-{{:alvis:paged1s.png|}} Page D1' with agent B replaced with its subpage. 
- 
- 
- 
-===== 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. 
- 
-{{:alvis:rwsystem.png|}} Page //System//. 
- 
-{{:alvis:rwreaders.png|}} Page //Readers//. 
- 
-{{:alvis:rwwriters.png|}} Page //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. 
- 
-{{:alvis:rwhierarchy.png|}} Page hierarchy graph. 
- 
-The result of replacing of agents **Readers** and **Writers** with their subpages is presented 
-in the following figure. 
- 
-{{:alvis:rwflat.png|}} 
- 
- 
- 
- 
-**[[:alvis:manual|Go back]]** 
- 
- 
- 
- 
- 
-