# Virtual Belt Algorithm for the Management of Isolated Autonomous Intersection
## 6 Virtual Belt Algorithm
### Online Algorithm
#### 6.2.2 Trajectory Planning
Taking derivation of Equation (6), the speed of the CAV can be expressed as  
\[v\left(t\right)=3\cdot q_{3}\cdot t^{2}+2\cdot q_{2}\cdot t+q_{1}. \tag{9}\]  
Taking derivation of Equation (9), the acceleration of the CAV can be expressed as  
\[a\left(t\right)=6\cdot q_{3}\cdot t+2\cdot q_{2}. \tag{10}\]  
It can be found from Equation (10) that the acceleration of the vehicle is a linear polynomial. Thus, \(a\left(t_{s}\right)\) and \(a\left(t_{e}\right)\) are the extreme values of acceleration. To limit the amplitude of acceleration, the following equations should be satisfied  
\[\left\{ \begin{array}{c}a_{min}\leq a\left(t_{s}\right)\leq a_{max}\\ a_{min}\leq a\left(t_{e}\right)\leq a_{max}\end{array} \right., \tag{11}\]  
where \(a_{min}\) and \(a_{max}\) are the lower and upper bounds of the acceleration of the CAV, respectively. As the speed of the CAV is a quadratic polynomial, there are three possible extreme values: \(v\left(t_{s}\right)\), \(v\left(t_{e}\right)\) and \(v\left(t_{z}\right)\). \(t_{z}\) is the time which satisfies \(\hat{v}\left(t_{z}\right)=0\). \(t_{z}=-\frac{q_{2}}{3\cdot q_{3}}\) can be obtained by solving  
\[\hat{v}\left(t\right)=0. \tag{12}\]  
If \(t_{s}<t_{z}<t_{e}\), the maximum and minimum speeds of the planned trajectory can be expressed as  
\[\left\{ \begin{array}{c}v_{p,max}=\max\left(v\left(t_{s}\right),v\left(t_{z} \right),v\left(t_{e}\right)\right)\\ v_{p,min}=\min\left(v\left(t_{s}\right),v\left(t_{z}\right),v\left(t_{e} \right)\right)\end{array} \right.. \tag{13}\]  
If \(t_{z}\leq t_{s}\) or \(t_{e}\leq t_{z}\), the maximum and minimum speeds of the planned trajectory can be expressed as  
\[\left\{ \begin{array}{c}v_{p,max}=\max\left(v\left(t_{s}\right),v\left(t_{e} \right)\right)\\ v_{p,min}=\min\left(v\left(t_{s}\right),v\left(t_{e}\right)\right)\end{array} \right.. \tag{14}\]  
To limit the speed of the planned trajectory, the following equation should be satisfied  
\[\left\{ \begin{array}{c}v_{p,max}\leq v_{max}\\ v_{min}\leq v_{p,min}\end{array} \right.. \tag{15}\]  
To avoid rear-end collisions with the front CAV, the following equation should be satisfied  
\[s_{f}\left(t_{i}\right)-s\left(t_{i}\right)\geq d_{s}, \tag{16}\]  
where \(d_{s}\) is the minimum distance to avoid rear-end collisions. \(s_{f}\) is the longitudinal position of the front CAV. \(t_{i,j=1,2,\cdots,n_{c}}\) is the time used to check potential rear-end collisions. \(n_{c}=t_{s}+i\cdot t_{\Delta}\) is the total count of collision checking time. \(t_{\Delta}\) is a small time interval. By solving Equation (8), \(q_{i,i=0,1,2,3}\) can be obtained and a trajectory described by Equation (6) can be determined. If the trajectory is within the constraints shown in Equations (11), (15) and (16), the trajectory can be used for the CAV to catch up with the corresponding candidate VG. The trajectory may be not satisfied with Equations (11), (15) and (16) simultaneously, which means the CAV is not able to track the selected candidate VG. And another candidate VG should be tested for that CAV using the trajectory planning method. In light of the priority-based trajectory planning [26], when planning the trajectory of a CAV in a straight lane, only the front CAV should be considered to avoid rear-end collisions. There is no need to plan the trajectories of CAVs in the same lane simultaneously. Using the trajectory planning method, the trajectories of waiting CAVs can be planned successively based on the first-in-first-service policy.