# Collective Memory: Transposing [PERSON]'s Experiment to Robot Swarms
## 3 Robot's Behavior
### Encoding Information in the Collective Memory
When robots are aggregated, they periodically make a decision with probability \(Q\) whether to remain static or to resume motion based on the number of local neighbors, discriminating the red ones \(X_{red}\) and the yellow ones \(X_{yellow}\), or more generally, the neighbors sharing the same color \(X_{S}\), and the ones with opposite color \(X_{O}\). If robots indistinctively take into account all neighbors, red or yellow, the group eventually aggregates in a mixed configuration because they have on average the same probability to encounter either colored robots. However, if robots only take into account local neighbors that have the same color as themselves, they will tend to remain with similarly colored robots, and leave robots of opposite color, eventually leading to a segregated configuration. The probability \(Q\) of robots to leave an aggregate and resume motion is calculated as follows:  
\[Q(\alpha)=\frac{\theta}{1+\rho\Big{(}\frac{X_{S}+\alpha X_{O}}{ \kappa}\Big{)}^{2}}\,, \tag{1}\]  
where parameters \(\theta\) and \(\rho\) determine the minimum and maximum probabilities of leaving the beacon area, and \(\alpha\) is a parameter that represents the affinity with which robots aggregate with other robots of the opposite color. Moreover, we used parameter \(\kappa\) as a normalization coefficient. Based on preliminary tests, we have fixed \(\theta=0.9\), \(\rho=100\), and \(\kappa=40\) (note that robots only estimate neighbors by counting perceived signals, therefore \(\kappa\
eq 30\)). In this paper, the robots are blind (\(\alpha=0\)) to opposite colored robots when the unconditional and conditional stimuli are perceived together, leading to the encoding of information via a segregated spatial configuration. Otherwise, robots do not discriminate their neighbors by color (\(\alpha=1\)) and aggregate in a mixed spatial configuration. In the following, we use the notation \(P_{seg}=Q(0)\) to indicate that robots aggregate in a segregated configuration, and \(P_{mix}=Q(1)\) to indicate that robots aggregate in a mixed configuration. To study all the possible configurations adopted by the robots with this behavior, we have analyzed a mean-field mathematical model that we hereby introduce. As a means to describe the mixed and segregated spatial configurations under a single beacon, we have divided the aggregation zone (the range of the beacon) into two areas, named \(a_{1}\) and \(a_{2}\). When robots are mixed, they indifferently occupy any location under the beacon, but, when they are segregated, they spatially divide into two teams that each occupy an area on its own. As a consequence, the model uses four variables (\(X_{S,1}\), \(X_{O,1}\), \(X_{S,2}\), and \(X_{O,2}\)) that describe populations of robots by their type (\(S\) for self, and \(O\) for opposite), and an area in which they reside (1 or 2). To limit any potential confusion, we would like to stress that the division of the aggregation zone in two areas is a pure abstraction introduced to allow expressing and studying the robots' behaviour with a mathematical model. One can write the rates at which robots of type \(S\) and \(O\) move from area \(a_{2}\) to area \(a_{1}\) as:  
\[\Phi_{S,2\to 1} = \frac{\theta\gamma_{1}}{1+\rho\big{(}X_{S,2}+\alpha X_{O,2}\big{)} ^{2}}\] \[\Phi_{O,2\to 1} = \frac{\theta\gamma_{1}}{1+\rho\big{(}\alpha X_{S,2}+X_{O,2}\big{)} ^{2}}\,, \tag{2}\]where \(\gamma_{1}=\left(1-\frac{X_{S,1}+X_{O,1}}{\kappa}\right)\) represents the saturation of area \(a_{1}\) that is the degree to which it can still accept new robots. Moreover, in the mathematical model, \(\kappa\) represents the carrying capacity of each area, so that the whole aggregation zone can contain at most \(2\kappa\) robots. This formulation only considers robots' exchanges between the two areas: individuals can instantly move from one to the other, and the mathematical description of their transit outside the aggregation zone and back to it is neglected.