## 4 Experimental Results and Discussion
### Experiment 1  
In the first experiment, eight tasks were prioritized and assigned to the best-matched of two SPs and four resources. SPs and resources were prioritized based on the preferences of SPs, while tasks were prioritized based on the customers' preferences. The underlying method for prioritization was the AHP. Table 2 shows all prioritized SPs and their resources along with their weights and ranks. The four criteria were then prioritized and ranked based on the customers' preferences to prioritize all of the customers' tasks. The overall results of prioritizing the criteria were found to be: reputation (0.32%), trust (0.44%), performance (0.15%), and cost (0.09%). Thus, Table 3 shows all customers' tasks, along with their weights and ranks. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**SP** & **Weight** & **Rank** & **R** & **Weight** & **Rank** \\ \hline
1 & 0.67 & 1 & 1 & 0.09 & 4 \\  & & & 2 & 0.33 & 1 \\ \hline
2 & 0.33 & 2 & 3 & 0.34 & 2 \\  & & & 4 & 0.24 & 3 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Preference-based ranking of SPs and their resources (Experiment 1). To assign each task to either an SP or a resource in the cloud, we first needed to compute the thresholds to identify the tendency of each task. The upper threshold was considered to be the sum of all SP-based criteria weights, and the lower threshold was considered to be the sum of all R-based criteria weights. The sum of all SP-based criteria weights was 0.76 (the sum of reputation weights was 0.32, and that of trust weights was 0.44), and the sum of all R-based criteria weights was 0.24 (the sum of performance weights was 0.15, and the sum of cost weights was 0.09). Therefore, we determined all tasks for which the sum of the weights was less than the upper threshold, and we identified their tendency toward SPs. The weights of the rest of the tasks were greater than or equal to the lower threshold; therefore, their tendency was set toward resources. Note that the sum of weights considers the sum of the prioritized tasks; therefore, the rank and the threshold play important roles in determining which task tends to an SP and which does not. The results of the assignment are shown in Table 4.  
After classifying all tasks' tendencies as either an \(SP\)-tendency or an R-tendency, we assigned each task to the best match with either the prioritized \(S\)\(P\)s or the prioritized resources. Any of the techniques mentioned earlier could be used for this assignment process. For simplicity, we assigned each task as follows. For each \(SP\),  
\[N_{\text{Ts}}=\left|N_{\text{SP-tendency}}*SP_{\text{w}}\right| \tag{1}\]  
where \(N_{\text{Ts}}\) is the number of tasks assigned to each \(SP\), \(N_{\text{SP-tendency}}\) is the number of tasks in the \(SP\) tendency category, and \(SP_{\text{w}}\) is the weight of the \(SP\). By applying Equation (1), we calculated the number of tasks for each \(SP\). It is important to mention that the assignment process should start from the pool of the prioritized \(S\)\(P\)s, i.e., the highest-ranked \(SP\) down to the lowest-ranked \(SP\), in order to obtain efficient assignment. Similarly, tasks with the highest ranks should have the priority to be assigned to the best match among the available \(S\)\(P\)s. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Tendency** & **T** & **SP/Resource** \\ \hline \hline SP-Tendency & 6 & SP2 \\
7 & SP1 \\
8 & SP1 \\
1 & R3 \\ \hline R-Tendency & 3 & R2 \\
4 & R4 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Categorization and assignment of tasks (Experiment 1). \begin{table}
\begin{tabular}{c c c} \hline \hline
**T** & **Weight** & **Rank** \\ \hline
1 & 0.10 & 6 \\ \hline
2 & 0.16 & 2 \\ \hline
3 & 0.08 & 7 \\ \hline
4 & 0.07 & 8 \\ \hline
5 & 0.12 & 4 \\ \hline
6 & 0.13 & 5 \\ \hline
7 & 0.18 & 1 \\ \hline
8 & 0.15 & 3 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Preference-based ranking of tasks (Experiment 1).