# Automatic Generation System for Autonomous Driving Simulation Scenarios Based on PreScan
## 1 Introduction
Additionally, PreScan stands out for its flexibility in modifying environmental conditions, such as weather and lighting sources. This adaptability enhances the realism and variability of simulation scenarios, making it a valuable tool in the development and testing of autonomous driving systems. Therefore, a large number of scenario testing articles choose PreScan as their simulation software [24; 25]. This paper addresses several challenges identified in the previously proposed methods. These include difficulties in identifying effective, available scenarios, challenges in scenario data collection and processing, and the low degree of automation in manually constructed scenarios. This paper proposes an autonomous driving SG system based on PreScan, taking the Phase I as an example, and first constructing a static scenario by using PreScan [26]. On the basis of this, this paper uses the PreScan API and C++ to build a dynamic scenario and obtain the element class, by analyzing this class, we express the element as parameter. These parameterized elements are then organized and displayed in the user interface. Finally, we use WebSocket to establish a connection between the front-end and back-end, facilitating the automated creation of autonomous driving scenarios via front-end parameter input. System accuracy and speed were verified, demonstrating that it is more accurate than manual construction. The system's speed is nearly 2.5-fold higher than manual methods. Additionally, it can generate concrete scenarios tailored to testing needs, thereby avoiding the complexity of scenario screening. This paper is divided into five chapters. Section 1 serves as an introduction, providing the context for SG and discussing the relevant work of this system. It highlights the challenges and shortcomings in existing research, and outlines the innovative aspects of this paper. Section 2, scenario construction methodology based on PreScan, presents the dynamic scene generation based on PreScan, which lays the software foundation for this system. Section 3, automatic system design, elaborates on the system design process, architecture, and individual components. Section 4, testing and simulation, uses three subsections--accuracy verification, rapidity verification, and generation results--tocompare and validate the advantages and functionalities of this system. Section 5, conclusion, summarizes the system's capabilities and contributions and offers a perspective on future work. Our main contributions can be articulated as follows:  
* Innovation in the Generation of Scenarios: We have innovated the method of SG, avoiding the repetitive nature of manual construction and introducing a novel system of automation. This development addresses the complexities associated with the selection of scenarios. * Classification and Combination of Scenario Elements: The methodology proposed in this paper classifies and combines scenario elements to enhance programming efficiency and reduce complexity. With the implementation of new parametric expressions introduced herein, a more intuitive distinction between specific scenarios is facilitated. This provides fresh perspectives for SG and representation. * Utilization of PreScan for Scenario Visualization: Our approach leverages PreScan for the presentation of simulation scenarios, thereby allowing test personnel to directly observe and test within the simulation software. This obviates the need for test personnel to perform the step of data simulation, thereby conserving effort and time.