8 Test Operations
8.1
Control Flow of DEVS
Figure
23 Control Flow of DEVS
Figure 23 represents control flow of DEVS-C++. At the beginning, the
user creates appropriate models, inserting components into coupled models,
and adding coupling information. After initializing the system, messages
from outside of the system are inserted by injection. The DEVS cycle in
figure 12 is then executed.
8.2
Initialize Operation
During initialization, timing variables are set. Last time variable (tL)
is set to zero, and next time variable (tN) is set to infinity.
After that, the hierarchical structure is constructed.
8.3
Inject Operation
To insert input to a model, the inject command inserts a message and calls
wrap_deltext method with zero elapsed time. In deltext()
of the coupled model, convert_input() and tellall_wrap_deltext()
methods are executed. Descending, the structure hierarchy, eventually wrap_dext()
method of the atomic model with the component's mailbox (comp_input[i])
information calls the deltext method. After changing the state of
the atomic model, the time advance function is executed.
Figure 24 Inject
Operation of Digraph Model