# -- Select and Attempt task -- ```
## 4 Enhancing Performance by Avoiding Unwarranted Task Executions
### The Proposed CA Algorithm for the Early Detection of Bad Providers
```
# -- Initialize task-specific self-assessment memory --
1: define i.bad_tasks as a map with default value false # assumes good unless proven otherwise
2: while True do
# -- Broadcast a request message when a new task is perceived --
3: when perceived a new task = (c, r)
4: broadcast message m = (request, i, task)
# -- Receive/store a request message and initialize a new connection --
5: when received a new message m = (request, j, task)
6: add m to message list M
# -- Initialize a new connection --
7: if no existing connection co = (i, j _, task) then
8: if i.bad_tasks[task] = true and task.performance_level \(\in\) {PERFECT, GOOD, OK} then
9: create co = (i, j, 0.45, task) # cautious trust level for task-specific bad assessment
10: else if there are similar connections co' = (i, \(\
eg\)j _, task) from i to other agents for the same task then
11: create co = (i, j, avg_w, task), where avg_w = average of all weights for (i, \(\
eg\)j _, task)
12: else
13: create co = (i, j, 0.5, task) # initialize to default trust
14: end if
15: else #if connection co = (i, j, _, task) exists
# -- modify an existing connection if certain conditions hold--
16: if i.bad_tasks[task] = true and task.performance_level \(\in\) {PERFECT, GOOD, OK} then
17: modify co = (i, j, 0.45, task)
18: end if
19: end if
# -- Select and Attempt task --
20: select m = (request, j, task) from M such that co = (i, j, w, task) has the highest weight among all (i, k, w', task)
21: if task is not visible or not done yet then
22: if canAccessAndUndertake(task) then
23: if w \(\geq\) Threshold then

## 5 Experimental Setup and Methodology

### The Testbed

To test the performance of the revised algorithm, we performed an extensive simulation-based experimentation on a testbed based on the one described in [27]. The environment of the testbed consists of agents that either provide services (referred to as providers or trustees) or use these services (referred to as service requesters, consumers, or trustors). For simplicity, we assume all providers offer the same service, i.e., there exists only one type of task. The agents are randomly distributed within a spherical world with a radius of 1.0. The agent's radius of operation (\(r_{0}\)) represents its capacity to interact with others (e.g., available bandwidth), and it is uniform across all agents, set to half the radius of the spherical world. Each agent has acquaintances, which are other agents located within its operational radius. Provider performance varies and determines the utility gain (UG) for consumers during interactions. There are four types of providers, good, ordinary, intermittent, and bad, as defined in [27]. Except for intermittent providers, each type has a mean performance level \(\mu_{p}\), with the actual performance following a normal distribution around this mean. Table 5 shows the values of \(\mu_{p}\) and the associated standard deviation \(\sigma_{p}\) for each provider type. Intermittent providers perform randomly within the range \([PL_{BAD},\;PL_{GOOD}]\). The radius of operation of a provider also represents the range within which it can offer services without a loss of quality. If a consumer is outside this range, the service quality deteriorates linearly based on the distance, but the final performance remains within \([-10,+10]\) and corresponds to the utility the consumer gains from the interaction. The simulations in the testbed are conducted in rounds. As in real life, consumers do not require services in every round. When a consumer is created, its probability of requiring a service (_activity level a_) is selected randomly. There are no limitations on the number of agents that can participate in a round. If a consumer needs a service in a round, the request is always made within that round. The round number marks the time for any event. Consumers fall into one of three categories: (a) those using FIRE, (b) those using the old version of the CA algorithm, or (c) those using the new version of the CA algorithm.