# A Bacterial Chemotaxis-Inspired Coordination Strategy for Coverage and Aggregation of Swarm Robots
## 4 Proposed Method
### The BCCS for Aggregation  
The coordinate strategy described in this section is similar to that in Section 4.1, and we introduce a solution to aggregation. The fitness function is obtained by Equations (5) and (6). Two basic behaviors, running and rotating, also exist in the coordinate control strategy for the aggregation. We modify the coordinate strategy for aggregation, as shown in Equation (10).  
\[g\Big{(}x_{i}(t),\big{[}x_{j}(t)\big{]}_{j\in N_{i}(t)}\Big{)}\stackrel{{ \Delta}}{{=}}\left\{\begin{array}{ccc}\left[\begin{array}{c}v(t)\\ 0\end{array}\right]&if&\zeta_{i}(t)\geq F_{i}(t),\\ \left[\begin{array}{c}v(t)\\ \theta(t)\end{array}\right]&if&\zeta_{i}(t)<F_{i}(t),\end{array}\right. \tag{10}\]  
where, \(\zeta_{i}(t)~{}\geq~{}F_{i}(t)\) denotes that the current fitness function value is lower or equal to the previous one. In this case, the robot \(i\) maintains the current direction and moves forward.  
Figure 8: Flowchart of BCCS for coverage.  
Figure 7: Illustration of the integrated virtual repulsive force for robot \(i\).  
This process is defined as the running of robot for aggregation. In contrast, \(\zeta_{i}(t)\ <\ F_{i}(t)\) denotes that the current fitness function value is higher than the previous one. In this case, the robot \(i\) rotates \(\theta(t)\) radians, and moves forward. This process is defined as rotating of robot for aggregation. \(\theta(t)\) solution is based on Equations (8), (11) and (12):  
\[r(t)=w_{1}*\sum_{j\in N_{i}}\big{(}x_{j}(t)-x_{i}(t)\big{)}+w_{2}*rand(0,1) \tag{11}\]  
\[w_{1}=\frac{Num_{N_{i}}(t)}{n} \tag{12}\]  
where \(Num_{N_{i}}(t)\) is the number of neighbors of robot \(i\) at time \(t\). The _rand_ (0,1) is the random factor that follows the (0,1) uniform distribution. The _rand_ (0,1) improve the robot exploration ability to prevent robots from rendezvous multiple aggregations. The coefficient \(w_{1}\) and \(w_{2}\), \(0\ \leq\ w_{1}\), \(w_{2}\ \leq\ 1\) and \(w_{1}+w_{2}=1\), are the weights of the neighbor impact and random impact, respectively. In this coordinate strategy, \(w_{1}\) and \(w_{2}\) can be dynamically adjusted according to the number of neighbors of the robot. The larger the value of \(w_{1}\) (neighbor impact) gets, the smaller \(w_{2}\) (random impact) is. For example, \(w_{2}=0\), means that the robot can sense all the individuals in the swarm after iterations, which causes all the robots to be aggregate quickly.  
Figure 9 is flowchart of BCCS for aggregation. Each robot also performances the running or rotating according to the above coordination strategy for aggregation. In aggregation, each robot tries to minimize its \(F_{i}\) and simultaneously monitor the number of neighbors in its sub-aggregation. When robots from multiple aggregations, \(w_{2}\) can promote the exploration of individuals within each sub-aggregation. Fusion occurs when two sub-aggregations meet, and the aggregation will be achieved. In the whole process, there is no central controller or global network in the swarm robotic system and no direct communication between the robots.