Skip to main content
. 2022 Sep 19;22(18):7085. doi: 10.3390/s22187085
Algorithm 2: Improved power control scheme based on simulated annealing algorithm
  • 1:

    Input: PD power maximum Pmax and the minimum transmission rate requirement of the PDs Rth.

  • 2:

    Output: Optimal power control scheme {P(t)}.

  • 3:

    Initialize: Initial temperature T0, original cooling rate Vdecrease, additional cooling rate vdecrease, termination temperature Tend and the number of iterations Literation.

  • 4:

    Randomly generate a random initial solution p1 to the subproblem SP2.

  • 5:

    Calculate fp1.

  • 6:

    repeat

  • 7:

    for temperature T0 do

  • 8:

       Set k=0, r=0.

  • 9:

       repeat

  • 10:

       Randomly generate a random initial solution p2 to the subproblem SP2.

  • 11:

       Calculate fp2.

  • 12:

       Calculate Δf=fp2fp1.

  • 13:

       if Δf>0 then

  • 14:

         p1=p2.

  • 15:

         r=r+1.

  • 16:

       else

  • 17:

         Generate a uniformly distributed random number in the interval [0,1].

  • 18:

         if eΔfT0> then

  • 19:

            p1=p2.

  • 20:

         end if

  • 21:

       end if

  • 22:

       k=k+1.

  • 23:

       until k>Literation.

  • 24:

       if r>0 then

  • 25:

         T0=T0×vdecrease.

  • 26:

       end if

  • 27:

       T0=T0×Vdecrease.

  • 28:

    end for

  • 29:

    until T0<Tend.

  • 30:

    Return p1.