current state
This commit is contained in:
@@ -24,6 +24,13 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
// FOR TESTING
|
||||
#define FAST 1
|
||||
#define QUALITY 2
|
||||
#define MODE QUALITY
|
||||
|
||||
//#define DO_SHOW_FINGERPRINTS
|
||||
|
||||
class EvalCompareOpt2 {
|
||||
|
||||
int power = 1;
|
||||
@@ -36,14 +43,14 @@ class EvalCompareOpt2 {
|
||||
public:
|
||||
|
||||
/** ctor with map and fingerprints */
|
||||
EvalCompareOpt2(const std::string& mapFile, const std::string& fpFile, std::function<bool(const WiFiFingerprint& fp)> remove) {
|
||||
EvalCompareOpt2(const std::string& mapFile, const std::string& fpFile, std::function<bool(const WiFiFingerprint& fp)> remove, bool removeStaircases = false) {
|
||||
|
||||
setup(mapFile);
|
||||
|
||||
// load fingerprints
|
||||
calib = WiFiFingerprints(fpFile);
|
||||
// if (ignoreOutdoor) {calib = LeHelper::removeOutdoor(calib);}
|
||||
// if (ignoreStaircases) {calib = LeHelper::removeStaircases(calib);}
|
||||
if (removeStaircases) {calib = LeHelper::removeStaircases(calib);}
|
||||
// if (ignoreIndoor) {calib = LeHelper::removeIndoor(calib);}
|
||||
calib = LeHelper::removeIf(calib, remove);
|
||||
|
||||
@@ -120,7 +127,9 @@ private:
|
||||
}
|
||||
|
||||
// plot
|
||||
#ifdef DO_SHOW_FINGERPRINTS
|
||||
LeHelper::plot(map, calib);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
@@ -205,8 +214,13 @@ public:
|
||||
// use simplex
|
||||
float params[3] = {-40, 2, -8};
|
||||
K::NumOptAlgoDownhillSimplex<float> opt(3);
|
||||
#if MODE == FAST
|
||||
opt.setMaxIterations(50);
|
||||
opt.setNumRestarts(10);
|
||||
#elif MODE == QUALITY
|
||||
opt.setMaxIterations(200);
|
||||
opt.setNumRestarts(25);
|
||||
#endif
|
||||
opt.calculateOptimum(optFunc, params);
|
||||
|
||||
// // use genetic
|
||||
@@ -257,8 +271,13 @@ public:
|
||||
// use simplex
|
||||
float params[3] = {-40, 2, -8};
|
||||
K::NumOptAlgoDownhillSimplex<float> opt(3);
|
||||
opt.setMaxIterations(50);
|
||||
opt.setNumRestarts(25);
|
||||
#if MODE == FAST
|
||||
opt.setMaxIterations(50);
|
||||
opt.setNumRestarts(10);
|
||||
#elif MODE == QUALITY
|
||||
opt.setMaxIterations(200);
|
||||
opt.setNumRestarts(25);
|
||||
#endif
|
||||
opt.calculateOptimum(optFunc, params);
|
||||
|
||||
// // use genetic
|
||||
@@ -352,8 +371,15 @@ public:
|
||||
};
|
||||
|
||||
K::NumOptAlgoRangeRandom<float> opt(valRegion);
|
||||
opt.setPopulationSize(300);
|
||||
opt.setNumIerations(100);
|
||||
|
||||
#if MODE == FAST
|
||||
opt.setPopulationSize(100);
|
||||
opt.setNumIerations(50);
|
||||
#elif MODE == QUALITY
|
||||
opt.setPopulationSize(500);
|
||||
opt.setNumIerations(250);
|
||||
#endif
|
||||
|
||||
opt.calculateOptimum(optFunc, params);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user