# Multi-UAV Cooperative Anti-Submarine Search Based on a Rule-Driven MAC Scheme
## 2 Materials and Methods
### Pheromone Update Rules considering Threat Avoidance  
Because this research involves a situation of avoiding threats, two pheromone update methods should be considered. One involves judging a situation in which the next grid is not threatened according to (20), and the other is a situation in which the next grid is threatened. 1. Pheromone update method 1 (the next grid is not threatened) \[\tau_{op}(t+1)=(1-\rho(t))\tau_{op}(t)+\Delta\tau^{\sigma}(o,p)\] (25) where \(\tau_{op}(t+1)\) and \(\tau_{op}(t)\) are the values of the pheromone in grid \((o,p)\) before and after the update, respectively; and \(\rho(t)\) represents the pheromone volatilization coefficient. The traditional pheromone volatilization coefficient is a constant value. If the setting value is too high, it is easy to fall into the local optimal solution, which affects the global search ability of the algorithm. If the setting value is too low, the search randomness is enhanced, and the convergence speed is slow. In order to improve the convergence accuracy of the algorithm, \(\rho(t)\) was designed as: \[\rho(t+1)=\frac{T_{\max}}{(T_{\max}+s_{hp}(t)+s_{lp}(t))e^{1-\rho(t)}}\] (26) where \(T_{\max}\) is the maximum iteration number of the algorithm. It can be seen that with the search, the grid that conforms to the association rules constantly changes, and the pheromone volatilization coefficient also changes. In the initial stage, \(\rho(t)\) is large. An ant colony algorithm can quickly search for a preferable path and improve the global search ability. With progressive iterations, the grid conforming to the association rules gradually increases, and \(\rho(t)\) gradually decreases. At this time, the search space can be expanded to avoid falling into local convergence. \(\Delta\tau^{\sigma}(o,p)\) is the pheromone update value, designed as follows:  
\[\Delta\tau^{\sigma}(o,p)=\sum_{l=1}\Delta\tau^{\sigma}_{l}(o,p) \tag{27}\]  
where \(\Delta\tau^{\sigma}_{l}(o,p)\) is the pheromone left by ant \(l\) in the sub-group on grid \((o,p)\), which is defined as:  
\[\Delta\tau^{\sigma}_{l}(o,p)=\left\{ \begin{array}{c}\frac{rQ}{L_{s_{hp}+s_{ lp}}\sigma_{l}l_{l}},\varepsilon_{i}=1\\ \frac{rQ}{L_{s_{lp}+s_{lp}}},\varepsilon_{i}=0\end{array} \right. \tag{28}\]  
where \(L_{s_{hp}+s_{lp}}\) represents the path of grids \(s_{hp}\) and \(s_{lp}\) traversed by the ants in path optimization, \(L_{0}\) represents the path that ants walk before they find the target, \(Q\) is the pheromone update constant, \(r\) is the constant, \(J_{l}\) is the utility function of ant \(l\) obtained according to (21), and \(\delta_{1},\delta_{2}\) is the weight. **Remark 4**. : _In order to improve the accuracy of the MAC [18] and avoid falling into the local optimum, the volatility coefficient, \(\rho(t)\), is based on the rule information of the grid. The pheromone update method of each grid is sub-divided into two cases: \(\varepsilon_{i}=0\) and \(\varepsilon_{i}=1\). When \(\varepsilon_{i}=0\), there is no applicable rule information in the initial stage, and the pheromone is updated to the path information traveled by the ants. When \(\varepsilon_{i}=1\), the pheromone value is re-updated according to the grid that the ants traveled that conforms to the rules._  
2. Pheromone update method 2 (the next grid is threatened);  
Each time the pheromone is updated, the threat level of the next grid needs to be judged. If the grid threat level is high, the pheromone concentration of the next grid needs to be weakened:  
\[\tau_{op}(t+1)=\tau_{op}(t)-\Delta\tau_{op}(t) \tag{29}\]  
where \(\Delta\tau_{op}(t)\) is the decrement of the pheromone within the grid \((o,p)\), defined as follows:  
\[\Delta\tau_{op}(t)=\Delta\tau_{0}L_{safe}(t)\tau_{op}(t) \tag{30}\]where \(\Delta\tau_{o}\) is the pheromone decay coefficient, and \(L_{safe}(t)\) is the safe distance of the UAV from the threat at the \(t\)-th iteration. **Remark 5**. : _Update method 2 considers a situation of threats in the grid.