Skip to main content
. 2018 Aug 31;18(9):2885. doi: 10.3390/s18092885
Algorithm 1. Search the optimal transmission radius set algorithm.
INPUT: r, R, ϱ, ζ, 𝓍ini, Δx.
OUTPUT: Υo={r+𝓍o,r𝓍o,  r+2𝓍o,r2𝓍o, ,r+S𝓀𝓍o,rS𝓀𝓍o }, Emaxo
 1: set i=0, j=1, Υ0={r}, =1, μ=1
 2: 𝓍i=𝓍ini
 3: Emaxo=;   // Initialize optimized maximum energy consumption value
 4: For 𝓍i<rϱ2 Do
 5: Calculate energy consumption Edr=Edr of this node using Equation (34);
     // Calculate energy consumption Edr at different distance from the sink with the current  r
 6: Emaxcur=max(Edr) //The maximum energy consumption of the current optimal transmission radius set
 7: 𝓍i=𝓍ii×Δx;
 8: j=1;
 9: For r>ϱ&&r<R Do
 10: rnew=r+j×𝓍i
 11: For d=dmin to R Do
//Calculate energy consumption under the current transmission radius rnew
 12: Calculate energy consumption Edrnew of this node using Equation (34)
 13: Edr=Edr+Edrnew;
 14: Edr¯ = Edr/j;    //The average energy consumption after j rotations
 15: End for
 16: Emaxi = max(Edr¯)
      //Emaxi indicates the maximum energy consumption of ith transmission radius set
 17: IF Emaxi < Emaxcur Then  //Maximum energy consumption can be reduced after adding rnew
 18: Emaxcur=Emaxi
 19: Else
 20: Exit //Stop the search of the current transmission radius set
 21: End if
 22: j=j+1;
 23: End For
 24: If Emaxo>Emaxcur Then
    //If the maximum energy consumption of the current transmission set is lower, then record it
 25:  Υo={r+𝓍o,r𝓍o,  r+2𝓍o,r2𝓍o, ,r+j𝓍o,rj𝓍o }
 26: End if
 27: i=i+1;
 28: End for
 29: OUTPUT Υo, Emaxo