# Robot Swarms Decide under Perception Errors in Best-of-N Problems
## 3 The Extended Robot'S Behavioral Model  
We extend the basic behavioral model by adding a _classification_ state, as in Figure 2. This state is used by the robots to classify themselves as belonging to one of the three populations: accurate, overestimating, or underestimating. The robots access this state after returning to the nest and spending \(\theta_{mix}\) in performing a random walk to mix up robots arriving from each site. It also occurs before transiting to the dissemination state. Hence, when the robots access the dissemination state, there is a high likelihood that they have already classified themselves. Robots exploit the classification process to assign a higher weight to opinions shared by accurate robots in comparison to those shared by overestimating/underestimating robots, aiming to improve the quality of the decision-making process. Finally, we propose that when the number of interactions exceeds a predefined threshold \(\zeta\), robots from any population shift their classification to accurate. The reasoning behind this heuristic is that if a large enough sample of opinions is combined with larger weights awarded to accurate robots, the opinion will eventually trend toward accuracy. Initially, when entering the classification state, all robots classify themselves as \"unknown\". This classification is shared with the robot's neighborhood, and it helps to filter out the opinion of the sender, when it has not classified itself yet. The classification state lasts for \(\theta_{classify}\) to grant robots enough time to classify themselves. In this study, we propose different algorithms for robots to classify themselves. In the following, we describe the used algorithms, and we compare them in terms of their classification accuracy. * **The distance-based algorithm:** Following this algorithm, at each time step the robot collects the quality values measured by its neighbors who have visited the same site. It calculates the difference between the quality it has measured and the neighbors' measurements, which is referred to as distance \(\lambda_{ij}\). \(\lambda_{ij}\) is the difference between the measure taken by robot i and its neighbor j of the same site. \[\lambda_{ij}(l)=|\gamma_{i}(l)-\gamma_{j}(l)|\quad\text{where }l\in\{A,B\}.\] (3) Robot \(i\) stores the computed distance \(\lambda_{ij}\) paired with the ID of the sender (i.e., robot \(j\)). Robot \(i\) repeats this computation and stores the distances for all its neighbors who have visited the same site. Storing sender IDs helps the robot to avoid considering the same sender more than once. When the \(\theta_{classify}\) period is expired, every robot has a record of all the neighbors it met during \(\theta_{classify}\) and who measured the quality of the same site. It exploits this record to compute the average distance between its own measurement and the neighbors' measurements--i.e., how far the robot's measurement is from its neighbors' one on average--as follows: \[\overline{\lambda(l)}=\frac{1}{N_{l}}\sum_{j=1}^{N_{l}}\lambda_{ij},\] (4) where \(N_{l}\) is the number of neighbors robot \(i\) encountered during \(\theta_{classify}\) and who have visited the same site as robot \(i\). Figure 2: The extended robot’s behavioral model described as a finite state machine. In order for robot \(i\) to classify itself, it checks average distance \(\overline{\lambda}\) against a given range \([-\delta_{l}/2,\delta_{l}/2]\): \(\overline{\lambda(l)}\in[-\delta_{l}/2,\delta_{l}/2]\): Robot \(i\) considers itself as an accurate robot; \(\overline{\lambda(l)}<-\delta_{l}/2\): Robot \(i\) considers itself as an underestimating robot; \(\overline{\lambda(l)}>\delta_{l}/2\): Robot \(i\) considers itself as an overestimating robot. A clear downside of the distance-based approach is the need for global knowledge (i.e, the parameter \(\delta_{l}\)) to be shared at the individual level.