## 6 VirtFogSim in Action: Testing Its Numerical Capabilities
### Comparative Tracking Performance under Intermittent WiFi Connectivity  
The goal of this section is to test the convergence speed to the steady-state and the steady-state stability of the primal-dual iterations implemented by the _RAP_p_ function of Section 4.4 when abrupt changes of the available WiFi up/down bandwidths and task allocation patterns simultaneously happen. For this purpose, we run the _FogTracker_ function of Section 4.4 at \(T_{DAG}=0.3\) under the (previously-described) three test DAGs. The obtained dynamic behaviors of the total consumed energies \(\mathcal{E}_{TOT}\), network energies \(\mathcal{E}_{NET}\), and _lambda_ multipliers are reported in Figure 7a-c (resp., Figures 8a-c and 9a-c) for various test values of the speed-up factor \(a_{MAX}\) of Section 3.5 under DAG1 (resp., DAG2 and DAG3). All the reported time behaviors refer to a common application scenario under which both task allocation patterns and up/down WiFi bandwidths undergo simultaneous abrupt changes at the iteration indexes \(t=1\), 1000, 2000, 3000, and 4000 (see the corresponding step-like jumps of the plots of Figures 7-9). These changes are typically triggered by device mobility, which may give rise to an _intermittent_ availability of the WiFi connectivity. More in detail, we have that: (i) at \(t=1\), the up/down cellular (resp., WiFi) bandwidths are turned ON (resp., turned OFF), and all tasks are allocated to the Cloud node; (ii) at \(t=1000\), the up/down WiFi bandwidths are turned ON, and all tasks are allocated to the Mobile node; (iii) at \(t=2000\), the WiFi bandwidths are still turned OFF, and all tasks are re-allocated to the Cloud node; (iv) at \(t=3000\), the up/down WiFi bandwidths are turned ON once time, and all tasks are allocated to the Fog node; and, finally, (v) at \(t=4000\), the up/down WiFi bandwidths are definitively turned OFF, and all tasks are re-migrated to the Cloud node. After each change of the setup environment, the _RAP_p_ function runs, in order to re-allocate both the per-clone computing frequencies at the Mobile-Fog-Cloud nodes and the corresponding up/down Cellular-WiFi bandwidths properly. Figure 7: Tracking performance under DAG1 for three values of the speed-factor \(a_{MAX}\). (**a**) time behaviors of the total energy \(\mathcal{E}_{TOT}\); (**b**) time behaviors of the corresponding network energy \(\mathcal{E}_{NET}\); and (**c**) time behaviors of the \(\lambda\) multiplier. An examination of the time-plots reported in Figures 7-9 leads to three main insights. First, even in the presence of the (aforementioned) abrupt changes of the operating setups, the corresponding  
Figure 8: Tracking performance under DAG2 for three values of the speed-factor \(a_{MAX}\). (**a**) time behaviors of the total energy \(\mathcal{E}_{TOT}\); (**b**) time behaviors of the corresponding network energy \(\mathcal{E}_{NET}\); and (**c**) time behaviors of the \(\lambda\) multiplier. Figure 9: Tracking performance under DAG3 for three values of the speed-factor \(a_{MAX}\). (**a**) time behaviors of the total energy \(\mathcal{E}_{TOT}\); (**b**) time behaviors of the corresponding network energy \(\mathcal{E}_{NET}\); and (**c**) time behaviors of the \(\lambda\) multiplier. _lambda_ multipliers remain almost surely vanishing (see Figures 7c, 8c, and 9c), and this supports the conclusion that all the performed resource allocations computed by the _RAP_p_ function are, indeed, _feasible_ (e.g., they meet the constraint in Equation (4) on the allowed maximum DAG execution time). Second, we have numerically ascertained that the abrupt step-like jumps experienced by the plots of \(\mathcal{E}_{NET}\) in Figures 7b, 8b, and 9b at the changing instants are the combined effects of _both_ the ON-OFF availability of the WiFi connectivity and the associated re-allocation of the Cellular up/down bandwidths.