## 6 Simulation Solution
### Changing Lanes in Obstructed Traffic Scenarios  
When there are traffic vehicles around, lane changing requires more consideration for safety. Assuming that the self-driving vehicle is traveling at a speed of 25 m/s in the self-driving lane, and the vehicles in the target lane and other vehicles in the self-driving lane are traveling at a constant speed, that is, the speed of vehicle M\({}_{0}\) in the self-driving lane is 25 m/s, and the speed of all vehicles in the target lane is 30 m/s. When the self-owned vehicle intends to change lanes, the feasibility of changing lanes will be determined based on the minimum safe distance. Assuming that at the beginning of the lane change, the longitudinal distance between the self-owned vehicle and the vehicle M\({}_{1}\) in front of the target lane is 20 m, the longitudinal distance between the self-owned vehicle and the vehicle M\({}_{2}\) behind the target lane is 30 m, and the speed of the vehicle M\({}_{1}\) in front of the target lane is higher than that of the vehicle M\({}_{0}\), there is generally no collision. When vehicle M\({}_{0}\) cruises with other vehicles, the safe distance between vehicle M\({}_{0}\) and vehicle M\({}_{2}\) is set to a minimum longitudinal distance of 3 m [29]. Based on the judgment of the safe distance for the previous lane change, after calculation, it is determined that the lane change can be carried out. In this case, due to the presence of traffic vehicles around, lane-changing efficiency is the primary consideration for safety reasons. By substituting the comfort demand weight vector \(W_{21}\), efficiency demand weight vector \(W_{22}\), and economic demand weight \(W_{23}\) vector in Equation (23) with the objective function weight (\(\beta_{1}\), \(\beta_{2}\), \(\beta_{3}\)) into Equation (19), and applying the particle swarm optimization algorithm, the optimal lane-change time in this scenario can be obtained. After three iterations, the objective function reaches convergence, and the optimal lane change time for comfort demand is 3.1 s, for efficiency demand is 2.8 s, and for economic demand is 2.5 s. Figure 7 is the simulation Scene graph diagram of the target lane change process, and Figures 8 and 9 are the iteration diagram of the particle swarm optimization algorithm and the solution diagram of the lane change time, respectively. Through Figure 8, it is proven that the PSO algorithm is effective at this time. In this case, except for the efficiency demand that remains unchanged from the previous situation, it can be seen from Figure 10a,b that the trajectory tracking and speed planning during the lane change process under other indicator demands are in line with expectations. From Figure 10c,d, it can be seen that the yaw rate and lateral acceleration are also within the expected range but generally increase compared to lane changes in obstacle-free scenarios. This is because in lane-changing scenarios with obstacles, we consider safety and lane-changing efficiency more. As a result, the lane change time becomes shorter and comfort decreases. Figure 7: Lane changing scene based on Carsim environment. Figure 10e shows the longitudinal distance between vehicle M\({}_{0}\) and the vehicle in front of the lane during the lane change time for each indicator demand. They did not collide. Within approximately 6 s, the M\({}_{0}\) in the target lane has exceeded the vehicle M1 in front of the original lane. From Figure 10f, it can be seen that after the vehicle stably changed lanes to the target lane, there was no collision with the vehicle before and after the target lane, and both were within the safe driving range. In summary, we can conclude that in the scene of traffic vehicles changing lanes with obstacles, the planned trajectory meets our expectations and can achieve safe, comfortable, and energy-saving lane changes that meet driving needs.