many changes and updates

- changed the wifi-estimation api
- adjusted test-cases
- worked on grid-bulding and grid-importance
- new walking modules
- fixed some minor issues
This commit is contained in:
2016-08-29 19:02:32 +02:00
parent a2c9e575a2
commit a203305628
23 changed files with 505 additions and 251 deletions

View File

@@ -8,8 +8,8 @@
#include <unordered_map>
/**
* compare WiFi-Measurements within LIVE (exact) predictions
* just based on the distance to the access-point
* compare WiFi-Measurements within predictions of a given model.
* predictions are just based on the distance to the access-point.
*/
class WiFiObserverFree : public WiFiProbability {
@@ -19,17 +19,16 @@ private:
const float sigmaPerSecond = 1.5f;
/** the RSSI prediction model */
WiFiModel& model;
std::unordered_map<MACAddress, LocatedAccessPoint> aps;
/** the map's floorplan */
Floorplan::IndoorMap* map;
public:
WiFiObserverFree(const float sigma, WiFiModel& model, const std::vector<LocatedAccessPoint>& aps) : sigma(sigma), model(model) {
for (const LocatedAccessPoint& ap : aps) {
this->aps.insert(std::pair<MACAddress, LocatedAccessPoint>(ap.getMAC(), ap));
}
WiFiObserverFree(const float sigma, WiFiModel& model) : sigma(sigma), model(model) {
}
@@ -38,18 +37,17 @@ public:
double prob = 1.0;
// process each measured AP
for (const WiFiMeasurement& entry : obs.entries) {
auto it = aps.find(entry.getAP().getMAC());
// get the model's RSSI (if possible!)
const float modelRSSI = model.getRSSI(entry.getAP().getMAC(), pos);
// AP is unknown
if (it == aps.end()) {continue;}
// NaN? -> AP not known to the model -> skip
if (modelRSSI != modelRSSI) {continue;}
// get the AP
const LocatedAccessPoint& ap = it->second;
// model and scan rssi
const float modelRSSI = model.getRSSI(ap, pos);
// the scan's RSSI
const float scanRSSI = entry.getRSSI();
// the measurement's age