## 5 Simulation Results
### The Base Active Algorithm  
Even using the most efficient and optimized algorithms for vehicle routing, internal combustion engine (ICE) vehicles will always have to burn fuel and emit CO\({}_{2}\) when crossing the intersection. Therefore, it is useful to estimate what would be the best possible achievable reduction in CO\({}_{2}\) for this scenario, to have a reference that active algorithms can be compared with. The best possible results would be achieved if all the vehicles could traverse the intersection without being blocked by a red traffic light. Of course, this scenario is not feasible in the real world, but it can be simulated, by running the two concurrent traffic flows one at a time and keeping the respective traffic lights always green. This was performed, and the combined results for the CO\({}_{2}\) emissions were 193 g/km, which means that the maximum reduction in emissions that an optimized algorithm can obtain is about 39%. However, this limit would only be achievable if the traffic flows were perfectly nonconcurrent and synchronized, something which is highly improbable in the real world. One design requirement for the active routing algorithm is that it can only use information able to be gathered by a real system, using cameras or other sensors, so that it can be deployed in the real world if needed. Therefore, the algorithm only has access to the number of cars that are approaching the intersection, their position, and their speed; all these data can be obtained by cameras. The algorithm has no access to the category of a vehicle, its fuel type, or other vehicle-specific characteristics. The vehicle visibility is also confined to the 150 m of each lane near the intersection. The base active algorithm follows a typical approach that decides based on the estimated costs of all the options. In this use case, there are two major traffic flows, and the algorithm is continuously computing the cost of stopping each traffic flow. When the cost of keeping the stopped traffic flow blocked is higher than the cost of stopping the active traffic flow, a switch in the traffic lights is initiated. The cost of each traffic flow is calculated with Equation (3). \[\text{Cost}=\sum_{\text{lanes vehicles}}\text{J}+\text{Kv}^{2} \tag{3}\]  
v: vehicle speed in m/s  
J,K: constants  
The J and K constants are used to model the weight given to the simple presence of a vehicle (constant J) and to its kinetic energy (constant K) to the overall cost. As a matter of fact, from the CO\({}_{2}\) emission perspective, the cost of blocking a lane with moving vehicles is expected to be higher than blocking a lane with stopped or slow vehicles, because stopping moving vehicles wastes kinetic energy that needs to be restored later by burning fuel when the vehicles re-accelerate. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline  & **Total Travel** & **Average** & **Waiting** & **Total CO\({}_{2}\)** & **Average CO\({}_{2}\)** \\  & **Distance** & **Speed** & **Time (Car \(\times\)** & **(kg)** & **Emissions** \\  & **(km)** & **(km/h)** & **Second)** & **(kg)** & **(g/km)** \\ \hline Average & 221.48 & 17.26 & 23,243.1 & 70.57 & 318.6 \\ St Deviation & 0.77 & 0.16 & 330.34 & 0.82 & 3.24 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Average results of a 10-round simulation with the normal traffic profile. The algorithm has safeguards to prevent a traffic flow being blocked or allowed for an unreasonable amount of time. Hence, both traffic flows are enforced with a minimum allowed time of 10 s and a maximum allowed time of 180 s, values that were considered reasonable. These limits have priority over the decision based on costs. This algorithm was tested, keeping the constant K = 1 and varying J from 1 to 1000, in logarithmic steps. A low value of J means that the cost depends almost exclusively on the vehicles' speed whereas a high value of J means that the cost depends mostly on the number of vehicles in the traffic flow, regardless of their speed.