# -- Select and Attempt task -- ```
## 4 Enhancing Performance by Avoiding Unwarranted Task Executions
### A Semi-Formal Analysis of the CA Algorithm to Identify and Avoid Unwarranted Task Executions
Assume that \(C_{1}\) requests the execution of \(task_{1}\) broadcasting the message \(m_{1}=(request,C_{1},task_{1})\). According to the CA algorithm, when \(BP_{1}\) receives message \(m_{1}\), it will create the connection \(co_{1}=(BP_{1},C_{1},0.5,task_{1})\), initializing its weight to the value \(0.5\). Since the condition \(w\geq Threshold\) is satisfied, \(BP_{1}\) will perform \(task_{1}\), but it will fail because its performance range is in \([-10,\ 0]\), and \(task_{1}\) requires a performance equal to \(10\). After it fails, \(BP_{1}\) will decrease the weight of \(co_{1}\) to the value \(w^{\prime}=0.45\), by using equation \(w^{\prime}=w-\beta(1-w)\), where \(\beta=0.1\) in our experiments. Now, let \(C_{2}\) require the execution of \(task_{1}\) by sending the message \(m_{2}=(request,C_{2},task_{1})\). When \(BP_{1}\) receives the message \(m_{2}\) and because it already has the connection \(co_{1}\), it will \begin{table}
\begin{tabular}{c c} \hline \hline
**Tasks** & **Explanation of the Requirement** \\ \hline task1 = (service\_ID, performance\_level = PERECT) & Performance must be equal to \(10\) \\ task2 = (service\_ID, performance\_level = GOOD) & Performance must be greater than or equal to \(5\) \\ task3 = (service\_ID, performance\_level = OK) & Performance must be greater than or equal to \(0\) \\ task4 = (service\_ID, performance\_level = BAD) & Performance must be greater than or equal to \(-5\) \\ task5 = (service\_ID, performance\_level = WORST) & Performance must be greater than or equal to \(-10\) \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Explanation of requirements. create the connection \(co_{2}=(BP_{1},C_{2},0.45,task_{1})\), initializing its weight to the average of the weights of the connections it has with other consumers for \(task_{1}\). In this case, \(average=\frac{w_{co_{1}}}{1}=0.45\), where \(w_{co_{1}}\) denotes the weight of connection \(co_{1}\). Because the weight of \(co_{2}\) is less than the threshold value, \(BP_{1}\) will decide not to perform \(task_{1}\) for consumer \(C_{2}\). For simplicity, we assume that \(BP_{1}\) will not change its ability to provide \(task_{1}\) so that the weights of all connections will remain constant over time. Now, we can prove by induction the following proposition. Given Assumption 3, every new connection that \(BP_{1}\) will create for \(task_{1}\) will be initialized to the average of the weights of the connections it has already created for \(task_{1}\), which will remain constant and equal to 0.45. The proof is provided in Appendix A. By Proposition 1 and Definition 1, it follows that \(BP_{1}\), in a single trial, has learned that it cannot successfully perform \(task_{1}\). We can generalize every bad provider to the following conclusion. Given our experimental conditions (i.e., Threshold = 0.5, \(\alpha=\beta=0.1\)), every bad provider needs only one trial to learn that it cannot successfully perform \(task1\). Phase B: Provider \(BP_{1}\) learns its incapability in performing \(task_{2}\). Following the same analysis as in Phase A, we can conclude as follows. Given our experimental conditions (i.e., Threshold = 0.5, \(\alpha=\beta=0.1\)), every bad provider needs only one trial to learn that it cannot successfully perform \(task_{2}\). Phase C: Provider \(BP_{1}\) learns its incapability in performing \(task_{3}\). Assume that \(C_{1}\) requests the execution of \(task_{3}\) broadcasting the message \(m_{1}=(request,C_{1},task_{3})\). When \(BP_{1}\) receives message \(m_{1}\), it will create the connection \(co_{1}=(BP_{1},C_{1},0.5,task_{3})\), initializing its weight to the value 0.5. Since the condition \(w\geq Threshold\) is satisfied, \(BP_{1}\) will perform \(task_{3}\). Due to its performance range in \([-10,\,0]\) and the task's requirement that performance must be bigger or equal to zero in order to be successful, \(BP_{1}\) has a small probability of having a performance equal to zero and thus a successful execution of \(task_{3}\).