current TeX and Code
This commit is contained in:
83
main.cpp
83
main.cpp
@@ -1,5 +1,7 @@
|
||||
#define BREAK raise(SIGTRAP);
|
||||
|
||||
#include "for_toni/Toni.h"
|
||||
|
||||
#include "Indoor/sensors/radio/setup/WiFiOptimizer.h"
|
||||
#include "Indoor/sensors/radio/setup/WiFiFingerprint.h"
|
||||
#include "Indoor/sensors/radio/setup/WiFiFingerprints.h"
|
||||
@@ -34,7 +36,7 @@
|
||||
#include "wifi/EvalWiFi.h"
|
||||
#include "wifi/EvalWiFiPaths.h"
|
||||
#include "wifi/EvalWiFiPathMethods.h"
|
||||
|
||||
#include "pf/MarkusB.h"
|
||||
|
||||
|
||||
#include "plots/PlotErrFunc.h"
|
||||
@@ -248,6 +250,14 @@ void errorPlotAllModels(Floorplan::IndoorMap* map) {
|
||||
|
||||
std::vector<K::Statistics<float>> errors = errorStatAllModels(map);
|
||||
|
||||
for (K::Statistics<float> stats : errors) {
|
||||
std::cout << stats.getQuantile(0.25) << "\t&\t" <<
|
||||
stats.getMedian() << "\t&\t" <<
|
||||
stats.getQuantile(0.75) << "\t&\t" <<
|
||||
stats.getAvg() <<
|
||||
"\\\hline" << std::endl;
|
||||
}
|
||||
|
||||
PlotErrFunc plot("", "reference measurements (%)");
|
||||
plot.getPlot().getAxisX().setTicsLabelFormat("%h dB");
|
||||
plot.add("\\noOptEmpiric{}", &errors[0]);
|
||||
@@ -695,10 +705,12 @@ void paperOutputs() {
|
||||
// generate error plot showing the performance of each
|
||||
// save the resulting wifi-models to XML for later re-use during the walk-eval <<<<<< !!!!
|
||||
if (1 == 0) {
|
||||
rebuildAllModels(map, 0);
|
||||
/** detailled error analysis for above optimization routine */
|
||||
|
||||
//rebuildAllModels(map, 0);
|
||||
|
||||
/** detailled error analysis for above optimization routine */
|
||||
errorPlotAllModels(map);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -737,7 +749,7 @@ void paperOutputs() {
|
||||
}
|
||||
|
||||
/** plot wifi eval results */
|
||||
if (1 == 1) {
|
||||
if (1 == 0) {
|
||||
|
||||
WiFiFingerprints fps;
|
||||
fps.load(Settings::fCalib);
|
||||
@@ -760,15 +772,16 @@ void paperOutputs() {
|
||||
EvalWiFiOptResult evalBBox(Settings::fMap);
|
||||
Plotty* p3 = evalBBox.showErrorPerFingerprint<WiFiModelPerBBox>(Settings::wifiEachOptParPos_perBBox, fps);
|
||||
|
||||
K::GnuplotSize size(3.75, 2.8);
|
||||
const float s = 4.6;
|
||||
K::GnuplotSize size(5.15, 3.4);
|
||||
const float s = 4.4;
|
||||
|
||||
auto adjust = [&] (Plotty* pp) {
|
||||
//pp->setScale(1,1, -0.075, 0);
|
||||
pp->gp.setTerminal("epslatex", size);
|
||||
pp->splot.setTitle("");
|
||||
pp->splot.getView().setCamera(74, 30);
|
||||
pp->splot.getView().setScaleAll(s);
|
||||
pp->splot.getAxisZ().setRange(K::GnuplotAxis::Range(-3, 15.5));
|
||||
pp->splot.getAxisZ().setRange(K::GnuplotAxis::Range(-6, 18.5));
|
||||
pp->plot();
|
||||
};
|
||||
|
||||
@@ -778,10 +791,19 @@ void paperOutputs() {
|
||||
|
||||
p2->gp.writePlotToFile(Settings::fPathGFX + "wifiMaxErrorNN_opt3.gp");
|
||||
p2->gp.setOutput(Settings::fPathGFX + "wifiMaxErrorNN_opt3.tex");
|
||||
//p2->gp << "set colorbox horizontal user origin screen 0.4, 0.96 size 0.5,0.05\n";
|
||||
p2->splot.setStringMod(new K::GnuplotStringModLaTeX());
|
||||
adjust(p2);
|
||||
|
||||
p3->gp.writePlotToFile(Settings::fPathGFX + "wifiMaxErrorNN_opt5.gp");
|
||||
p3->gp.setOutput(Settings::fPathGFX + "wifiMaxErrorNN_opt5.tex");
|
||||
p3->gp << "set pm3d; set cbrange [0:20]; set palette defined (0 '#ffffff', 1 '#ff0000'); \n";
|
||||
//p3->gp << "set colorbox horizontal user origin screen -0.11, 0.08 size 0.45,0.05 front;\n";
|
||||
p3->gp << "set colorbox vertical user origin screen 0.77, 0.55 size 0.04,0.40 front;\n";
|
||||
p3->splot.getAxisCB().setTicsLabelFormat("%h dB");
|
||||
p3->splot.getAxisCB().setTicsStep(10);
|
||||
p3->splot.setStringMod(new K::GnuplotStringModLaTeX());
|
||||
|
||||
adjust(p3);
|
||||
|
||||
|
||||
@@ -940,7 +962,10 @@ void showModelFor(const std::string& mapFile, const std::string& modelXml, const
|
||||
|
||||
int main(void) {
|
||||
|
||||
Floorplan::IndoorMap* map = Floorplan::Reader::readFromFile(Settings::fMap);
|
||||
//Toni::run();
|
||||
//return 0;
|
||||
|
||||
Floorplan::IndoorMap* map = Floorplan::Reader::readFromFile(Settings::fMap);
|
||||
|
||||
//testWAF();
|
||||
//sleep(1);
|
||||
@@ -948,7 +973,7 @@ int main(void) {
|
||||
//const float rssi = LogDistanceModel::distanceToRssi(-100, 0, 999);
|
||||
//int i = 0; (void) i;
|
||||
|
||||
paperOutputs(); return 0;
|
||||
// paperOutputs(); return 0;
|
||||
|
||||
//showFingerprintsFor(Settings::fMap, Settings::fCalib, "D8:84:66:4A:4A:D0");
|
||||
//showModelFor(Settings::fMap, Settings::wifiEachOptParPos_multimodel, "D8:84:66:4A:4A:D0");
|
||||
@@ -1040,6 +1065,12 @@ int main(void) {
|
||||
|
||||
}
|
||||
|
||||
// // markus B
|
||||
// if (1 == 0) {
|
||||
// Floorplan::IndoorMap* map = Floorplan::Reader::readFromFile(Settings::fMap);;
|
||||
// MarkusB::walkEverything(map);
|
||||
// }
|
||||
|
||||
// walks
|
||||
if (1 == 1) {
|
||||
Floorplan::IndoorMap* map = Floorplan::Reader::readFromFile(Settings::fMap);;
|
||||
@@ -1129,6 +1160,8 @@ int main(void) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
// wifi vs ground-truth distance error
|
||||
if (1 == 0) {
|
||||
|
||||
std::vector<std::string> files = {
|
||||
@@ -1160,6 +1193,34 @@ int main(void) {
|
||||
|
||||
std::cout << "num scans: " << numScans << std::endl;
|
||||
|
||||
// stats as table
|
||||
if (1 == 1) {
|
||||
|
||||
EvalWiFiPaths ewp(Settings::fMap);
|
||||
ewp.loadModel(Settings::wifiAllFixed, "0");
|
||||
ewp.walks(files, gtIndices);
|
||||
|
||||
ewp.loadModel(Settings::wifiAllOptPar, "1");
|
||||
ewp.walks(files, gtIndices);
|
||||
|
||||
ewp.loadModel(Settings::wifiEachOptPar, "2");
|
||||
ewp.walks(files, gtIndices);
|
||||
|
||||
ewp.loadModel(Settings::wifiEachOptParPos, "3");
|
||||
ewp.walks(files, gtIndices);
|
||||
|
||||
ewp.loadModel(Settings::wifiEachOptParPos_multimodel, "4");
|
||||
ewp.walks(files, gtIndices);
|
||||
|
||||
ewp.loadModel(Settings::wifiEachOptParPos_perBBox, "5");
|
||||
ewp.walks(files, gtIndices);
|
||||
|
||||
// FOR PAPER
|
||||
ewp.dumpStats();
|
||||
|
||||
}
|
||||
|
||||
// stats as GFX
|
||||
if (1 == 1) {
|
||||
|
||||
EvalWiFiPaths ewp(Settings::fMap);
|
||||
@@ -1179,7 +1240,8 @@ int main(void) {
|
||||
|
||||
}
|
||||
|
||||
// examine various modifications
|
||||
|
||||
// examine various modifications [did not work out.. not within the paper]
|
||||
if (1 == 0) {
|
||||
|
||||
EvalWiFiPathMethods ewpm(Settings::fMap);
|
||||
@@ -1192,7 +1254,6 @@ int main(void) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
sleep(10000);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user