added wifi per-floor optimization
added plot to wifi-quality-analyzer changes to per-floor wifi models minor fixes
This commit is contained in:
@@ -15,6 +15,14 @@
|
||||
*/
|
||||
class WiFiObserverFree : public WiFiProbability {
|
||||
|
||||
public:
|
||||
|
||||
enum class EvalDist {
|
||||
NORMAL_DISTIRBUTION,
|
||||
CAPPED_NORMAL_DISTRIBUTION,
|
||||
EXPONENTIAL,
|
||||
};
|
||||
|
||||
private:
|
||||
|
||||
const float sigma;
|
||||
@@ -31,9 +39,11 @@ private:
|
||||
|
||||
bool useError = false;
|
||||
|
||||
EvalDist dist;
|
||||
|
||||
public:
|
||||
|
||||
WiFiObserverFree(const float sigma, WiFiModel& model) : sigma(sigma), model(model) {
|
||||
WiFiObserverFree(const float sigma, WiFiModel& model, EvalDist dist = EvalDist::NORMAL_DISTIRBUTION) : sigma(sigma), model(model), dist(dist) {
|
||||
allAPs = model.getAllAPs();
|
||||
}
|
||||
|
||||
@@ -76,8 +86,16 @@ public:
|
||||
const float sigma = this->sigma + this->sigmaPerSecond * age.sec();
|
||||
|
||||
// probability for this AP
|
||||
double local = Distribution::Normal<double>::getProbability(modelRSSI, sigma, scanRSSI);
|
||||
//double local = Distribution::Exponential<double>::getProbability(0.1, std::abs(modelRSSI-scanRSSI));
|
||||
double local = NAN;
|
||||
switch (dist) {
|
||||
case EvalDist::NORMAL_DISTIRBUTION:
|
||||
local = Distribution::Normal<double>::getProbability(modelRSSI, sigma, scanRSSI); break;
|
||||
case EvalDist::CAPPED_NORMAL_DISTRIBUTION:
|
||||
local = Distribution::Region<double>::getProbability(modelRSSI, sigma, scanRSSI); break;
|
||||
case EvalDist::EXPONENTIAL:
|
||||
local = Distribution::Exponential<double>::getProbability(0.05, std::abs(modelRSSI-scanRSSI)); break;
|
||||
default: throw Exception("unsupported distribution");
|
||||
}
|
||||
|
||||
// also add the error value? [location is OK but model is wrong]
|
||||
if (useError) {
|
||||
|
||||
Reference in New Issue
Block a user