# Data-Driven Test Scenario Generation for Cooperative Maneuver Planning on Highways
## 2 Materials and Methods
### Process  
The process of scenario generation is divided into the following phases: scenario extraction, pre-selection, strategic goal generation, and evaluation of cooperation. This process is repeated several times for every roadway characteristic of the dataset.  
In traffic data sets, vehicles are recorded as a continuous flow. In order to generate scenarios from this, consecutive sequences of vehicles must be extracted. Therefore, we place a reference line in the beginning of the recorded area (dashed line in Figure 1) and select the \(n\) next vehicles with \(n\) being the desired number of vehicles in the scenario. When one vehicle is replaced by another among the \(n\) next vehicles, a new scenario is created. In this way, the entire data set is processed into scenarios without duplicates and the maximum number of vehicles per scenario is set to 4. This upper limit of vehicles is restricted by the cooperative planner's exponential growth of computing time, which is described in detail in Section 2.4.2. If there are fewer than four vehicles in a recording frame, the scenario is extracted with the respective number of vehicles.  
In order not to simulate all extracted scenarios and thereby save computing time, a pre-selection filters out obviously irrelevant scenarios. This includes situations where the lowest time to collision [19] is greater than the duration of the simulation because no interaction is supposed to take place in the considered time period. In addition, scenarios extracted from bound or congested traffic states, which can be determined by an average speed of less than \(60\,\mathrm{km}\,\mathrm{h}^{-1}\) ([20], p. 88), are discarded because congestions can only be modeled with a large-scale traffic simulation and not with a small number of vehicles in a scenario-based approach.  
The remaining scenarios consist of a roadway model and the movement states of the vehicles in their starting position. In addition to the initial state, the vehicles must be given a strategic goal that the behavior models are to pursue in the subsequent simulations. Since the presented work only considers motorway-like roads without intersections or similar, the strategic goal is to drive at a given speed, also referred to as desired velocity. This speed is determined individually for each vehicle based on its respective state. If a vehicle has a leader, the desired velocity might be higher than the current speed due to the obstruction of the front vehicle. In this case, the desired velocity is set to the vehicle's maximum velocity throughout the entire recording. If a vehicle has no leader car, it is supposed to already drive at its desired velocity, which in this case is therefore set to the current speed.  
Starting from the initial state, the scenarios are simulated with the reference and the cooperative behavior planner. According to the concept described in Section 2.1, the maximum individual drawback as well as the overall cost benefit are determined by the results of the simulations. If a vehicle in the scenario performs a cooperative action and thereby accepts an individual drawback that leads to an overall cost benefit that is equal or higher than the cost drawback of the cooperating vehicle, the scenario is considered valid and relevant for testing cooperative behavior and thus added to the scenario catalog.  
Figure 1: Scenario extraction with four vehicles.  
The action that leads to the individual drawback of the cooperating vehicle and thereby causes the benefit for the surrounding vehicles is considered the main cooperative action. The extracted scenarios are clustered by their main cooperative action in order to generate a deeper understanding of the underlying cooperative mechanisms in highway road traffic.