# Non-Compliant Behaviour of Automated Vehicles in a Mixed Traffic Environment
## 3 Implementation of Automated Driving Functions in Microscopic Simulation
### Trajectory Planning Algorithm
(*) denotes that the quantity refers to the surrounding vehicle in the target lane (see Figure 1)\[1(t=t_{0})=1_{0},\quad v_{lat,\,0}(t=t_{0})=v_{lat,0},\quad a_{lat}(t=t_{0})=a_{lat,0} \tag{2}\] \[1(t=t_{f})=1_{f},\quad v_{lat,\,f}(t=t_{f})=v_{lat,f},\quad a_{lat}(t =t_{f})=a_{lat,f}\] \[C_{1}=\frac{60(a_{lat,\,0}-a_{lat,\,f})t_{f}^{2}+360(v_{lat,\,0}+v _{lat,\,f})t_{f}+720(1_{0}-1_{f})}{t_{f}^{5}}\] (3) \[C_{2}=\frac{12(3a_{lat,\,0}-2a_{lat,\,f})t_{f}^{2}+24(8v_{lat,\,0} +7v_{lat,\,f})t_{f}+360(1_{0}-1_{f})}{t_{f}^{3}}\] \[C_{3}=\frac{3(3a_{lat,\,0}-a_{lat,\,f})t_{f}^{2}+12(3v_{lat,\,0} +2v_{lat,\,f})t_{f}+60(1_{0}-1_{f})}{t_{f}^{3}}\] \[C_{4}=a_{lat,\,0},\quad C_{5}=v_{lat,\,0},\quad C_{6}=1_{0}\]  
The longitudinal movement s(t) of the vehicle is calculated by a fourth-degree polynomial:  
\[s(t) =\frac{1}{24}C_{1}t^{4}-\frac{1}{6}C_{2}t^{3}+\frac{1}{2}C_{3}t^{2 }+C_{4}t+C_{5} \tag{4}\] \[v_{long}(t) =\frac{1}{6}C_{1}t^{3}-\frac{1}{2}C_{2}t^{2}+C_{3}t+C_{4}\] \[a_{long}(t) =\frac{1}{2}C_{1}t^{2}-C_{2}t+C_{3}\] \[1(t=t_{0})=1_{0},\quad v_{lat,\,0}(t=t_{0})=v_{lat,0},\quad a_{lat}(t=t_{0})=a_{lat,0} \tag{2}\]0 \[1(t=t_{0})=1_{0},\quad v_{lat,\,0}(t=t_{0})=v_{lat,0},\quad a_{lat}(t=t_{0})=a_{lat,0} \tag{2}\]1 \[1(t=t_{0})=1_{0},\quad v_{lat,\,0}(t=t_{0})=v_{lat,0},\quad a_{lat}(t=t_{0})=a_{lat,0} \tag{2}\]2  
One obtains the longitudinal velocity and acceleration again by continuous derivation of s(t), as depicted in Equation (4). Together with the start and end condition of the trajectory (5), the vehicle movement in the longitudinal direction can be determined. \[1(t=t_{0})=1_{0},\quad v_{lat,\,0}(t=t_{0})=v_{lat,0},\quad a_{lat}(t=t_{0})=a_{lat,0} \tag{2}\]3 \[1(t=t_{0})=1_{0},\quad v_{lat,\,0}(t=t_{0})=v_{lat,0},\quad a_{lat}(t=t_{0})=a_{lat,0} \tag{2}\]4 \[1(t=t_{0})=1_{0},\quad v_{lat,\,0}(t=t_{0})=v_{lat,0},\quad a_{lat}(t=t_{0})=a_{lat,0} \tag{2}\]5  
Based on the polynomials and derivations, the trajectory planning module calculates one keep lane trajectory for each vehicle in the simulation and, in case of appropriate gaps in the adjacent lanes, also one lane-change trajectory to the left lane and one to the right lane. This set of trajectories is the output of the trajectory planning module. The gap acceptance evaluation for lane-change maneuvers is implemented in a sub-module of the trajectory planner, which was focused on in the study by [PERSON] et al. [41]. Due to its relevance for overall traffic efficiency, this approach is also examined in detail in the present study for the sake of completeness and clarity. Figure 1 illustrates the notation for all vehicles involved in a lane-change maneuver, with the lane-changing (ego) vehicle shown in gray. Additionally, the feature values used as input for the AV driving function are presented. The notation follows the conventions introduced by [PERSON] et al. [42]. To ensure a minimum safety margin during lane changes, safety distances are defined for both leading and lag vehicles on the target lane. These are computed based on the respective vehicle's velocity \(\mathrm{v_{ego}}\) or \(\mathrm{v_{lag}}\), a minimum time gap \(\mathrm{\tau_{min}}\), and a constant clearance term \(\mathrm{c_{min}}\) that accounts for standstill spacing.