# A Microscopic On-Ramp Model Based on Macroscopic Network Flows
## 2 Methods
### Model Evaluation  
For the model evaluation, we prepared the simulated traffic data in the same structure as the real traffic data. The simulation results contain information about each vehicles' category, size, location, speed, and acceleration, with the latter three being recorded every 0.2 s. The location information is given in SUMO's global coordinate system.  
When vehicles on the main lane approach the on-ramp, they might adjust their behavior for a smoother flow, extending the available gap to help vehicles to merge onto the motorway. Therefore, we looked at the speed and acceleration profiles, the lane changes, and the risky interactions in the different scenarios to validate the performance of the microscopic model in reproducing the real traffic data and in comparison to the IDM. The location of the lane changes and the changes in speed and acceleration along road sections can indicate how well a traffic model simulates traffic on the microscopic level. For an insight, we created 5 m long sections on each lane to calculate the average local speed and average local acceleration values. Similarly, we created 20 m long sections where we counted the number of lane changes.  
On motorways, vehicles are mostly involved in rear-end conflict. In those cases, the application of surrogate safety measures to evaluate an interaction seems straightforward: There is a leader and a follower vehicle involved travelling behind each other in this explicit order. However, while changing lanes, often it is ambiguous which vehicle will take the 'leading' role. The determination of vehicle order or even the prediction of involvement of vehicles on the target lane becomes even more difficult when acceleration behavior is considered. Usually, vehicles accelerate on entry lanes and decelerate on main lanes for smoother merge. To overcome the complexity of vehicle pair prediction in lane-changing situations, we defined vehicle pairs from the moment the position of the changing vehicle's left or right corner (assuming a rectangularly shaped vehicle) crossed the lane marking, even though its center point was still on the original lane. This predicts the gap in which the changing vehicle is most likely going to merge.  
We used modified Time-to-Collision to evaluate vehicle interactions from the safety point of view. Time-to-Collision (TTC) is one of the most widely used surrogate safety measure, which calculates the nearness to a collision in seconds based on the actual speed and initial net distance of following vehicles, supposing that none of the vehicles would change their course [42]. The modified version of TTC, MTTC, was developed in [43] and additionally takes into account the initial acceleration behavior of both interacting vehicles, leading to a more realistic estimation. MTTC is defined as the smallest real and positive t such that  
\[\frac{1}{2}a_{\mathrm{L}}t^{2}+v_{\mathrm{L}}t+x_{L}=\frac{1}{2}a_{\mathrm{F}} t^{2}+v_{\mathrm{F}}t+x_{\mathrm{F}}-\frac{L_{\mathrm{L}}+L_{\mathrm{F}}}{2} \tag{11}\]  
holds or as infinity if no such t exists.  
We calculated MTTC between vehicle pairs in car-following and lane-changing situations as described above every 0.2 s. After determining the gap a lane-changing vehicle would merge into, we calculated the collision point based on the current collision angle [44]. To see the development of risky interactions along the road, we calculated the average MTTC under 3 s with respect to the predefined 20 m long sections. Therefore, we assigned a leader-follower pair to the road section corresponding to the current position of the follower and took the minimal MTTC of that pair during the time the follower drove in that section. Then, for each road segment, the average over these values if under or equal to 3 s was computed.