# An Efficient Parallelization of Microscopic Traffic Simulation
## 2 Architecture and Processes
### Vehicle Model  
Vehicles are represented by arrays such as position and speed which are stored in the global GPU memory, see Table 2 for a detailed list. These vehicle states are updated during each simulation step, based on the lead vehicle behavior and constrained by red lights and its position on the current edge and segment. Each vehicle follows a route, which is a sequence of network edges. The vehicle control follows the following basic principles: (1) The vehicle's acceleration is governed by the Intelligent Driver Model (IDM) [19], which allows the driver to achieve a desired speed, as well as to maintain a safe target headway to the lead vehicle ahead. The used control parameters are shown in Table 3. (2) If the vehicle does not \"see\" a lead vehicle ahead, then the desired speed of the vehicle is set to the minimum of the allowed edge speed and the maximum vehicle speed. (3) In case a leader is assigned, the vehicle tries to converge to a desired time headway to the leader, and the desired speed is the speed of the leader. (4) In case the leader changes speed abruptly, such that the following vehicle \begin{table}
\begin{tabular}{l l} \hline \hline
**Domain** & **Arrays** \\ \hline \multirow{2}{*}{Vehicle states} & Position, speed, edge and segment index, lane index, route pointer, route array, odometer, and \\  & leader references. \\ \multirow{2}{*}{Network} & Segment lengths, geometry vectors, offsets, speed limits, and forward edge tree. \\ \multirow{2}{*}{Control structures} & Route matrices, lane queues, vehicle-linked lists, red-light masks, and occupancy maps. \\ Traffic control data & Times, phase indices, and program offsets for each traffic light. \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Arrays of the global memory. Figure 1: Scheme with the basic elements and quantities of the parallelized simulation model. (**a**) Network representation: Each edge is subdivided in one or several segments in the longitudinal direction and lanes in the transversal direction. Note that the follower vehicle 2 is able to look ahead and recognize the distance to vehicle 1. (**b**) The quantities necessary to calculate the vehicle acceleration using the IDM vehicle following model, as explained in Section 2.2.  
would \"crash\" into the leader when applying the acceleration from the IDM model, then the follower would instantly adapt to the speed of the leader, regardless of the acceleration this maneuver may cause; this means the follower cannot crash into or overtake its leader. This is an important property as it prevents data inconsistencies. When a vehicle surpasses the end of a segment, it gets place on the next road segment. When a vehicle has arrived at the end of the edge, there are three cases to consider: (1) The vehicle looks into the next edge on its route and checks if there is a sufficiently large gap to allow a safe transition to the next edge; in case the next edge has multiple lanes, then the lane with the largest initial gap is chosen; if a sufficiently large gap has been found, then the vehicle transitions to the next edge and looks at the last vehicle on the chosen lane of the next edge. (2) If no sufficiently large gap can be found on either lane of the next edge, then the vehicle does not transition but stops instantly. (3) If the current edge is controlled by a TLL and the edge is in a red phase, then the vehicle will see a \"ghost leader\" at zero speed, positioned at the end of the edge. The ghost leader is a vehicle that is generated by the algorithms to make simulated vehicles adapt their speed or stop--it is used to set a dynamic or static target. A synchronization algorithm has been put in place, attempting to sequentialize those vehicles running on edges that converge toward the same junction: if a vehicle, positioned on any of the incoming edges, reaches a predefined distance from the downstream junction, then it is appended to a common FIFO queue and the previously last vehicle in the queue becomes the new leader of the newly entered vehicle.