# Traffic Congestion Detection System through Connected Vehicles and Big Data
## 4 Evaluation
### Simulation Model  
To validate the traffic detection algorithm, the vehicular flow was simulated in the proposed evaluation scenario using SUMO, in which the corresponding vehicular flows during peak times were programmed. Additionally, the traffic light intervals were also programmed in the SUMO simulation. The programmed scenario is shown in Figures 13 and 14.  
Because of the large number of vehicles in circulation during peak hours, congestion is often generated at traffic lights. Consequently, multiple traffic congestion was generated to better validate  
Figure 14: Amplification of the intersection scenario programmed in SUMO.  
Figure 13: Complete scenario programmed in SUMO.  
the traffic detecting algorithm using the OMNET++ simulator, coupled with the SUMO mobility simulator and the Veins framework. The generated traffic congestion was programmed using a range of different vehicles at different points of the scenario. In this way, we could observe the behavior of the algorithm and count the number of traffic alerts generated in relation to the number that were programmed, as well as false alerts attributable to the number of vehicle with an OBU. A total of 236 vehicles were used in the simulation because _in situ_ observations established this was on average, the number of cars causing traffic congestion in the real-world study area. In the first test, 118 of the vehicles had an OBU, represent 50% of the total of vehicles. In the second test, only 24 vehicles possessed an OBU, representing 10.1% of the vehicle total.  
Vehicle connectivity was programmed using the Veins Framework, the OMNET ++ discrete event simulator and the LORA-CBF algorithm, as shown in Figure 9. The above-mentioned framework was used to simulate the route monitoring algorithm proposed in Figure 8. Each vehicle was assigned a pre-established route assessed by the route monitoring algorithm to define route changes, depending on the results of the traffic congestion detection algorithm proposed in Figure 7. If congestion was present along the route, the route monitor algorithm using the Veins Framework informed the SUMO mobility simulator it needed to change the route, allowing vehicles to avoid congestion detected by the traffic detection algorithm.  
To validate the traffic detection algorithm sent to the big data cluster, it must first communicate vehicle data provided by the simulation in real time. This program was generated in C++ and emulates part of the operation of the RSU, which is responsible for communicating the big data cluster and RSU simulator and functions as a gateway between the simulators and the big data cluster. To achieve RSU transmission of data sent to the big data cluster, we developed a communication channel between the simulation and the big data cluster through UNIX pipes. The communication channel sends and receives bi-directional information from both the vehicles and the big data cluster, sending and receiving information from the RSU emulator through web services. Following this, the RSU inputs the data received from the vehicles and consults the traffic alert information every 4 minutes. Figure 15 shows the conceptual operation of the RSU emulator.