Algorithm 2 Identifying mobility patterns. |
-
Input:
: sequence of previously visited locations;
-
Output:
pattern type (“direct”, “random”, “lapping”, or “pacing”)
-
1:
if where then
-
2:
label “direct” for the ;
-
3:
else
-
4:
Find circles in ;
-
5:
label pacing for points in the circle whose length is 2;
-
6:
label lapping for points in the circle whose length is between 3 and ;
-
7:
for each unlabeled sub-sequence of do
-
8:
if
where then
-
9:
label “direct” for ;
-
10:
else
-
11:
label “random” for ;
-
12:
end if
-
13:
end for
-
14:
= the number of sub-patterns labeled as “random”, “lapping”, and “pacing” respectively;
-
15:
;
-
16:
if
then
-
17:
label “random” for the ;
-
18:
else
-
19:
if
then
-
20:
label “lapping” for the ;
-
21:
else
-
22:
label “pacing” for the ;
-
23:
end if
-
24:
end if
-
25:
end if
|