Smart Traffic Navigation System (STNS) to Reduce Travel Time by Integrating
10.5 Implementation
The two models incorporated in the simulator were the vehicle and the traffic signal.
10.5.1 Vehicle
Each vehicle maintains the following major properties:
1. nextTurn: This determines which direction the vehicle should travel to reach its destination as quickly as possible.
2. idleTime: Maintains the time the vehicle has spent waiting at traffic signals. This data is used by each traffic signal to assign priorities to its four edges. (Vehicles that have been idle longer are given higher priority)
3. isPriority: A simple Boolean that tells the traffic signals if the vehicle is a priority vehicle (like an ambulance/police vehicle) or a regular vehicle.
4. startTime, endTime: This is set when the vehicle reaches its destination and is used to determine the average travel time of all vehicles in order to tabulate the results of this proposed model against the existing timed signal model.
The navigation system determines the direction the vehicle should turn at the next traffic signal in order to reach its destination as quickly as possible. This navigation system usesDijkstra’s algorithmto do so.
The city’s roads are converted into a graph representation, where each road is an edge, and the traffic junctions are nodes. Since Dijkstra’s is a relatively expensive algorithm, this functionality is called only when it has to be, i.e., when a vehicle reaches the end of the road must know which direction it should turn.
Time Complexity=O(ElogV) (10.3)
Enumber of edges (roads),
V number of vertices (traffic junctions + endpoints).
Dijkstra’s algorithm also requires a weight to be assigned to each edge. In order to find the quickest path to the destination, this weight has to take into account two
106 S. Sripranav et al.
factors—the length of the road and the traffic on the road. To account for both of these factors, the weight of an edge is defined as
Weight=a+(b∗ number Of Vehicles On Road) (10.4) aconstant accounting for the length of the road,
bconstant accounting for the number of vehicles on the road.
A collision proof move function that enables the vehicle to move to the end of the road or until it detects a vehicle in front of it as shown in Algorithm 1.
A function that is called when the vehicle’s next turn matches the direction the traffic signal indicates. This enables the vehicle to make a collision proof turn to the next road.
10.5.2 Traffic Signal
Each traffic signal consists of the following major properties:
1. edges: An array of the four edges surrounding the signal. Each edge contains a list of all the vehicles on it. This gives the traffic signal a view of the vehicles on all of its sides, where each vehicle needs to go, as well as theidleTimeof each vehicle (how long each vehicle has been waiting at traffic signals).
2. priorityOrder: A property that defines what priority each of the four edges sur- rounding the traffic signal has with respect to each other. For example, if any of the edges contains a priority vehicle, that edge is automatically assigned the highest priority.
10 Smart Traffic Navigation System (STNS) to Reduce … 107 Table 10.2 Traffic states
North East South West
Straight Stop Straight Stop
Straight Stop Left Left
Left Left Straight Stop
Left Right Left Stop
Left Stop Left Right
Left Straight Stop Left
Left Left Left Left
Right Left Stop Left
Stop Left Left Straight
Stop Left Right Left
Stop Straight Stop Straight
Now that the each traffic signal has access to the state of the vehicles on its surrounding edges, it uses this data to determine which side gets a green light.
Each traffic signal assigns a priority order to its four surrounding edges based on each edge’s Total Idle Time:
Total Idle Time=Idle Time∀vehicles on that edge (10.5) The priorities are assigned in ascending order of total idle time, i.e., an edge with a higher total idle time will have a higher priority.
There are two exceptions to the above explained priority order assignment method, wherein a road is automatically assigned the highest priority:
1. Blocked Roads: If any road is entirely filled with vehicles such that no new vehicle will be able to turn onto this road
2. Priority Vehicles: If any road consists of a priority vehicle.
Note: Roads with priority vehicles are given preference over blocked roads.
Now that a priority order has been assigned, the traffic signal has to assign lights to each of its four sides. Table10.2gives all possible turn directions for vehicles in each edge. These are all the state combinations that are possible such that no collision occurs in the traffic junction. The traffic signal will determine which of these states to use based on the priority order as shown in Algorithm 2.
With the change in the traffic signal’s operation algorithm, a starvation could occur where any single edge does not get a green light for an extended period of time. This problem was eliminated by using idle time as a measure of priority. The longer a vehicle waits at a signal, the more its idle time increases and so does its priority and its chance of getting a green light.
108 S. Sripranav et al.