Skip to main content
. 2018 Feb 19;18(2):624. doi: 10.3390/s18020624
Algorithm 2 Path-planning algorithm in the sensor network.
  • 1:

    for i=1 to |S| do                            ▹ Initialize all Fi to 0

  • 2:

         Fi=0

  • 3:

    end for

  • 4:

    while any Fi=0 exists do            ▹ Run until DaaG collects data from every sensor

  • 5:

         if DaaG visits si then

  • 6:

              Fi=2

  • 7:

              sk = getSensorToVisit(si)         ▹ Get unvisited sensor sk, which has the highest wik

  • 8:

              possx,possy = getPosition(sk)

  • 9:

              moveDaaGTopossx,possy      ▹ Command flight controller to move to possx,possy

  • 10:

         end if

  • 11:

         T = getSensorListFromCollectedData(D)          ▹ Get list of sensed sensors from D

  • 12:

         for each si in T do

  • 13:

               if Fi=0 then

  • 14:

                    Fi=1

  • 15:

               end if

  • 16:

         end for

  • 17:

    end while