Skip to main content
. 2020 Sep 11;20(18):5195. doi: 10.3390/s20185195
Algorithm 3 RSIN Algorithm
  •  1:

    N

▹ number of retransmission attempts
  •  2:

    /* Inputs */

  •  3:

    Nmax

▹ max number of retransmission attempts
  •  4:

    R={r1,r2,...,rn}

▹ set of available rates
  •  5:

    D

▹ Packet deadline
  •  6:

    s

▹ SNR value
  •  7:

    /* Definitions */

  •  8:

    ttrans

▹ packet transmission time
  •  9:

    Pr,opt

▹ residual error probability for the optimal rate sequence
  • 10:

    /* Definitions – Vectors of size Nmax */

  • 11:

    P¯r

P¯r[i]: residual error probability when N=i,i=1Nmax
  • 12:

    t¯trans

t¯trans[i]: transmission time when N=i,i=1Nmax
  • 13:

    RC¯low

▹ Vector of rate chains.
  • 14:

    /* The i-th element, RC¯low[i], contains the retransmission chain of length N=i that ensures the lowest transmission error probability*/

  • 15:

    /* Outputs */

  • 16:

    Nopt

▹ optimal number of retransmissions
  • 17:

    RCopt={ropt(1),ropt(2),...,ropt(Nopt)}

▹ optimal retransmission chain
  • 18:

    fori1 to Nmax do

  • 19:

        Running Algorithm 4.

  • 20:

    end for

  • 21:

    /* Calculation of Nopt and RCopt */

  • 22:

    Nopt1

  • 23:

    RCoptRC¯low[1]

  • 24:

    Pr,optP¯r[1]

  • 25:

    fori2 to Nmax do

  • 26:

        if P¯r[i]<Pr,opt then

  • 27:

            Nopti

  • 28:

            RCoptRC¯low[i]

  • 29:

            Pr,optP¯r[i]

  • 30:

        else

  • 31:

            Do nothing

  • 32:

        end if

  • 33:

    end for