# Accelerated Simulation of Discrete Event Dynamic Systems via a Multi-Fidelity Modeling Framework +
## 4 Proposed Framework
### Multi-Fidelity Model Composition and Target Model Substitution
#### 4.3.2 Multi-Fidelity Model Composition for Discrete Event System  
The structure of the multi-fidelity model of the discrete event system is shown in Figure 11. All the models in the \(MFM_{DES}\) are designed with the DEVS formalism [18]. Unlike the DTSS model, the DEVS model can be executed regardless of whether it receives an input event or not. Thus, the \(MFM_{DES}\) has an additional output event \(M_{i}.Stop\) to stop the execution of the current internal model \(M_{i}\) when another internal model needs to be activated. If the current model receives the input event \(M_{i}.Stop\), it enters the STOP state, which is an additional state in which the state time is infinite, and waits for the next activation. When the \(M_{i}\) receives the activate event afterward \(M_{i}.Activate\), the \(M_{i}\) returns to the previous state before it is deactivated \(State_{Origin}\). The specification is a formal representation of the selection model \(SM_{DES}\). \(SM_{DES}=\langle X,Y,S,FCC,sf,\ \delta_{ext},\ \delta_{int},\ \lambda,\ ta\rangle\)  
\(X=\{X_{in}\}\cup\{\mathrm{U}_{i=1}^{n}M_{i}.State\}\) is the set of inputs;  
\(M_{i}.State\) is the current state input of internal model \(M_{i}\);  
\(Y=\{\mathrm{U}_{i=1}^{n}M_{i}.X_{in}\}\cup\{\mathrm{U}_{i=1}^{n}M_{i}.Activate\} \cup\{\mathrm{U}_{i=1}^{n}M_{i}.Stop\}\) is the set of outputs;  
\(M_{i}.X_{in}\) is the bypassing output of \(M_{i}\);  
\(M_{i}.Activate\) is the activate output of \(M_{i}\);  
\(M_{i}.Stop\) is the stop output of \(M_{i}\). \(S=\{\mathrm{U}_{i=1}^{n}M_{i}.WAIT\}\cup\{\mathrm{U}_{i=1}^{n}M_{i}.CHECK\}\cup\{ \mathrm{U}_{i=1}^{n}M_{i}.ACTIVATE\}\cup\{\mathrm{U}_{i=1}^{n}M_{i}.CHANGE\}\)\(FCC=\{(v,\ r)\ |\ v\in IRV,\ r\in R\}\) is the set of fidelity change conditions. \(sf:(M_{i}.CHECK,\ FCC)\to M_{i}.WAIT;\)  
\((M_{i}.CHECK,\ FCC)\to M_{i}.ACTIVATE;\)  
\(\delta_{ext}:(X_{in},\ M_{i}.WAIT)\to M_{i}.CHECK;\)  
\((M_{i}.State,\ M_{i}.WAIT)\to M_{i}.WAIT;\)  
\(\delta_{int}:M_{i}.ACTIVATE\to M_{i}.CHANGE;\)  
\(M_{i}.CHANGE\to M_{i}.WAIT;\)  
\(\lambda:M_{i}.ACTIVATE\to M_{i}.Activate;\)  
\(M_{i}.CHANGE\to M_{i}.X_{in};\)  
\(M_{i}.CHECK\to M_{i}.X_{in};\)  
\(M_{i}.CHECK\to M_{i}.Stop;\)  
\(ta:M_{i}.WAIT\to\infty;\)  
\(\{M_{i}.CHECK,\ M_{i}.ACTIVATE,\ M_{i}.CHANGE\}\to 0.\)  
Except for the stop event, the input and output sets of the \(SM_{DES}\) are identical to those of the \(SM_{DS}\). The \(SM_{DES}\) has two sets of states (i.e., \(FCC\) and \(S\)). The \(FCC\) is the same as that of \(SM_{DS}\), whereas the \(S\) is slightly different. In the \(SM_{DES}\), the \(S\) is mapped to four phase sets--\(M_{i}.WAIT\), \(M_{i}.CHECK\), \(M_{i}.ACTIVE\), and \(M_{i}.CHANGE\). Unlike the \(SM_{DS}\), two important roles of \(SM_{DES}\) are conducted by a series of phase transitions. The basic phase is \(M_{i}.WAIT\), assuming that the current internal model is \(M_{i}.\) When the \(SM_{DES}\) receives the input event \(X_{in}\) from the \(M_{i}\), it moves the phase into \(M_{i}.CHECK\) and checks whether the activated model is changed to the \(M_{j}\) based on the \(sf\) and the \(FCC\). As in the first case, if the current internal model \(M_{i}\) needs to remain active, the \(SM_{DES}\) changes its phase to \(M_{i}.WAIT\) and forwards the received input \(X_{in}\) to the \(M_{i}\). In another case, if the \(M_{i}\) needs to be changed, the \(SM_{DES}\) moves the phase to \(M_{j}.ACTIVE\)--according to the next activation model, \(M_{j}\)--and sends the stop event \(M_{i}.Stop\) to the \(M_{i}\). Then, the \(SM_{DES}\) moves the phase to \(M_{j}.CHANGE\) to send the activation event \(M_{j}.Activate\) to the \(M_{j}\). Finally, the phase of the \(SM_{DES}\) changes to \(M_{j}.WAIT\), and \(SM_{DES}\) sends the \(X_{in}\) to the current internal model \(M_{j}\). In either case, the \(SM_{DES}\) receives the state information from the current activated model and waits until another input \(X_{in}\) arrives.