|
|
Algorithm 1. Method of Relay-Node Selection on Curved Roads |
| 1 |
Input: Set of Nodes , Obstacles . |
| 2 |
Input: Message sender , previous sender , terminal point . |
| 3 |
Output: Relay-node on curved roads. |
| 4 |
Phase 1. Judgment Phase: |
| 5 |
if there is an area between and that is blocked by or out of the communication range of and . |
| 6 |
Determine the area as a vacant. |
| 7 |
Phase 2. RTB Packet Broadcast Phase: |
| 8 |
if there is a vacant between and
|
| 9 |
Set the mode flag of RTB packet to 3 (means simultaneously start the normal selection and the reverse selection). |
| 10 |
Determine the optimal position in the message propagation direction according to Definition 1.
|
| 11 |
Choose the nearest corner as the optimal position in the reverse direction. |
| 12 |
Determine the endpoint of the vacant closest to as the termination of the reverse selection . |
| 13 |
Add , , into the RTB packet. |
| 14 |
else if be on the road between and . |
| 15 |
Set the mode flag of RTB packet to 2 (means start the reverse selection). |
| 16 |
Choose the next corner as the optimal position in the reverse direction |
| 17 |
Update in the RTB packet. |
| 18 |
Else
|
| 19 |
Set the mode flag of RTB packet to 1 (means start the normal selection). |
| 20 |
Determine the optimal position in the message propagation direction according to Definition 1.
|
| 21 |
Update in the RTB packet. |
| 22 |
Broadcast the RTB packet. |
| 23 |
Phase 3. Relay-Node Selection Phase: |
| 24 |
if the mode flag of RTB packet is 3 |
| 25 |
Start EPBP with as the optimal position, is not blocked by is selected as the relay-node in the message propagation direction. |
| 26 |
Simultaneously, start EPBP with as the optimal position, and is not blocked by is selected as the relay-node in the reverse direction. |
| 27 |
else if the mode flag of RTB packet is 2 |
| 28 |
Start EPBP with as the optimal position. |
| 29 |
is not blocked by is selected as the relay-node. |
| 30 |
Else
|
| 31 |
Start EPBP with as the optimal position. |
| 32 |
is not blocked by is selected as the relay-node. |
| 33 |
Relay-node selection finished |