Reference Guide 7: Hierarchical Dynamic Structure
Dynamic structure is an important capability, related to hierarchical structure, for simulating complex systems. One form of structure change is an autonomous transformation in which a single component changes from one structural state to another. When the problem calls for creation, destruction, or modification of components during simulation runs, a much more complex situation occurs. In fact, two levels of the dynamic structure can be developed in which each level is a modular, hierarchical component in the DEVS environment. The lower level represents the current structure of a model, while the upper level is the decision-maker directing the structural change. The basic 2 level dynamic structure can be hierarchically expanded to a multi-level dynamic structure. The control of multi-level dynamic structure then can be transferred to the decision-maker of each level. Therefore, the multi-level dynamic structure can be easily built on the hierarchical structure.
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.
Figure 22 Dynamic structure : move sideward case
block *blk = new block(“blk”);
block *blk1 = new block(“blk1”);
block *blk2 = new block(“blk2”);
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);
// in variable_structure function
element * e12 = blk1->remove(c12);
An example of variable structure is available at http://www-ais.ece.arizona.edu/