Skip to main content
. 2025 Dec 11;25(24):7521. doi: 10.3390/s25247521
Algorithm 1: Pseudocode for the Proposed Adaptive UA-RA Approach.
  • Input: MBS, SBS, UE information, QoS requirements

  • Output: BS* (for UA-RA decision)    

  • 1:

    Initialize RBiavail, ST;                                                         ▹ Initialization Stage

  • 2:

    for all requestfromUEj do                                    ▹ Requests Classification Stage

  • 3:

        Classify into {uRLLC, eMBB, mMTC};

  • 4:

        Assign priority P: PuRLLC>PeMBB>PmMTC;

  • 5:

    end for

  • 6:

    for all UEjUE do

  • 7:

        if speed(UEj)>ST then                                                ▹ Tier Selection Stage

  • 8:

            BSτ{BSiMBS}

  • 9:

        else

  • 10:

            BSτ{BSiSBS}

  • 11:

        end if

  • 12:

        BBSτsortedbyγij(descforUEj)                             ▹ Cell Selection Stage

  • 13:

        for all BSiB do

  • 14:

            if RBiavailRBijreq then

  • 15:

               BS*(j)BSi

  • 16:

               break

  • 17:

            end if

  • 18:

        end for

  • 19:

        γjSINR(UEj,BS*(j))                                             ▹ CQI Mapping Stage

  • 20:

        CQIjMapSINRtoCQI(γj)

  • 21:

        enqueue(Q[BS*(j)], UEj,Pj,γj,CQIj,RBijreq)

  • 22:

    end for

  • 23:

    for all BSiBS do                                               ▹ Resource Allocation Stage

  • 24:

        (RAdecision[BSi],RBiavail)  RA_SchedulerQ[BSi],RBiavail

  • 25:

    end for

  • 26:

    for all τ{MBS,SBS} do                                                    ▹ Lending Stage

  • 27:

        for all BSiBSτ do

  • 28:

            if pending[BSi]>0 then

  • 29:

               needpending[BSi]

  • 30:

               D{BSdBSτ{BSi}RBdavailRBdallocneed}

  • 31:

               if |D|>0 then

  • 32:

                   BSd*argminBSdDdist(BSi,BSd)

  • 33:

                   LEND(BSd*BSi,need)         ▹ SDN controller issues the lending command

  • 34:

                   RBiallocRBialloc+need                        ▹ state updated by SDN controller

  • 35:

                   RBdavailRBdavailneed                        ▹ state updated by SDN controller

  • 36:

                   pending[BSi]0                              ▹ state updated by SDN controller

  • 37:

               end if

  • 38:

            end if

  • 39:

        end for

  • 40:

    end for