Skip to main content
. 2019 Aug 14;19(16):3547. doi: 10.3390/s19163547
Algorithm 1 The Bandwidth-aware Data Collection (BDC) Algorithm
Input: Historical data set Sprev(i,j),riRm,mM,j=1,2,...,T
Output: The collected traffic state matrix Xm and indicator matrix Bm, mM
Step 1: determine the selection priority of the road segments (Offline Phase)
  •   1:

    Compute Xmprev based on Equation (2), mM

  •   2:

    Set priority matrix Gm=[0]Rm×T

  •   3:

    for each riRm do

  •   4:

    for j from 1 to T do

  •   5:

      XmprevXmprev

  •   6:

      xijprev0

  •   7:

      Decompose Xmprev as Pmprev and Qmprev based on Equation (11)

  •   8:

      xijprevpiprevqjprev

  •   9:

      Compute Gm(ri,tj) based on Equation (12)

  • 10:

    end for

  • 11:

    end for

  • 12:

    Set index matrix I=

  • 13:

    forj from 1 to T do

  • 14:

    tmp the jth column row vector of Gm

  • 15:

     Sort elements of tmp in descending order

  • 16:

    tmp_index the index vector of sorted elements in tmp

  • 17:

    I[I,tmp_index]

  • 18:

    end for

Step 2: allocate wireless bandwidth and collect vehicle data (Online Phase)
  • 19:

    forj from 1 to T do

  • 20:

    Tleft=Wm

  • 21:

    for each iI(:,j) do

  • 22:

      Set bm(i,j)=1

  • 23:

      L=min(Tleft,lupload)

  • 24:

      if L>0 then

  • 25:

       Sc(i,j) randomly select L elements from So(i,j)

  • 26:

       Compute xijc by Equation (2)

  • 27:

      else

  • 28:

       break

  • 29:

      end if

  • 30:

      Tleft=TleftL

  • 31:

    end for

  • 32:

    end for

  • 33:

    Output Xmc and Bm