# A Discrete Prey-Predator Algorithm for Cloud Task Scheduling
## 3 The Proposed Discrete Prey-Predator Algorithm for Cloud Task Scheduling
### Pseudo-Code for the Proposed Discrete Prey-Predator Algorithm for Cloud Task Scheduling
### The CloudSim Simulation Results

The second phase of the proposed Discrete Prey-Predator cloud-task-scheduling mechanism is based on the simulation of cloud environments using the CloudSim simulator [43]. Four simulation scenarios are studied in this phase, as presented in the following subsections. ### The First CloudSim Simulation Scenario

The first CloudSim scenario consists of 70 tasks and 30 resources. The execution time results are presented in Table 3 and Figure 4. \begin{table}
\begin{tabular}{c c c c c c c c c c c} \hline Iteration & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 \\ \hline Survival value & 0.0285 & 0.0285 & 0.0285 & 0.0285 & 0.0285 & 0.0285 & 0.0285 & 0.0285 & 0.0285 & 0.07 \\ \hline \end{tabular}
\end{table} 
Table 2: The survival values of ten iterations in the second scenario. Figure 3: The survival values of ten iterations in the second scenario. As shown in Figure 5 and Table 4, the execution time of the proposed Discrete Prey-Predator mechanism for cloud task scheduling in the first scenario is 596 in the first iteration of the optimization process. In the second iteration, the execution time of the proposed Discrete Prey-Predator mechanism for cloud task scheduling decreases to 582 and continues decreasing steadily until it reaches 423 in the last iteration. ### The Third CloudSim Simulation Scenario

In this scenario, a simulation comparison is conducted between the proposed Discrete Prey-Predator mechanism for cloud task scheduling and the firefly algorithm for cloud task scheduling [7; 32; 44]. The execution times of the simulation of the proposed Discrete Prey-Predator optimization, a random solution, and firefly algorithm are presented in Table 5 and Figure 6. This simulation considers 90 tasks and 50 resources. Table 5 and Figure 6 show the comparison of the execution times of the proposed Discrete Prey-Predator algorithm, a random solution, and firefly algorithm for cloud task scheduling. The random solution has the longest execution time, 386 s, and the proposed Prey-Predator algorithm has the shortest execution time, 238 s. The firefly algorithm performs better than the random solution, with 274 s execution time. \begin{table}
\begin{tabular}{c c} \hline \hline
**Scheduling Mechanism** & **Execution Time** \\ \hline Random solution & 386 \\ \hline Firefly algorithm & 247 \\ \hline Prey–Predator & 238 \\ \hline \hline \end{tabular}
\end{table} 
Table 5: A comparison between the Discrete Prey–Predator algorithm, a random solution, and firefly algorithm. Figure 6: A comparison between Discrete Prey–Predator algorithm, a random solution, and firefly Algorithm. ### The Fourth CloudSim Simulation Scenario

The fourth scenario is a comparative experiment between the proposed Discrete Prey-Predator algorithm for cloud task scheduling and the firefly algorithm. Several experiments are conducted with a different number of tasks and resources. The results of the fourth scenario are presented in Table 6 and Figure 7.

As shown in Table 6 and Figure 7, the execution time of the Discrete Prey-Predator algorithm is 28 s in the first experiment, which is 41 s less than the execution time of the firefly algorithm. However, in the subsequent experiments and when the number of resources and tasks is increased, the proposed Discrete Prey-Predator algorithm has shorter execution times than the firefly algorithm. Furthermore, as shown in Table 6, the average execution time of the proposed Discrete Prey-Predator algorithm is 270 s less than the average execution time of the firefly algorithm, which is 315 s. Hence, the experiment results reveal that the proposed Discrete Prey-Predator algorithm for cloud task scheduling outperforms the firefly algorithm in the case of execution time. ### Limitation of Performance Evaluation Works

One limitation of the performance evaluation is that it relies on simulations within the CloudSim environment. While CloudSim is a valuable tool for simulating computational cloud scenarios, it is not an accurate representation of real-world cloud environments.