Skip to main content
. 2020 Mar 25;20(7):1831. doi: 10.3390/s20071831
Algorithm 1:
Input:pth, rs, and λ, where pth is the threshold, rs is the sensing range, and  λ is the sensor-dependent parameter given in (1).
Output: rs3 if pthpthmin; r1* or an ϵ-approximation of r1* if pth>pthmin.
  • 1:

    ifpthpthminthenr1rs3

  • 2:

    else

  • 3:

        found false;

  • 4:

        ϵ106;

  • 5:

        lower 1(1pth)13;

  • 6:

        upper (1(1pth)13)13;

  • 7:

        while ((found = false) and (upperlower) ≥ ϵ)) do

  • 8:

            midlower+upper2;

  • 9:

            val1(1mid)(1mid3)(1mid3);

  • 10:

            if (val=pth) then found true;

  • 11:

            else if (val<pth) then lowermid;

  • 12:

            else uppermid;

  • 13:

            end if

  • 14:

        end while

  • 15:

        if (found= true) then

  • 16:

            r1lnmidλ;   //r1*

  • 17:

        else

  • 18:

            r1lnupperλ;   //an ϵ-approximation of r1*

  • 19:

        end if

  • 20:

    end if

  • 21:

    return r1;