Redpin

作者: stepsma | 来源:发表于2016-11-14 23:34 被阅读0次
  1. Fingerprint (associated with one location) contains multiple measurements
  2. One measurement contains multiple WIFI readings (bssid, rssi).
  3. For given a current measurement (call it cur). Program calculates the distance of all previous measurements to cur. It output a hashmap<string, List<Integer>>, string is the location name, and List includes the distances to cur, from all measurements in this location.
  4. Then it averages the hashmap, returning hashmap<string, int> this is the average distance for all locations to cur.
  5. It creates a location helper class, which contains string (location name), and int (average distance), then put it in a TreeSet. So all locations is sorted according to average distance.
  6. Algorithm is, if the closest locations (first in TreeSet), the distance is within 5. We use the first distance; Otherwise, we output the first three locations, and do a weighted average to find the averaged location.

suppose L1 (x1, y1, d1), L2 (x2, y2, d2), L3 (x3, y3, d3).

x = x1 * (d2+d3)/(d1+d2+d3) + x2 * (d1+d3)/(d1+d2+d3) + x3 * (d1+d2)/(d1+d2+d3)

相关文章

  • Redpin

    Fingerprint (associated with one location) contains multi...

网友评论

      本文标题:Redpin

      本文链接:https://www.haomeiwen.com/subject/spuauttx.html