Skip to main content
. 2020 Feb 19;20(4):1128. doi: 10.3390/s20041128
Algorithm 1: Pseudo Code for the RA Algorithm.
  1. I = the set of resources

  2. C = the set of cellular users

  3. T = the set of D2D transmitters

  4. = the set of D2D receivers

  5. = the set of multicast D2D groups

  6. Generate all randomly distributed cellular and D2D users’ locations within the cell of radius y

  7. eNB transmits pilot signals to cellular and D2D users

  8. for all cϵC, mϵ do

  9.     Calculate distance between cellular users and D2D users and between D2D transmitter and nearly receivers

  10.     Calculate the probability PR that the D2D receiver can detect the signal transmitted from the D2D transmitter

  11.     if δc,mi=1,  i ϵ I then

  12.       Select the spectrum resource i which can share between cellular user and multicast D2D group

  13.       Calculate Hc,eNB, Hm,eNB, Hm,c, and Hm,m

  14.       Calculate γci and γmi

  15.       Calculate βci and βmi

  16.       Calculate Rci and Rmi

  17.       Formulate data rate maximization problem for ith resource as

  18.         if γci γcmini, γmi  γmmini, RciRTh, and RmiRTh then

      S1. maxiϵIc=1Cm=1MRsumi,  cϵC, mϵ

       Calculate Wsumi

  19.     else

  20.     δc,mi=0

  21.     end if

  22.     else

  23.     Select the spectrum band i’, i ϵ I

  24.     Calculate Hc,eNB, Hm,eNB, Hm,c, Hm,m, γci, γmi βci, βmi, Rci, and Rmi

  25.     end if

  26. end for

  27. Check for all available resources that fulfill the reuse criteria