Research Article
Routing Protocol in VANETs Equipped with Directional Antennas: Topology-Based Neighbor Discovery and Routing Analysis
Algorithm 1
Calculation for the waiting and transmitting time.
| Input: , , , , | | Output: , , | | for every row of the neighbor node table do | | Calculate the beginning and ending time points for , (Eq. (14)-(15)). | | for every row of the Two-hop Node List do | | Calculate the beginning and ending time points for (Eq. (16)). | | if , then | | if then | | Set | | Set | | else then | | Set | | Set | | end if | | else then | | Identify as the waiting time for the first hop of path h | | Identify as the waiting time for the second hop of path | | if then | | | Set | | else then | | | Set | | end if | | Set | | Set | | Set | | end if | | end for | | end for |
|