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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user