Skip to main content
. 2019 Aug 22;19(17):3658. doi: 10.3390/s19173658
Algorithm 1 Localization algorithm.
  • 1:

    if SPi(t−1)notset then

  • 2:

        //TAGi has not been localized before

  • 3:

        SPi(t)←CPi(t)

  • 4:

        P(SPi(t))←Pentry

  • 5:

    else

  • 6:

        if CPi(t)=SPi(t−1) then

  • 7:

            //TAGi didn′t move from the last antenna

  • 8:

            SPi(t)←CPi(t)

  • 9:

            P(SPi(t))←P(SPi(t−1))+Pdelta

  • 10:

        if CPi(t)≠SPi(t−1) then

  • 11:

            if adjacent(CPi(t),SPi(t−1)) then

  • 12:

               //TAGi moved to an adjacent antenna

  • 13:

               SPi(t)←CPi(t)

  • 14:

               P(SPi(t))←Pentry

  • 15:

            else

  • 16:

               //TAGi is constrained

  • 17:

               if P(SPi(t−1))>Pmin then

  • 18:

                   //TAGi cannot jump

  • 19:

                   SPi(t)←SPi(t−1)

  • 20:

                   P(SPi(t))←P(SPi(t−1))−Pdelta

  • 21:

               else

  • 22:

                   //TAGi can jump

  • 23:

                   SPi(t)←CPi(t)

  • 24:

                   P(SPi(t))←P(SPi(t−1))+Pdelta