# Modular Robotic Design and Reconfiguring Path Planning
## 2 Robotic Design and Modeling
### Modular Path Planning Based on Optimal Ant Colony Optimization
#### 3.3.2 Optimal ant Colony Algorithm Design
The nodes are selected in the explorable area so that \"\(\theta\)e\" tends to the target angle \"\(\varphi_{E}\)\", which is conducive to the path search direction tending to the target point \"\(P_{E}\)\", as shown in Figure 8.  
The target pinch angle \"\(\varphi_{E}\)\":  
\[\varphi_{E}=\theta_{E}+\varepsilon\,,\,\varepsilon>0 \tag{13}\]  
where: \"\(\varepsilon\)\" is the angle adjustment parameter greater than zero, which aims to prevent the \"\(\varphi_{E}\)\" from being zero; \"\(\theta_{E}\)\" is the angle between the two vectors. Target pinch angle heuristic factor:  
\[R(x_{i},y_{i})=\frac{1}{\varphi_{E}+\xi}\,,\,\xi\in[0,\,1] \tag{14}\]  
where: \"\(\xi\)\" is the angle coefficient; \"\(\varphi_{E}\)\" is the target angle. Since the initial point is far away from the target point at the beginning of the path planning, so the \"\(\xi\)\" is increased in the early stage to avoid the blind search due to the large range of the pinch angle; the \"\(\xi\)\" is decreased in the later stage of the path planning to enhance the accuracy of the path planning. Combining the Equation (10) and the Equation (13) to construct the multivariate heuristic function:  
\[H(x,y)=Q(x_{i},y_{i})\cdot R(x_{i},y_{i}) \tag{15}\]  
3. Update pheromone  
The optimal solution is obtained by using the stronger global search capability and search speed of the gravitational search algorithm for path search of the whole region, and the obtained results are transformed into the initial pheromone in the ant colony algorithm. This effectively solves the problems caused by the uniform distribution of initial node pheromones in the traditional ant colony algorithm, which easily falls into local optimum and blind search, and also effectively accelerates the speed of path search. When the ant \"\(k\)\" completes a search, the pheromone content of the node on the better path in this iteration is selected for global update. Before the ant \"\(k\)\" shifts from the current point to the next point \"\(P_{i}(x_{i},y_{i})\)\", a real-time pheromone update is performed for the current point:  
\[\tau_{i,j}=\tau_{i,j}^{G}+(1-\rho)\tau_{i,j} \tag{16}\]  
\[\rho=\rho_{0}+(1-\rho_{0})\frac{N}{N_{max}} \tag{17}\]  
where: \"\(\tau_{i,j}\)\" is the pheromone content of the current node \"\(P_{i}\)\"; \"\(\tau_{i,j}\)\" is the initial value of the pheromone content of each node, which takes the value of 0.5; \"\(\rho\)\" is the pheromone content decay coefficient; \"\(\rho_{0}\)\" indicates the initial value of the pheromone decay coefficient, which takes the value of 0.3; \"\(N\)\" is the current number of searches of the ant colony  
Figure 8: Schematic diagram of target angle. algorithm; \" \(N_{\max}\)\" indicates the maximum number of searches of the ant colony algorithm, which takes the value of 100. 4. Deadlock avoidance strategies  
When an ant faces a U-shaped obstacle, it falls into a \"trap\", where there is no way around it and it cannot get out of the trap. This phenomenon causes the ants to die and eventually leads the algorithm to deadlock. To avoid getting into the deadlock region, which leads to path search stagnation, a new obstacle avoidance strategy needs to be designed to avoid getting into a draw. As shown in Figure 9, when the ant \"\(k\)\" moves to grid \"\(r\)\" and gets into a deadlock, the ant returns to grid \"\(r\)\" \"at step\" \(k-1\)\" and defines grid \"\(r\)\" as an obstacle, and removes grid \"\(r\)\" from the set of optional nodes and uses roulette wheel method to make the ant reselect the step \"\(k\)\" movement to \"\(r\)\". This obstacle avoidance strategy can effectively improve the algorithm convergence performance and reduce the search time in reconfiguration path planning. 5.