## 6 VirtFogSim in Action: Testing Its Numerical Capabilities
### The Performance Impact of Different Task and Resource Allocation Strategies  
In this section, we compare the energy performances of the (previously-described) task and resource allocation strategies supported by the _VirtFogSim_ toolbox under the considered test DAGs. The three-fold final goal is to acquire some insight about: (i) the energy reduction stemming from the dynamic optimization of the computing-networking resources versus the corresponding case of _static_ resource usage; (ii) the performance gap between the genetic-based and the Exhaustive Search-based allocation strategies; and (iii) the energy-saving capability offered by the Mobile-Fog-Cloud _three-tier_ computing platform of Figure 1 versus the corresponding Mobile only, Mobile-Cloud, and Mobile-Fog ones. The profiled results are reported in Figures 10-12 under DAG1, DAG2, and DAG3, respectively. Their examination gives arise to the following three main sets of remarks. Dynamic-vs.-static resource allocationA number of benchmark (even quite recent) contributions [26; 30; 31; 33] afford the problem of the resource augmentation of mobile devices by developing various heuristic/meta-heuristic/optimal solutions for energy-efficient task offloading. However, they _neglect_ considering, indeed, the companion problem of dynamic scaling of the computing and/or network resources. Hence, a key (still pending) question is: how much energy may be actually saved by _jointly_ performing task _and_ dynamic resource allocation? In this regard, we point out that both the _GeneticTA_par_ and _O_TAS_par_ strategies implemented by the _VirtFogSim_ toolbox rely on the same genetic-based meta-heuristic for performing task placement. However, _GeneticTA_par_ also performs dynamic resource allocation by invoking the auxiliary _RAP_p_ function, while _O_TAS_par_ does not scale up/down the involved computing frequencies and wireless bandwidths of Figure 1 and clips them at their corresponding maximum values (see Section 4.2). Hence, a direct comparison of the energies consumed by _GeneticTA_par_ and _O_TAS_par_ allows us to profile how much energy may be saved by performing dynamic resource allocation. In this regard, an examination of the numerical results reported in the first and second bars of Figures 10-12 leads to three main insights. First, the energy ratio: \(\mathcal{E}_{\text{O\_TAS\_par}}/\mathcal{E}_{\text{GeneticTA\_par}}\) ranges over the intervals: 2.85-3.50, 3.46-4.10, and: 4.50-4.56 under DAG1, DAG2, and DAG3, respectively. Second, at fixed DAG, the energy savings stemming from performing dynamic resource allocation reaches their maxima at values of \(T_{DAG}\) of the order of 0.6-0.9 s, while tending to somewhat decrease at smaller and higher execution delays. Third, the average energy-saving stemming from dynamic optimization is more relevant under DAG3. Overall, the performed analysis unveils that the dynamic optimization of the allocated computing-networking resources plays, indeed, a _pivotal_ role in reducing the energy consumption of the overall technological platform of Figure 1.  
Genetic-vs.-Exhaustive Search performance comparisonThe focus of this subsection is on the tradeoffs among energy performance and execution complexity that are attained by the (meta-heuristic) _GeneticTA_par_ and the (optimal) exhaustive _E_ESS_par_ strategies. In this regard, we point out that all the simulations of the _GeneticTA_par_ function are carried out at population size \(PS=120\) and per-population number of generations \(G_{MAX}=100\). In so doing, the resulting computational complexity of the run _GeneticTA_par_ code is of the order of (see Table 4) \(\mathcal{O}\left(120\times 100\right)\) under all test DAGs.