# Investigating a Toolchain from Trajectory Recording to Resimulation
## 2 Material and Methods
### Traffic Simulation
The behavioral model of Krauss describes an accident-free, location-continuous, and time-discrete modeling of following vehicles. The wish velocity \(v_{safe}(t)\) of the following vehicle is therefore dependent on the velocity of the leading vehicle as a function of time (\(v_{l}(t)\)), the distance to the vehicle ahead as a function of time (\(g(t)\)), the reaction time of the driver (\(\tau\)), the mean velocity of the following vehicle (\(\overline{v}\)), and a breaking term (\(b(\overline{v})\)). To generate error-prone driving, a randomly generated value \(\epsilon_{error}\) is subtracted from the accident-free chosen wish velocity \(v_{safe}(t)\). The maximum value for the deceleration of the vehicle ahead is estimated by the following vehicle. If the deceleration is greater than the estimated one, the own deceleration can exceed the wish deceleration. The equations for calculating the safety velocity of the following vehicle at each time are  
\[v_{safe}(t)=v_{l}(t)+\frac{g(t)-v_{l}(t)}{\frac{\overline{v}}{b(\overline{v}) }+\tau} \tag{1}\]  
\[v_{wish}(t)=v_{safe}(t)-\epsilon_{error} \tag{2}\]  
The behavioral model of [PERSON] describes lane changing with tactical and strategic properties. Strategic lane changes are necessary lane changes for maintaining the route chosen. Tactical lane changes can be done to increase the velocity. The decision for a tactical lane change is made in two steps. The first step is to check if the distance to the next linking point of the route is big enough for not missing it while making a lane change. The second step is to check if the advantage (\(A\)) of driving in the neighboring lane would be sufficient. This advantage is calculated by the difference between the possible velocity on the neighboring lane (\(v_{nb}\)) and the own velocity (ego velocity \(v_{ego}\)) on the current lane divided by the maximum ego velocity (\(max(v_{ego})\)). If this term is positive, there is an advantage to changing the lane. \[A=\frac{v_{nb}-v_{ego}}{max(v_{ego})} \tag{3}\]  
The threshold for an advantage that is sufficient can be chosen. If the term is negative, a lane change would be a disadvantage. Note that in the scenarios considered in this paper, this behavioral model does not play a major role. The parameters that were chosen to simulate the described scenarios with dynamic agents are parameters for setting up the route of the simulated agents (start positions, roads, lanes, velocities on lane) in the OpenScenario, parameters for defining the drivers properties and so the type of driver in the profiles catalog, parameters for defining the vehicles properties in the vehicle catalog, and rudimentary parameters for defining pedestrians in the pedestrians catalog. The parameters for sight distance and weather conditions in the slave configi file are set to a default value. The parameters to choose are given in Tables 1-3. In the vehicles catalog, many more parameters are defined, such as the gear ratio of the engine or the maximum torque, but it turned out that the simulation results are not sensitive to these parameters. In the profiles catalog, any number of driver profiles and vehicle profiles on the basis of the vehicles catalog can be defined. The combination of driver and vehicle is also defined in the profiles catalog as agent. Each agent has a unique name that is used for identification in the OpenScenario file. The chosen parameters for the profile catalog are shown in Table 2.  
The parameters in Table 3 have to be chosen for each simulated agent. In addition, it is possible to define stories for each agent to give them predefined trajectories or maneuvers, such as a lane change for some time or distance-dependent conditions in the simulation. Due to this feature of the OpenScenario standard, it is possible to recreate trajectories of vehicles virtually in a script by using OpenDrive and OpenScenario files alone, but without simulated interaction between the virtual vehicles. OpenPASS simulates these interactions via the included behavioral models.