Skip to main content
. 2018 Feb 19;18(2):624. doi: 10.3390/s18020624
Algorithm 1 Backoff-based beaconing algorithm.
  • 1:

    ciC:ci,bf=ci,bmax=1

  • 2:

    while isDaaGWorking() do

  • 3:

          for each ci in C do

  • 4:

                ci,bf=ci,bf1                ▹ Update remaining backoff time of ci

  • 5:

                if ci,bf0 then

  • 6:

                      ci,flag = runBeaconing(ci)            ▹ Broadcast beacon message with ci

  • 7:

                      if ci,flag>0 then

  • 8:

                            ci,bf=ci,bmax=1

  • 9:

                            D = runCommunication( ci)      ▹ Collect data D from nearby nodes with ci

  • 10:

                      else

  • 11:

                           ci,bf=ci,bmax=minbmax,α×ci,bmax      ▹ Update backoff time of ci

  • 12:

                      end if

  • 13:

                end if

  • 14:

          end for

  • 15:

          if DaaG moves more than reset boundary length then

  • 16:

                ciC:ci,bf=1

  • 17:

          end if

  • 18:

          sleep(tperiod)                            ▹ Wait for tperiod

  • 19:

    end while