Skip to main content
. 2017 Feb 10;17(2):338. doi: 10.3390/s17020338
Algorithm 1 The CTMAC Algorithm
  • 1:

     if the number of vehicles n is lager than n* then

  • 2:

       if the last transmission was successful then

  • 3:

        slot=n

  • 4:

       else

  • 5:

        slot=rand(0,n)

  • 6:

       end if

  • 7:

     else

  • 8:

       if the last transmission was successful then

  • 9:

        CW=CWmin

  • 10:

       else

  • 11:

        CW=min(2×CW+1,CWmax)

  • 12:

       end if

  • 13:

       slot=rand(0,CW)

  • 14:

     end if