## 5 Forwarding Metric
### Analysis of Weight Calculations  
This section provides Algorithm 3 that shows how the forwarding decisions are made based on the weight calculations. According to Algorithm 3, the default weight value is equal to 10,000. When the forwarder node (i) is a sensor, the transmission range of 150 m will be used in the distance normalization. The weight calculations for neighbor nodes are influenced by several independent parameters, such as residual energy (RER), Direction (Angle), and (Road). In Example 1 shown in Figure 4, we assume that the distance from the forwarder node (i) to the destination node (k) is 1500 m, and the distance from the neighbor node (j) to the destination node (k) is 1350 m. Algorithm 3 determines the weight calculation when the neighbor nodes are sensors. The weight calculation for a sensor with a high RER, such as 0.8, is \(\left(1350-1500\right)/150\times 0.8=-0.8\), whereas the weight calculation for a sensor with a low RER, such as 0.2, is \(\left(135  
```
initialization: weight = 10,000 ifneighbor node (\(j\)) is Sensor then if\(RER>0\)then  weight = \(\left(\left(Dist(j)-Dist(i)\right)/TxRange(i)\right)\times RER(j)\). endif endif ifneighbor node (\(j\)) is Vehicle then if\(x-axis\,forehighorode(j)\
eq x-axis\,foredestinationmode(k)\)then \(Road(j)+=0.5\). if\(y-axis\,forehighorode(j)\
eq y-axis\,foredestinationmode(k)\)then \(Road(j)+=0.5\). ifneighbor node (\(j\)) approaching destination node (\(k\)) on x-axis then \(Angle(j)-=0.5\). \(Angle(j)+=0.5\). endif ifneighbor node (\(j\)) approaching destination node (\(k\)) on y-axis then \(Angle(j)-=0.5\). \(Angle(j)+=0.5\). endif  weight = \(\left(\left(Dist(j)-Dist(i)\right)/TxRange(i)\right)+Angle(j)+Road(j)\). endif  return weight.
```  
**Algorithm 3** Weight calculation for the neighbor nodes (Sensors/Vehicles)  
On the other hand, if the forwarder node is a vehicle, the transmission range of 500 m will be used in the distance normalization. When the neighbor nodes are sensors, the sensor with the highest RER will have the minimum weight calculation. In Example 3 shown  
Figure 4: Examples for a forwarder sensor and the weight calculation for its neighbors. (**a**) Example 1. (**b**) Example 2.  
in Figure 5, the weight calculation for neighbor sensors when the RER is 0.8 or 0.2 will be \((1350-1500)/500\times 0.8=-0.24\) and \((1350-1500)/500\times 0.2=-0.06\), respectively. Whereas for the weight calculation when the neighbor nodes are vehicles, the vehicle in the same direction and on the same road to the destination will have the minimum weight calculation. In Example 4 shown in Figure 5, the weight calculation for a vehicle that is moving in the same direction and on the same road is \((1350-1500)/500+0+0=-0.3\). The weight calculation for a vehicle on the same road but that is moving away from the destination is \((1350-1500)/500+1+0=0.7\). Finally, the weight calculation for a vehicle moving in the same direction but on a different road to the destination is \((1350-1500)/500+0+0.5=-0.2\). As a result, the neighbor with minimum weight calculation will be preferred and selected as a forwarder node.  
The forwarding decisions based on the weight calculations are summarized in Figures 4 and 5.