## 3 VirtFogSim: A View of the Simulated Formal Models
### Simulated Computing and Networking Energy Profiles
\(\delta\left(x\right)\) Kronecker's delta (e.g., \(\delta\left(x\right)=1\) for \(x=1\) and \(\delta\left(x\right)=0\), otherwise); and by:
2. \(u_{-1}\left(x\right)\) the unit-step function (e.g., \(u_{-1}\left(x\right)=1\) for \(x>0\) and \(u_{-1}\left(x\right)=0\), otherwise),  
the above considerations lead to the following sum-power-like analytical models for the profiles of the (previously-introduced) computing energies:  
\[ \begin{split}\mathcal{E}_{M}=&\left(\frac{ \mathcal{P}_{CPU-M}^{(IDLE)}}{nc_{M}}\right)\times T_{DAG}\times u_{-1}\left( \sum_{i=1}^{V}\delta\left(x\left(i\right)-1\right)\right)\\ &+\left(\sum_{i=1}^{V}s\left(i\right)\delta\left(x\left(i\right) -1\right)\right)K_{M}\left(1-r_{M}\right)\left(f_{M}\right)^{\gamma M-1},\end{split}  \tag{11a}\]\[ \begin{split}\mathcal{E}_{F}&=\left(\frac{\mathcal{P}_{CPU-C}^{( IDLE)}}{nc_{C}}\right)\times T_{DAG}\times u_{-1}\left(\sum_{i=1}^{V}\delta\left(x \left(i\right)-2\right)\right)\\ &\quad+\left(\sum_{i=1}^{V}s\left(i\right)\delta\left(x\left(i \right)-2\right)\right)K_{C}\left(1-r_{C}\right)\left(f_{C}\right)^{\gamma C-1 },\end{split}  \tag{11b}\] \[ \begin{split}\mathcal{E}_{C}&=\left(\frac{ \mathcal{P}_{CPU-C}^{(IDLE)}}{nc_{C}}\right)\times T_{DAG}\times u_{-1}\left( \sum_{i=1}^{V}\delta\left(x\left(i\right)-2\right)\right)\\ &\quad+\left(\sum_{i=1}^{V}s\left(i\right)\delta\left(x\left(i \right)-2\right)\right)K_{C}\left(1-r_{C}\right)\left(f_{C}\right)^{\gamma C-1 },\end{split}  \tag{11c}\]  
where all the device-depending parameters: \(\mathcal{P}_{CPU}^{(IDLE)}\), \(nc\), \(K\), \(r\), and \(\gamma\) involved in the above energy-profiling relationships are detailed in Table 1, together with their meaning/role and proper measuring units. In order to introduce the energy profiles of the five up/down WiFi, up/down Cellular, and two-way backhaul connections referenced by Equations (7)-(9), let: \(\mathcal{V}_{M\to F}\), \(\mathcal{V}_{F\to M}\), \(\mathcal{V}_{M\to C}\), \(\mathcal{V}_{C\to M}\), and \(\mathcal{V}_{F\leftrightarrow C}\) indicate the volumes (in bit) of data transported (see Figure 1): (i) from Mobile to Fog; (ii) from Fog to Mobile; (iii) from Mobile to Cloud; (iv) from Cloud to Mobile; and (v) exchanged between Fog and Cloud, respectively. Hence, directly from the basic definitions of the adjacency (binary-valued) \(A\triangleq\left[a_{ij}\right]\) and (real-valued) \(D_{a}\triangleq\left[d_{ij}\right]\) connection matrices, featuring the assigned DAG, as well as the task allocation vector \(\vec{x}\) in Equation (1), these volumes may be formally expressed as:  
\[\mathcal{V}_{M\to F} =\left(1+\overline{NF}_{WiFi}\right)\left(\sum_{i,j=1}^{V}a_{ij} \delta\left(x\left(i\right)-1\right)\delta\left(x\left(j\right)\right)d_{ij} \right), \tag{12a}\] \[\mathcal{V}_{F\to M} =\left(1+\overline{NF}_{WiFi}\right)\left(\sum_{i,j=1}^{V}a_{ij} \delta\left(x\left(i\right)\right)\delta\left(x\left(j\right)-1\right)d_{ij} \right),\] (12b) \[\mathcal{V}_{M\to C} =\left(1+\overline{NF}_{CELL}\right)\left(\sum_{i,j=1}^{V}a_{ij} \delta\left(x\left(i\right)-1\right)\delta\left(x\left(j\right)-2\right)d_{ij} \right),\] (12c) \[\mathcal{V}_{C\to M} =\left(1+\overline{NF}_{CELL}\right)\left(\sum_{i,j=1}^{V}a_{ij} \delta\left(x\left(i\right)-2\right)\delta\left(x\left(j\right)-1\right)d_{ij} \right),\] (12d) \[\mathcal{V}_{F\leftrightarrow C} =\left(1+\overline{NF}_{WD}\right)\left(\sum_{i,j=1}^{V}a_{ij} \left(\delta\left(x\left(i\right)-2\right)\delta\left(x\left(j\right)\right) +\delta\left(x\left(i\right)\right)\delta\left(x\left(j\right)-2\right)\right)d _{ij}\right), \tag{12e}\]  
where \(\overline{NF}\) is the average number of failures of the considered connection [22; 23] (see also Table 1) and \(V\) is the number of tasks of the considered DAG.