# Resource Scheduling in Cloud Computing Based on a Hybridized Whale Optimization Algorithm
## 3 Proposed Models
### Model Used for Simulations with Artificial Data Set (Second Model)  
The second model, which was utilized in practical simulations with artificial data sets, belongs to the group of multi-objective resource scheduling models with the basic objectives of minimizing the MS and the budget cost. A similar model was employed in [26; 64]. This model is known in the literature as a resource scheduling model based on the performance and budget constraints [64]. The performance function is represented by the MS. One of the requirements of this model is that all the tasks should finish before the deadline and with costs that fall into the scope of a predefined budget. Our multi-objective model in the cloud computing environment, besides the MS objective, also takes into account the cost function of the CPU and memory of the VMs (resources). Mathematical formulations which are used in this research are similar to those in [26]. The overall budget cost for task scheduling is defined by combining the cost function of the CPU and memory. Afterwards, the fitness is calculated by adding the budget cost function and MS of the process of scheduling. The fitness depends on the solution's quality. The solutions ought to have minimum MS and minimum cost functions. First, the cost of the CPU time of VM \(j\) is calculated by using the following equation:  
\[C_{(x)}=\sum_{j=1}^{N_{VM}}C^{cost}(j), \tag{12}\]  
where the \(C^{cost}(j)\) denotes the cost of the CPU of the virtual machine \(VM_{j}\), and the \(N_{VM}\) represents the total number of VMs in the cloud infrastructure. The notation \(x\) denotes a feasible solution. The \(C^{cost}(j)\) can be further calculated as:  
\[C^{cost}(j)=C_{base}\times C_{j}\times t_{ij}+C_{Trans}, \tag{13}\]  
where the \(C_{base}\) denotes the cost basis, \(C_{j}\) denotes the CPU time cost of the virtual machine \(VM_{j}\), the \(t_{ij}\) is the time in which the task \(T_{i}\) is refined in the resource \(R_{j}\) (virtual machine \(VM_{j}\)). \(C_{Trans}\) represents the transmission cost of the CPU. The \(C_{base}\) and \(C_{Trans}\) are constants:  
\[C_{base}=0.17/hr, \tag{14}\]  
\[C_{Trans}=0.005. \tag{15}\]  
To calculate the cost function of a memory, the following equation is used:  
\[M_{(x)}=\sum_{j=1}^{N_{VM}}M^{cost}(j), \tag{16}\]  
in which the \(M^{cost}(j)\) presents the cost of the memory of the virtual machine \(VM_{j}\). The total number of virtual machines is denoted as \(N_{VM}\). The \(M^{cost}(j)\) can be calculated as follows:  
\[M^{cost}(j)=M_{base}\times M_{j}\times t_{ij}+M_{Trans}, \tag{17}\]  
where the base of the memory is represented as \(M_{base}\), the memory of virtual machine \(VM_{j}\) is \(M_{j}\) and \(t_{ij}\) denotes a time when the task \(T_{i}\) is processed on the resource \(R_{j}\) (virtual machine \(VM_{j}\)). The \(M_{Trans}\) presents the transmission cost of the memory. The values of \(M_{base}\) and \(M_{Trans}\) are constants:  
\[M_{base}=0.05 GB/hr, \tag{18}\]  
\[M_{Trans}=0.5. \tag{19}\]  
Finally, the budget cost is calculated by adding the cost function of the CPU and memory of the VM:  
\[B_{(x)}=C_{(x)}+M_{(x)}, \tag{20}\]  
where the \(B_{(x)}\) presents the budget cost function for the end-user, \(C_{(x)}\) denotes the cost function of the CPU and the \(M_{(x)}\) is the cost function of the memory. Hence, the fitness is calculated by the following:  
\[H_{(x)}=MS_{(x)}+B_{(x)}, \tag{21}\]where \(MS_{(x)}\) denotes the MS value, that is, the performance function and it should be less than or equal to the deadline of the task. The MS is defined by the following equation:  
\[C^{cost}(j)=C_{base}\times C_{j}\times t_{ij}+C_{Trans}, \tag{13}\]0  
in which \(D_{i}\) presents the deadline for the task \(T_{i}\). In the previous equation (Equation (21)), \(B_{(x)}\) denotes the budget cost function of the tasks that comprises of the CPU cost and memory cost, and it should be less than or equal to the end users' budget cost.