Figure
21 hierarchical dynamic movement
Figure 21 shows the three types of movement--move upward, move downward, and move sideward. On the other hand, a hierarchical structure--a tree structure for building dynamic structure--is a modular construction in which components are coupled together to form larger ones in order or one above another.
Figure 22 depicts a detailed example of a sidward dynamic structure. Figures 22-a and 22-c represent a block diagram and a decomposition tree before the moving event, while Figures 22-b and 22-d are after the moving event. A block class, blk, has two block components: blk1 and blk2. Blk1 has 2 cells which addresses are (1,1) and (1,2), while blk2 has also 2 cells (1,3) and (1,4) respectively. Whenever a model moves from a source block to a destination block, it is removed from the components list of the source block and is added to the components list of the destination block. In this case, if the address of the model is in the boundary of a block, each size variable of ancestor blocks of the source block is decreased by removing the component, while that of ancestor blocks of the destination block is increased by adding the components. The following codes show a simple example of move sideward case in Figure 22.
cell *c11 = new cell("c11", 1, 1);
cell *c12 = new cell("c12", 1, 2);
cell *c13 = new cell("c13", 1, 3);
cell *c14 = new cell("c14", 1, 4);
blk1->add(c11);
blk1->add(c12);
blk2->add(c13);
blk2->add(c14);
// in variable_structure function
element * e12 = blk1->remove(c12);
blk2->add(e12);