Research Article

ECOPS: Energy-Efficient Collaborative Opportunistic Positioning for Heterogeneous Mobile Devices

Algorithm 2

ECOPS: CollaborativePB().
1: while   do
2:  listen to connection request from a PR;
3: wait for location request from a PR;
4: if   PR requests then
5:  check the time elapsed since the device got location
   information ( )
6:  calculate ;
7:  if   <   then
8:   update its GPS location information;
9:    ;
10:  end if
11: end if
12: broadcast current GPS location information;
13: check the residual power ( );
14: end while
15: execute CollaborativePR();