Redpin

  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)

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • lovePython阅读 2,372评论 0 1
  • 石崖之上 ——作者:莲心(印尼) 群峦沟壑 与一双眼神的对望 流泉飞瀑 激荡出天地的回响 石崖之上 谁的...
    莲心_印尼阅读 1,592评论 0 0
  • 这是个故事,又不只是故事…… 1. 她出生在闽南的一个小镇,那儿属于季风湿润的气候,那里的女孩子普遍身姿匀称娇小,...
    秋清舞阅读 3,685评论 3 3
  • 不知不觉,后知后觉,大学生活已经过了四分之一又半年。进去大学后,每个人都标配了电脑手机,于是就有了我们随处可见的现...
    今晚月色正好阅读 864评论 0 0
  • 以上是四川大学周鼎老师写的“自白书”,期末考试之前就看到这个文章了,挺有感慨的。 虽然这件事有人捧有人黑但我觉得他...
    枫之醉语阅读 4,239评论 0 0