# An Intersection Signal Control Mechanism Assisted by Vehicular Ad Hoc Networks
## 3 Intersection Signal Control Mechanism
### Waiting Time at a Future Moment  
In the decision-making process, the control system first assumes that signals for all traffic flows are red lights. Then, based on the real-time information of far vehicles and intersection vehicles (i.e., vehicles within the intersection area), it can calculate the waiting time (\(T_{s}\)) at a future moment  
Figure 3: Abstraction of signal phases at the intersection: (a) urban intersection diagram and (b) the 12 combinations of traffic flows.  
(\(t_{f}\)) for each vehicle. Note that in this paper, the waiting time of vehicle means the duration from the moment of vehicle's first stop due to the red light or the front waiting queue to \(t_{f}\), i.e., how long the vehicle will have waited for. Furthermore, the waiting time of each traffic flow (\(WT_{i}\)) can be calculated cumulatively.  
For vehicle \(j\) that has stopped in the intersection area before the current time (\(t_{c}\)), it is easy to compute its waiting time (\(T_{d}^{j}\)) at a future moment \(t_{f}\) using Equation (4):  
\[T_{d}^{j}=T_{Is}+\big{(}t_{f}-t_{c}\big{)}, \tag{4}\]  
where \(T_{Is}\) is the length of the time that the vehicle has been waiting for up to the present moment. Furthermore, using visual information gathering, the average single-lane queue length (\(len_{i}\)) of each traffic flow can be easily obtained as well.  
For unstopped intersection vehicles (i.e., their velocities are greater than 0) and far vehicles, we need to further estimate their positions and states at \(t_{f}\) (i.e., whether they have stopped and entered the waiting queues) according to existing collected information. First, we use their real-time velocities (\(v^{t_{c}}\)) and positions (\(pos^{t_{c}}\)) at \(t_{c}\) to calculate the positions of all vehicles for the next unit time (\(pos^{t_{c}+1}\)) according to:  
\[pos^{t_{c}+1}=pos^{t_{c}}+v^{t_{c}}\times\Delta t, \tag{5}\]  
where \(\Delta t\) is the unit time for calculating. Furthermore, considering that the vehicle wants to stop at the tail of the front queue, a deceleration process is required in advance. If at the moment of \(t_{c}+1\), \(pos^{t_{c}+1}\) has entered the general deceleration range, the value of its velocity at the next unit time (\(v^{t_{c}+1}\)) is adjusted according to its deceleration (\(dec\)):  
\[v^{t_{c}+1}=\begin{cases}v^{t_{c}}&pos^{t_{c}}+\big{(}\frac{v^{t_{c}+2}}{2 dec} \big{)}\leq qlen\\ v^{t_{c}}-dec&pos^{t_{c}}+\big{(}\frac{v^{t_{c}+2}}{2 dec}\big{)}>qlen\end{cases}. \tag{6}\]  
In addition, if \(pos^{t_{c}+1}\) falls within the range of the front queue in the traffic flow that the vehicle belongs to (i.e., \(pos^{t_{c}+1}>qlen_{i}\)), it is determined that it has stopped and entered the queue. Then, that time is considered its stop time (\(t_{s}^{j}\)), and the waiting time at \(t_{f}\) of vehicle \(j\) can be calculated using:  
\[T_{d}^{j}=t_{f}-t_{s}^{j}. \tag{7}\]  
Besides that, we need to update the average single-lane queue length of the corresponding traffic flow (\(qlen_{i}\)). The vehicle length (\(clen\)) and the safe stopping distance (\(sd\)) should be considered. The new average length of the flow can then be calculated as follows:  
\[qlen_{i}=qlen_{i}+\big{(}clen^{j}+sd\big{)}/n_{i}, \tag{8}\]  
where \(n_{i}\) is the number of lanes that belong to the \(i\)th traffic flow at the intersection. If \(pos^{t_{c}+1}\) does not fall within the range of the front queue, i.e., \(pos^{t_{c}+1}\leq qlen_{i}\), we need to continue to calculate its position at \(t_{c}+2\) (i.e., \(pos^{t_{c}+2}\)) based on the last value, update its velocity according to Equation (6), and judge whether it has stopped.  
Finally, the sum of the cumulative waiting time of all stopped vehicles is calculated for each traffic flow until the time \(t_{f}\) using:  
\[WT_{i}=\sum_{j=1}^{qn_{i}^{t_{f}}}T_{d^{\prime}}^{j} \tag{9}\]  
where \(qn_{i}^{t_{f}}\) is the number of vehicles in flow \(i\) that have stopped at \(t_{f}\).