# Calibrating Microscopic Traffic Simulation Model Using Connected Vehicle Data and Genetic Algorithm
## 4 Results
### Calibration Results  
This study conducted 32,000 simulation runs to calibrate the network (200 generations, 32 populations per generation, and 5 runs per population). Each run used a warm-up period of 300 s and stopping criteria based on simulation duration. To account for variability, the five runs per population were conducted using different random seeds, which altered the arrival times and distribution of non-connected vehicles. However, for connected vehicles, the script consistently placed them at the same starting point and time to ensure consistency in their trajectories. All runs were performed under a single demand scenario, representing peak-hour traffic conditions, as described in Section 3.6. of the paper. It took around 616 h to complete the simulations, with each generation taking approximately 3 h. With nine clients on duty most of the time, each replication took approximately 5 min on average at the fastest possible speed. Figure 5 illustrates the results of the Genetic Algorithm. In this graph, the vertical axis represents the lowest median error of all populations for each generation. At each population, the median error across five simulation runs was calculated, and the best (lowest) error from all populations was selected as the representative result for that generation. The horizontal axis shows the generations of the GA. This graph indicates that the procedure found the optimal parameter settings and effectively reduced the discrepancies between the simulation trajectories and the actual world. Moreover, most of the reductions in errors occurred in the first quarter of the iterations, indicating that the process found the optimal solution faster than expected. Figure 6 shows time-space diagrams (TSDs) for three randomly selected vehicles out of the 338 connected vehicles in the dataset that can be matched with the Wejo trajectories. The selection was conducted randomly without bias to ensure typical results were represented. In these diagrams, vehicles are represented by lines, where steeper slopes correspond to slower speeds. The left-hand side TSDs illustrate the trajectory differences before the calibration process, while the right-hand side ones show the trajectory differences after the calibration process for the same vehicle. Improved alignment of the simulated vehicle trajectories with the ground truth trajectories, as seen in the right-hand side diagrams, demonstrates the effectiveness of the calibration process in making the simulation more representative of actual traffic behavior. Table 3 details the total errors before and after the calibration process. Based on the provided statistical analysis, several insights emerge that highlight the effectiveness of the calibration process. Initially, the mean error decreased from 208.53 m\(\cdot\)min to 178.94 m\(\cdot\)min, reflecting a 14% decrease in mean error, indicating an improvement in overall accuracy. The median error, which represents the midpoint of error distribution, also saw a notable reduction from 131.56 to 107.53 m\(\cdot\)min, indicating that at least half of the error values are now significantly lower and signify more consistent performance across different traffic conditions. The standard deviation, which measures the range of error values, went from 236.58 to 222.66, indicating that errors are more consistent after calibration. The minimum and maximum errors also improved, with the maximum error reducing from 2249.19 to 2170.08, which suggests a reduction in the most extreme cases of error.