# A Cost-Aware Framework for QoS-Based and Energy-Efficient Scheduling in Cloud-Fog Computing
## 7 Evaluation
### Cost \(\epsilon\) of the Energy Penalty of Schedules  
The schedule optimality is evaluated by computing the cost \(\epsilon\) of the energy penalty at the cloud layer. Fog jobs \(\mathbf{J}\) are allocated on resource queues \(\mathbf{Q}\) of the cloud by utilizing the virtualized queue design scheme. Table 3 presents the cost \(\epsilon\) of the energy penalty for job schedules at the cloud layer where an allocation of 30 fog jobs on a virtualized queue is assessed.  
The energy cost \(\epsilon\) at the cloud layer is initially \(12.46\times 10^{6}\), which carries a 0.712 penalty. The genetic approach is applied along with the virtualized queue design scheme, and hence, the energy cost \(\epsilon\) is enhanced to become 5.53\(\times 10^{6}\) with a 0.425 penalty. It is shown that improvements on the cost \(\epsilon\) and penalty reach 55.6% and 40.4%, respectively. Figure 5 demonstrates such conclusions and shows the efficacy of the genetic algorithm in formulating a near-optimal energy cost schedule in only 3000 iterations for a virtualized queue of 30 fog jobs.  
In addition, the energy cost \(\epsilon\) and penalty are measured at the level of each cloud queue. For instance, the allocation of nine fog jobs of \(Q_{2}\) on a virtualized queue produces an initial energy cost \(\epsilon\) of \(5.26\times 10^{6}\) with a 0.409 penalty, which is enhanced to 2.53\(\times 10^{6}\) with a 0.224 penalty, as shown in Table 3. The improvements achieved on the energy cost \(\epsilon\) and penalty of queue \(Q_{2}\) are 51.9% and 45.3%, respectively.  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline  & **Virtualized 1** & \multicolumn{2}{c}{**Initial 2**} & \multicolumn{2}{c}{**Enhanced 3**} & \multicolumn{2}{c}{**Improvement**} \\ \cline{3-7}  & **Queue** & \(\epsilon\) & **Penalty** & \(\epsilon\) & **Penalty** & **Cost \%** & **Penalty \%** \\ \hline Cloud Tier 4  & 30 & \(12.46\times 10^{6}\) & 0.712 & \(5.53\times 10^{6}\) & 0.425 & 55.6\% & 40.4\% \\ \hline \(Q_{1}\) [Figure 6a] & 16 & \(2.91\times 10^{6}\) & 0.252 & \(1.46\times 10^{6}\) & 0.136 & 49.8\% & 46.2\% \\ \(Q_{2}\) [Figure 6b] & 9 & \(5.26\times 10^{6}\) & 0.409 & \(2.53\times 10^{6}\) & 0.224 & 51.9\% & 45.3\% \\ \(Q_{2}\) [Figure 6c] & 5 & \(4.29\times 10^{6}\) & 0.349 & \(2.89\times 10^{6}\) & 0.251 & 32.7\% & 28.1\% \\ \hline \hline \end{tabular}
\end{table}
Table 3: Energy penalty cost of schedules across cloud–fog computing environment.  
Figure 4: Cost of QoS Penalty scheduling for each server in the cloud environment. (a) Virtualized queue of 16 jobs. (b) Virtualized queue of 9 jobs. (c) Virtualized queue of 5 jobs.  
Similarly, the improvements are proven on queues \(Q_{1}\) and \(Q_{3}\). For queue \(Q_{1}\), the energy cost \(\epsilon\) is mitigated from \(2.91\times 10^{6}\) to \(1.46\times 10^{6}\) with a 49.8% enhancement, whereas the penalty is mitigated from 0.252 to 0.136 with a 46.2% reduction. For queue \(Q_{3}\), reductions in the energy cost \(\epsilon\) and penalty reach 32.7% and 28.1%, respectively. Figure 5(a)-c illustrate the mitigation of the cost \(\epsilon\) of energy penalty in a reasonable time for queues \(Q_{1}\), \(Q_{2}\), and \(Q_{3}\), respectively, wherein only 200 iterations are utilized to reach a near-optimal cost \(\epsilon\) of energy penalty.