# Robot Swarms Decide under Perception Errors in Best-of-N Problems
## 2 The Robot's Basic Behavioral Model  
In this section, we present the microscopic model used by the robot to discover new sites, evaluate them, share this information, and make a vote (i.e., an opinion) by fusing the robot's measurements with the information received from its neighbors. Figure 1 shows a state machine of the robot's behavior. Robots start in the _\"leave nest\"_ state and leave the nest to visit the _\"explore\"_ state, which enables robots to look around for new sites. Figure 1: Robot’s behavior described as a finite state machine. As soon as a robot encounters site \(l\in\{A,B\}\), it starts evaluating the site's quality by taking \(\xi\) measurements, where a measure is sampled as follows:  
\[\gamma_{i}(l)\sim Gaussian(\mu_{l},\sigma_{l}) \tag{1}\]  
\(\mu_{l}=V_{l}+\delta_{l}\), where \(V_{l}\) is the actual quality value of the site and \(\delta_{l}\) is the robot's erroneous parameter--a configurable parameter. \(\delta_{l}\) is zero for accurate robots and a positive (negative) real number for overestimating (underestimating) robots. \(\sigma_{l}\) is the standard deviation of the measurement distribution. The robot starts leaving the site as soon as it has collected its \(\xi\) measurements. The measurements are sampled with a time difference of \(\Delta_{sample}\), which allow the robot to change location and measure a far-enough position. Robots apply a combination of behaviors, and the nest is marked with lights; hence, the robots apply a combination of antiphototaxis/phototaxis and obstacle avoidance behavior to leave and return to the nest. When the robot reaches the nest, it transits to the _\"disseminate\"_ state. This state consists of two phases: (i) a mix-up phase and (ii) a communicate phase. In the mix-up phase, the robot performs a random walk in the nest for a predefined period \(\theta_{mix}\) to avoid clusters of robots with the same opinion to build up--i.e., these are robots returning from the same site which they have visited in the last exploration trip. When \(\theta_{mix}\) is over, the robot starts communicating its measurements of the quality of the site that it has visited in its last exploration trip while continuing its random walk in the nest. Preserving the random walk, enables robots to change their local neighborhood and helps to further mix up the swarm and accelerates the spread of information [21; 22]. When disseminating, the robot sends a message that includes two pieces of information: (i) the site it is committed to (at the beginning, this is the site the robot has visited during its last exploration trip), and (ii) the quality value estimated by the robot using its \(\xi\) measurements that it has taken when visiting the site. The robot receives information from its neighborhood messages of the same structure and uses these messages to compute the average quality value of each of the two sites as follows:  
\[\overline{\gamma(l)}=\frac{1}{N_{l}}\sum_{j=1}^{N_{l}}\gamma_{j}(l), \tag{2}\]  
where \(N_{l}\) is the number of the robot's neighbors who have visited site \(l\in\{A,B\}\) during their last exploration trip. Afterwards, the robot compares the average values computed using in Equation (2) for the two sites as \(\Delta\overline{\gamma}=|\overline{\gamma(A)}-\overline{\gamma(B)}|\). We introduce parameter \(\epsilon\) as a configurable threshold for the evaluation bias (\(\epsilon\) equal for both sites):  
* In case \(\Delta\overline{\gamma}\leq\epsilon\), which means that the difference in the sites' qualities is negligible, the robot adapts the opinion of the majority in its neighborhood. Additionally, the robot updates the quality value of the site it has committed to with the average \(\overline{\gamma(l)}\), where \(l\in\{A,B\}\) is the site chosen by the majority in the robot's neighborhood. Finally, the robot keeps track of the quality of the site it has not chosen by saving it average quality.