Skip to main content
. 2023 Feb 13;23(4):2124. doi: 10.3390/s23042124
Algorithm 1: Message forwarding process.

Initialization:

Array of k routes by TMR is A[]

Best position pbest

Current position & velocity of vehicle dij(t) & vi(t)

Next, position & velocity of vehicle dij(t+1) & vi(t+1)

  • 1:

    Initialize pbest

  • 2:

    k=1

  • 3:

    whileAdo

  • 4:

       Evaluate FF as Equation (3) for l vehicles in k route

  • 5:

       if pbest<dij(t+1) then

  • 6:

         pbest = dij(t+1)

  • 7:

       end if

  • 8:

       Update dij(t+1) with Equation (4)

  • 9:

       Update vi(t+1) with Equation (5)

  • 10:

       k=k+1

  • 11:

    end while