## 5 Optimization Results  
This section shows the UAV trajectory after optimization under different conditions. The parameters used in these numerical results and their corresponding values are listed in Table 2. The parameter settings follow the practical scenario. For example, the visibility range in fog follows the research on weather effects on FSO communication [46]. The selected laser type is 1550 nm wavelength that most FSO scenarios use [47], we take \(h_{l}=0.91\) for weak turbulence when the wind is not strong for this type of laser [48; 49]. The UAV settings follow the civil aviation law [50] of height limitation and flight performance of consumer drones [51]. Based on [36; 37], we also set the minimum and maximum height of the UAV as \(H_{l}=60\) m and \(H_{h}=90\) m, and the maximum speed of the UAV as 1.5 m/s (Note: To simplify the optimization problem, as in [21; 22; 25; 52], the acceleration of the UAV is not considered in this paper, we note that it is affected by the minimum and maximum velocity and total flight times). We use a decode-and-forward (DF) relay-assisted FSO system as a comparison benchmark to show the performance gain of the proposed scheme. We assume that the UAV has both FSO PD and transmitter function, each hop's pointing error is modeled with a circular beam footprint, and the misalignment is set as zero between footprint and PD, which will provide the best case for the benchmark scenario, which also shows the comparison if the results of PSO is not obtained precondition for trajectory optimization. Moreover, the deep Q-network (DQN) is utilized as the trajectory optimization benchmark in this paper. Figure 5 compares the trajectories under RIS and DF scenarios without fog effect with the different flight times. It is shown that the UAV operating the flight with maximum speed reaches the area with maximum capacity under both RIS and DF scenarios. The average \begin{table}
\begin{tabular}{c c} \hline \hline
**Parameter** & **Value** \\ \hline Visibility range clean/fog & 200/0.3 km \\ \hline Transmitting power & 45 dBm \\ \hline LS coordinate & (0, 0, 0) m \\ \hline PD coordinate & (0, 100, 0) m \\ \hline Laser wavelength & 1550 nm \\ \hline Receiver radius & 0.05 m \\ \hline Detector responsivity & 0.5 \\ \hline Atmospheric turbulence & 0.91 \\ \hline UAV height limitation & 60–90 m \\ \hline UAV velocity limitation & 1.5 m/s \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Simulation Parameters. capacity of PPO-based trajectory in the 150-time slots is 4.05 bits/s/Hz. Due to the reduction in flight times, the UAV could not fly to the optimal location to achieve the maximum capacity. Therefore the average capacity with 100-time slots is 3.91 bits/s/Hz for PPO. Furthermore, we calculated the average capacity of the DF relay trajectories under zero misalignment pointing error in the 150 and 100-time slots, which are 2.64 bits/s/Hz and 2.52 bits/s/Hz, respectively. In Table 3, the comparison results demonstrate the average capacity of the proposed RIS-assisted FSO system outperforms that of the DF relay-assisted system significantly. Moreover, compared with the benchmark DQN, the proposed PPO-based trajectory optimization achieves a higher transmission rate. This result verifies that PPO could avoid overestimation for efficient convergence to obtain better performance. Figure 6 shows the trajectories when fog with radius \(r_{f}=15\) m with 150, 100, and 50 time slots flight time. The UAV is operating the flight tendency to avoid the fog, which also passes close to the zone and dives to the lowest altitude to obtain the maximum value of average capacity. Therefore, the avoidance and diving action of the PPO-based optimization brings the average capacity to 3.92 bits/s/Hz and 3.77 bits/s/Hz for 150 and 100 time slots, respectively, while DQN only achieves 3.77 bits/s/Hz and 3.64 bits/s/Hz, respectively.