# -- Select and Attempt task -- ```
## 4 Enhancing Performance by Avoiding Unwarranted Task Executions
### The Proposed CA Algorithm for the Early Detection of Bad Providers
If a consumer requires a service in a round, it locates all nearby providers. FIRE consumers select a provider following the four-step process outlined in [27]. After choosing a provider, they use the service, gain utility, and rate the service based on the UG they received. This rating is recorded for future trust assessments. The provider is also informed of the rating and may keep it for future interactions. CA consumers do not choose a provider. Instead, they send a request message to all nearby providers specifying the required service quality. Table 6 lists five performance levels that define the possible service qualities. CA consumers first request service at the highest quality (PERFECT). After a predetermined waiting time (WT), any CA consumer still unserved sends a new request for a lower-performance-level service (GOOD). This process continues until the lowest service level is reached or all consumers are served. When a provider receives a request, it stores it locally and applies the CA algorithm (CA_OLD or CA_NEW, depending on the consumer group it belongs to). WT is a parameter that defines the maximum time allowed for all requested services in a round to be provided. We assume that any consumer can manage with a lower-quality service. This assumption does not raise an issue of unfair comparison between FIRE and CA, since it also applies to consumers using FIRE. For instance, they may end up selecting a provider--potentially the only available option--whose service ultimately delivers the lowest performance level (WORST). Agents can enter and exit the open MAS at any time, which is simulated by replacing a number of randomly selected agents with new ones. The number of agents added or removed after each round varies but must remain within certain percentage limits of the total population. The parameters \(p_{CPC}\) and \(p_{PPC}\) define these population change limits for consumers and providers, respectively. The characteristics of new agents are randomly determined, but the proportions of provider types and consumer groups are maintained. When an agent changes location, it affects both its own situation and its interactions with others. The location is specified using polar coordinates \((\tau,\varphi,\theta)\), and the agent's position is updated by adding random angular changes \(\Delta\varphi\) and \(\Delta\theta\) to \(\varphi\) and \(\theta\). \(\Delta\varphi\) and \(\Delta\theta\) \begin{table}
\begin{tabular}{c c} \hline \hline
**Performance Level** & **Utility Gained** \\ \hline PL\_PERFECT & \(10\) \\ PL\_GOOD & \(5\) \\ PL\_OK & \(0\) \\ PL\_BAD & \(-5\) \\ PL\_WORST & \(-10\) \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Performance level constants. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Profile** & **Performance Range** & \(\sigma\)**p** \\ \hline Good & [PL\_GOOD, PL\_PERFECT] & \(1.0\) \\ Ordinary & [PL\_OK, PL\_GOOD] & \(2.0\) \\ Bad & [PL\_WORST, PL\_OK] & \(2.0\) \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Profiles of provider agents (performance constants defined in Table 6). are chosen randomly from the range \([-\Delta\phi,+\Delta\phi]\). Consumers and providers change their locations with probabilities \(p_{CLC}\) and \(p_{PLC}\), respectively. A provider's performance \(\mu\) can also change by a random amount \(\Delta\mu\) within the range \([-M,+M]\) with a probability of \(p_{PLC}\) in each round. Additionally, with a probability of \(p_{ProfileSwitch}\), a provider may switch to a different profile after each round. ### Experimental Methodology

In our experiments, we compare the performance of the following three consumer groups:

* FIRE: consumer agents use the FIRE algorithm. * CA_OLD: consumers use the previous version of the CA algorithm. * CA_NEW: consumers use the new version of the CA algorithm. To ensure accuracy and minimize random noise, we conduct multiple independent simulation runs for each consumer group. The exact Number of Simulation Independent Runs (NSIR) varies per experiment to achieve statistically significant results.