Author: Daniel Cheng Date: To: tech Subject: [Tech] node swapping algorithm
Hi list,
On LocationManager#shouldSwap(), I wonder if we should use a geometric
mean instead of just multiplying them together.
Let's see the current implement:
755 A *= Location.distance(hisFriendLocs[i], hisLoc);
756 }
757
758 // B = the same, with our two values swapped
759 double B = 1.0;
760 for(int i=0;i<friendLocs.length;i++) {
( never mention his number of friends may not be the same as mine
should we use for(int i=0;i<friendLocs.length &&
;i<hisFriendLocs.length ; i++) ? )
#3. skip yet other friends...
but this time, we compare my friend's location with his location ..
I have him as my friend, so this is skipped _at least_ once.
The number of friends skipped here is not the same as those in #1 and #3..
i.e. A and B are calculated using different number of samples.
as Location.distance() < 1.0 , the more round you multiply,
the less the value.