# Simulation-Based Evaluation of V2X System with Variable Computational Infrastructure
## 3 Materials and Methods
### Simulation System
Python, with its powerful geospatial analysis libraries, was chosen for processing OSM data. Initial location data extraction is performed with Python code utilizing the osmnx library, simplifying the download and processing of OpenStreetMap data. The following Python code snippet demonstrates this data extraction process:  
* Define the location place_name = \"Manhattan, New York City, New York, USA\" G = ox.graph_from_place(place_name, network_type='drive')
* Extract data nodes, edges = ox.graph_to_gdfs(G, nodes=True, edges=True)
* Save data nodes.to_csv(\"nodes.csv\") edges.to_csv(\"edges.csv\")
* The extracted files contain the following columns:
* nodes.csv: osmid, y, x, highway, street_count, ref, geometry
* edges.csv: u, v, key, osmid, name, highway, maxspeed, oneway, reversed, length, geometry, lanes, ref, access, bridge, tunnel, width, junction Godot provides the Path2D element, which is suitable for this task. It connects points (nodes) to form roads. Subsequently, PathFollow2D can be used to move vehicles along these Path2D elements, as detailed below. This process resulted in the map depicted in Figure 4, with a scale of 1 m to 1 pixel. Camera adjustments within the scene enable map zooming. The figure also presents a zoomed-in section of the map. The round objects represent RSU units, while the lines indicate connections with the infrastructure (OBU, mRSU, RSU, and EC). Different colors represent different connections to an observed unit. This visual representation helps to better understand the established connections. The chosen approach offers flexibility by enabling users to create custom maps and utilize them within the traffic flow simulation environment. We utilize PathFollow2D in Godot to represent vehicles, treating the path (Path2D) as a continuous straight line, even with multiple points and curves. For clarity, such \"paths\" will be referred to as sections, and the combination of sections will be a route. By obtaining the length in pixels, we move the object along the \"straight line\" at a set speed. We assume an average speed of 30 km/h, which translates to approximately 8.5 m/s. With a 1:1 ratio, vehicles move at 8 and 12 pixels per second. A vehicle's route from one point to another consists of a set of sections (Path2D) determined using the A* algorithm [52]. Thus, a vehicle initially has the shortest route to its destination. Vehicle movement alone is insufficient for simulation (Figure 5). We must also account for the fact that these vehicles generate traffic. For simplicity, vehicles cannot overtake each other and may experience congestion if the leading vehicle stops. Upon entering a new section (Path2D), the following algorithm is executed: For every vehicle within the current section, we determine its location as the distance traveled from the section's start. If the distance allows for a transition, the vehicle moves to the next section and continues at its set speed, maintaining a set distance from the preceding vehicle. If the distance is insufficient, the transition does not occur. Vehicles spawn at their route's starting point. Upon reaching their destination, they randomly select a new destination and continue moving. RSUs are crucial system components. Their implementation in the software must consider not only their physical properties, adhering to the IEEE 802.11 bd standard [51] but also their placement on the map. Figure 4: Graph mapping (MAP). The RSU operation and OBU interaction algorithm is as follows: Using an Area2D element, a monitored zone is established. When an OBU enters this Area2D, it is considered within the coverage area and capable of data transmission. Accurate simulation also requires incorporating distance-based attenuation and accounting for data loss. Information transmitted by the RSU can be classified as either useful or overhead. Useful information consists of commands for the OBU, while overhead information constitutes a specific volume of bits. If messages need to be sent, the RSU allocates transmission speed equally among connected OBUs.