# Optimization of Cellular Automata Model for Moving Bottlenecks in Urban Roads
## 2 A Cellular Automaton Model for Urban Roads Considering Vehicle Heterogeneity
### Vehicle Update Rules for Road Segments  
#### 2.2.1 Safe Distance Model  
As shown in Figure 2, when vehicles are traveling in the same direction, the prerequisite for a vehicle to accelerate, decelerate, or maintain its current speed is that there is a sufficiently safe distance between it and the vehicle ahead. To avoid collisions, the safety distance must be determined before updating the vehicle's speed. As shown in Figure 2, the leading and following vehicles are traveling in the same direction. In the case of an emergency, the leading vehicle performs an emergency brake and moves to the position of the dashed line, while the following vehicle also performs an emergency brake in response to the leading vehicle's deceleration, and finally both vehicles reach the position of the dashed line. Where \(L_{f}\) represents the braking distance traveled by the following vehicle; \(L_{l}\) represents the braking distance traveled by the leading vehicle; \(L\) represents the distance maintained between the following vehicle and the leading vehicle after braking; and \(L_{s}\) represents the safe driving distance. During the emergency braking of a vehicle, the relationship between the various distances can be expressed as follows:  
\[L_{s}=L_{f}+L-L_{l} \tag{1}\]  
\[L_{l}=v_{l}t_{l}-\frac{1}{2}a_{l}t_{l}{}^{2} \tag{2}\]  
where \(v_{l}\) is the driving speed before braking of the front vehicle; \(t_{l}\) is the braking time of the front vehicle; \(a_{l}\) is the braking deceleration of the front vehicle. In actual traffic situations, when the driver of the following vehicle notices the brake lights of the leading vehicle turning on and initiates braking, it takes four stages for the vehicle to complete deceleration: driver reaction time \(t_{r}\), vehicle brake coordination time \(t_{b}\), brake force build-up time \(t_{u}\), and continuous braking time \(t_{c}\). The process of decelerating can be expressed as follows:  
\[L_{f}=L_{r}+L_{b}+L_{u}+L_{c}=v_{f}(t_{r}+t_{b}+t_{u}+t_{c})-\frac{1}{2}a_{f} t_{c}^{2} \tag{3}\]  
where \(L_{r}\) is the braking distance traveled by the trailing vehicle during the driver's reaction time; \(L_{b}\) is the braking distance traveled by the trailing vehicle during the brake coordination time of the vehicle; \(L_{u}\) is the braking distance traveled by the trailing vehicle during the brake force increase time; \(L_{c}\) is the braking distance traveled by the trailing vehicle during the continuous braking time; \(v_{f}\) is the driving speed of the trailing vehicle before braking; \(a_{f}\) is the braking deceleration of the trailing vehicle. Figure 2: Illustration of vehicle-following process. Based on the above process, we will conduct a detailed analysis of the various distance relationships involved in the car-following process. By substituting Equations (2) and (3) into Equation (1), we obtain the following:  
\[L_{s}=v_{f}(t_{r}+t_{b}+t_{u}+t_{c})-\frac{1}{2}{a_{f}}{t_{c}}^{2}+\frac{1}{2}{a_ {l}}{t_{l}}^{2}-v_{l}t_{l}+L \tag{4}\]  
However, in actual traffic flow, Equation (4) is not completely accurate. If the acceleration of the two vehicles, such as a heavy-duty truck and a small car, differs due to their inherent performance, the shortest distance between the two vehicles may occur in a state where both vehicles are not stopped. Therefore, for heterogeneous traffic flow consisting of heavy-duty trucks and small cars, it is necessary to consider the change in distance between the two vehicles during each time period as they decelerate to zero speed. In the literature introduced in Section 1, Introduction, experts and scholars have conducted in-depth research on safety distance models. Therefore, the safety distance model presented in this paper is an extension and application based on existing safety distance models.