# Obstacle Avoidance in a Three-Dimensional Dynamic Environment Based on Fuzzy Dynamic Windows
## 4 Simulation Results
### Dynamic Obstacle Avoidance
When running the 78 th iteration, the minimum safety distance is 0.5324 m, which is greater than the safety distance of 0.3 m.  
Figure 13: Dynamic obstacle avoidance: (**(a)** four agents flying to the same plane; **(b)** four agents crossing each other; **(c)** the minimum obstacle distance between the agents at the same moment during the iterations in FFLSP scenario; **(d)** the minimum obstacle distance between the agents at the same moment during the iterations in FFL scenario). In the FFCL scenario, four agents fly from four diagonal directions. This setting is used to simulate multiple agents reaching their positions at the same time to carry out their operational tasks, respectively. During the process, the agents pass through similar path points. The four agents are unknown dynamic obstacles to each other. The starting position of Agent 1 are (7,1,1). The goal point of Agent 1 is (8,1,1). The starting position of Agent 2 is (0,2,0). The goal point of Agent 2 is (5,4,5). The starting position of Agent 3 is (0,7,4). The goal position of Agent 3 is (8,1,1). The starting position of Agent 4 is (6,5,4). The goal position of Agent 4 is (1,1,1). It can be seen from Figure 13(b) that the agents safely reach their goal points, respectively. Figure 13(d) shows the results of the minimum distance between agents at the same moment. At the 69 th iteration, the minimum distance between Agent 1 and Agent 3 is 1.258 m, which is far greater than the safety distance of 0.3m. The analysis of the minimum distance shows that the planned trajectory is safe and reliable. Figure 15 shows the weight of reward value changes in FFLP and FFCL scenarios. In FLSP scenario, when an agent starts moving, the distance to its goal, and the distance to the obstacles are relatively long. Therefore, in Figure 11(a), the weight of \(\varepsilon_{goal}\) is set as the predominant weight at the beginning. As the agents approach the goal point, the weight of \(\varepsilon_{obstacle}\) of the Agent 1 and Agent 2 gradually increases before the 75 th iteration, and the weight of \(\varepsilon_{obstacle}\) is set as the predominant weight until the 95 th iteration. Corresponding to Figure 13(c), the minimum obstacle distance of Agent 1 and Agent 2 is also in this iteration interval, so the agents avoid obstacles first. Then, when Agents 1 and 2 escape the collision threat, the weight of \(\varepsilon_{obstacle}\) gradually decreases, whereas the weight of \(\varepsilon_{goal}\) gradually increases. For Agent 3, since the weight of \(\varepsilon_{goal}\) is always set as the predominant weight, it is more likely that the Agent 3 will not be collided during operation. As for Agent 4, the weight of \(\varepsilon_{obstacle}\) gradually increases since the 59 th iteration, and reaches the maximum at the 91 st iteration. It is noticeable from Figure 13(c) that Agent 4 reaches the smallest collision position at the 91 st iteration. The agent needs to avoid obstacles first, and then fly to the goal, so the weight of \(\varepsilon_{obstacle}\) is the maximum. It can be seen from Figure 13(d) that as the minimum obstacle distance is far longer than the safe distance of 0.3m, the distance between the agents is safe. Therefore, in Figure 14(b), the weight of the reward value slightly fluctuates. In the process of approaching the goal, the weight of the \(\varepsilon_{speed}\) and \(\varepsilon_{obstacle}\) gradually decreases, while the weight of the \(\varepsilon_{goal}\) gradually increases. When approaching the goal, the weight of the \(\varepsilon_{speed}\) and \(\varepsilon_{obstacle}\) reaches the minimum, but the weight of the \(\varepsilon_{goal}\) reaches the maximum. The analysis of the parameter changes shows that DF_DWA is effective, because the weight of the reward value can be adjusted with the change of the environment, thereby ensuring the safety of the agent's trajectory. Compared with DW4 DO [15], DF_DWA can ensure the smoothness of operation by moving obstacles in advance.