## 3 VirtFogSim: A View of the Simulated Formal Models
### Simulated Profiles of the per-DAG and per-Task Execution Times  
The analytical expression assumed by \(T_{DAG}\) in Equation (4b) depends on the vectors \(\overrightarrow{RS}\), \(\vec{x}\), as well as the adopted inter-node Task Scheduling and intra-node Task Service disciplines. The current implementation of _VirtFogSim_ assumes that the adopted Task Scheduling discipline over the computing nodes and the adopted Task Service discipline at each computing node are both of the _sequential_ type. They are, indeed, the Task Scheduling and Task Service disciplines currently adopted by a number of middleware software tools for the support of mobile computing, such as MAUI, Volare, Cuckoo, and CloneCloud (see, for example, [24; 25] and the references therein for an overview of state-of-the-art middleware solutions for the support of computing-intensive smartphone-based applications).  
As direct consequence, the following sum expression holds for the analytical profile of \(T_{DAG}\):  
\[T_{DAG}=\sum_{i=1}^{V}\left(\delta\left(x\left(i\right)-1\right)T_{M}\left(i \right)+\delta\left(x\left(i\right)\right)T_{F}\left(i\right)+\delta\left(x \left(i\right)-2\right)T_{C}\left(i\right)\right), \tag{17}\]  
where \(T_{M}\left(i\right)\), \(T_{F}\left(i\right)\), and \(T_{C}\left(i\right)\) are the total execution times of the \(i^{\text{th}}\) task of the considered DAG when it is executed at the Mobile, Fog, and Cloud node, respectively.  
In this regard, two main remarks are in order. First, each total execution time \(T_{N}\left(i\right),\,N\in\left\{M,F,C\right\}\), in Equation (17), is, by design, the summation of two terms. The first term is the computing time (e.g., the service time): \(T_{N}^{SER}\left(i\right),\,N\in\left\{M,F,C\right\}\), wasted for the processing of the \(i^{\text{th}}\) task at the computing node \(N\), while the second term is the communication delay: \(T_{N}^{NET}\left(i\right),\,N\in\left\{M,F,C\right\}\), induced by the transport from the other two computing nodes of the input data needed for the processing of the \(i^{\text{th}}\) task at the computing node \(N\). Second, when a set of tasks is processed by the same computing node, the resulting overall communication delay is, by design, zero [23; 26; 27].  
Therefore, according to these two remarks, the following analytical expressions hold for the profiles of the per-node execution times in Equation (17):\[\begin{split} T_{M}\left(i\right)&=T_{M}^{SER}\left(i \right)+T_{M}^{NET}\left(i\right)=\left(\frac{\sum_{j=1}^{V}s\left(j\right) \delta\left(x\left(j\right)-1\right)}{n_{M}f_{M}}\right)\\ &+\left[\left(1+\overline{NF}_{WiFi}\right)\left(\frac{\sum_{j=1 }^{V}a_{ji}d_{ji}\delta\left(x\left(j\right)\right)}{R_{D}}\right)+\left(1+ \overline{NF}_{CELL}\right)\left(\frac{\sum_{j=1}^{V}a_{ji}d_{ji}\delta\left( x\left(j\right)-2\right)}{B_{D}}\right)\right],\end{split} \tag{18a}\] \[\begin{split} T_{F}\left(i\right)&=T_{F}^{SER} \left(i\right)+T_{F}^{NET}\left(i\right)=\left(\frac{\sum_{j=1}^{V}s\left(j \right)\delta\left(x\left(j\right)\right)}{n_{F}f_{F}}\right)\\ &+\left[\left(1+\overline{NF}_{WiFi}\right)\left(\frac{\sum_{j=1 }^{V}a_{ji}d_{ji}\delta\left(x\left(j\right)-1\right)}{R_{U}}\right)+\left( \frac{\sum_{j=1}^{V}a_{ji}d_{ji}\delta\left(x\left(j\right)-2\right)}{R_{0}} \right)\right],\end{split}\] (18b) \[\begin{split} T_{C}\left(i\right)&=T_{C}^{SER} \left(i\right)+T_{C}^{NET}\left(i\right)=\left(\frac{\sum_{j=1}^{V}s\left(j \right)\delta\left(x\left(j\right)-2\right)}{n_{C}f_{C}}\right)\\ &+\left[\left(1+\overline{NF}_{CELL}\right)\left(\frac{\sum_{j=1 }^{V}a_{ji}d_{ji}\delta\left(x\left(j\right)-1\right)}{B_{U}}\right)+\left( \frac{\sum_{j=1}^{V}a_{ji}d_{ji}\delta\left(x\left(j\right)\right)}{R_{0}} \right)\right],\end{split} \tag{18c}\]  
where \(i=1,\ldots,V\) and \(n_{M}\), \(n_{F}\), and \(n_{C}\) are the number of cores equipping the Mobile, Fog, and Cloud nodes, respectively (see Table 10).