Skip to main content
. 2020 Nov 4;20(21):6287. doi: 10.3390/s20216287
Algorithm 1 Predicting the probability of ui directly contacting a Wi-Fi Access Point (AP) within a time constraint
Input: the starting region rs, the starting time interval t, the stop time interval te.
Output: PiD
Initialize: PiD=0,ps(t)=1
1: OneStepTransition() {
2: if (rs contains a Wi-Fi AP) then
3: PiD+=ps(t);
4: else
5:  Getting the staying time intervals d and pst(d) using (2);
6: t+=d;
7:  if (t<te) then
8:   for every possible next region ra do
9:    Calculating psa(t) using (1);
10:   Calculating pa(t) using (3);
11:   rs=ra;
12:   ps(t)=pa(t);
13:   Calling OneStepTransition()
14:  end for
15: end if
16: end if }
17: return PiD;