Skip to main content
. 2021 May 19;21(10):3520. doi: 10.3390/s21103520
Algorithm 3 Judge wandering behavior.
  • Input: 

    Divide the trajectory evenly into a area according to time.

    set threshold :maxscale,vecdis,maxsub.

  • Output: 

    the trajectory if has wandering behavior. )

  • 1:

    fori=0 to a do

  • 2:

     Calculate the displacement and distance of the user’s movement in each area;

  • 3:

    if displacementdistance>maxsub then

  • 4:

      vecdis=vecdis+1;

  • 5:

    end if

  • 6:

    end for

  • 7:

    if vecdisa>maxscale then

  • 8:

     return true;

  • 9:

    else

  • 10:

     return false;

  • 11:

    end if