diff --git a/code/CMakeLists.txt.user b/code/CMakeLists.txt.user index 43b509b..bd999fd 100644 --- a/code/CMakeLists.txt.user +++ b/code/CMakeLists.txt.user @@ -1,6 +1,6 @@ - + EnvironmentId diff --git a/code/eval/SmoothingEval1.h b/code/eval/SmoothingEval1.h index e9486ce..7e1b8ef 100644 --- a/code/eval/SmoothingEval1.h +++ b/code/eval/SmoothingEval1.h @@ -46,23 +46,23 @@ public: //pf->setResampling( std::unique_ptr>(new K::ParticleFilterResamplingPercent(0.10)) ); // state estimation step - //pf->setEstimation( std::unique_ptr>(new K::ParticleFilterEstimationWeightedAverageWithAngle())); + pf->setEstimation( std::unique_ptr>(new K::ParticleFilterEstimationWeightedAverageWithAngle())); //pf->setEstimation( std::unique_ptr>(new K::ParticleFilterEstimationRegionalWeightedAverage())); - pf->setEstimation( std::unique_ptr>(new K::ParticleFilterEstimationOrderedWeightedAverage(0.50f))); + //pf->setEstimation( std::unique_ptr>(new K::ParticleFilterEstimationOrderedWeightedAverage(0.50f))); //create the backward smoothing filter - //bf = new K::BackwardSimulation(MiscSettings::numBSParticles); - bf = new K::CondensationBackwardFilter; - //bf->setSampler( std::unique_ptr>(new K::CumulativeSampler())); + bf = new K::BackwardSimulation(MiscSettings::numBSParticles); + //bf = new K::CondensationBackwardFilter; + bf->setSampler( std::unique_ptr>(new K::CumulativeSampler())); bool smoothing_resample = false; //Smoothing using Simple Trans - //bf->setEstimation(std::unique_ptr>(new K::ParticleFilterEstimationWeightedAverage())); + bf->setEstimation(std::unique_ptr>(new K::ParticleFilterEstimationWeightedAverage())); //bf->setEstimation( std::unique_ptr>(new K::ParticleFilterEstimationRegionalWeightedAverage())); - bf->setEstimation( std::unique_ptr>(new K::ParticleFilterEstimationOrderedWeightedAverage(0.50f))); + //bf->setEstimation( std::unique_ptr>(new K::ParticleFilterEstimationOrderedWeightedAverage(0.50f))); if(smoothing_resample) bf->setResampling( std::unique_ptr>(new K::ParticleFilterResamplingSimple()) ); @@ -105,8 +105,14 @@ public: srs = new SensorReaderStep("./measurements/bergwerk/path4/nexus/vor/Steps2.txt"); gtw = getGroundTruthWay(*sr, floors.gtwp, path4dbl); - MyGridNode& end = (MyGridNode&)grid.getNodeFor( conv(floors.gtwp[path4dbl.back()]) ); - GridWalkPathControl* walk = new GridWalkPathControl(grid, DijkstraMapper(grid), end); +// MyGridNode& end = (MyGridNode&)grid.getNodeFor( conv(floors.gtwp[path4dbl.back()]) ); +// GridWalkPathControl* walk = new GridWalkPathControl(grid, DijkstraMapper(grid), end); +// pf->setTransition( std::unique_ptr( new MyTransition(grid, *walk)) ); + + + for (auto& n : grid) {n.imp = 1;} + + GridWalkSimpleControl* walk = new GridWalkSimpleControl(); pf->setTransition( std::unique_ptr( new MyTransition(grid, *walk)) ); @@ -163,8 +169,8 @@ public: smoothing_baro_sigma = 0.05; } - void bergwerk_path1_nexus_simple() { - runName = "bergwerk_path1_nexus_simple_interval"; + void bergwerk_path1_nexus_simple(std::string name) { + runName = name; bergwerk_path1_nexus(); for (auto& n : grid) {n.imp = 1;} @@ -223,9 +229,9 @@ public: } - void bergwerk_path2_nexus_simple() { + void bergwerk_path2_nexus_simple(std::string name) { - runName = "bergwerk_path2_nexus_simple_interval"; + runName = name; bergwerk_path2_nexus(); for (auto& n : grid) {n.imp = 1;} // remove importance @@ -284,9 +290,9 @@ public: } - void bergwerk_path3_nexus_simple() { + void bergwerk_path3_nexus_simple(std::string name) { - runName = "bergwerk_path3_nexus_simple_interval"; + runName = name; bergwerk_path3_nexus(); for (auto& n : grid) {n.imp = 1;} // remove importance @@ -344,9 +350,9 @@ public: } - void bergwerk_path4_nexus_simple() { + void bergwerk_path4_nexus_simple(std::string name) { - runName = "bergwerk_path4_nexus_simple_interval"; + runName = name; bergwerk_path4_nexus(); for (auto& n : grid) {n.imp = 1;} // remove importance @@ -405,8 +411,8 @@ public: } - void bergwerk_path1_galaxy_simple() { - runName = "bergwerk_path1_galaxy_simple_interval"; + void bergwerk_path1_galaxy_simple(std::string name) { + runName = name; bergwerk_path1_galaxy(); for (auto& n : grid) {n.imp = 1;} // remove importance GridWalkSimpleControl* walk = new GridWalkSimpleControl(); @@ -448,8 +454,8 @@ public: } - void bergwerk_path2_galaxy_simple() { - runName = "bergwerk_path2_galaxy_simple_interval"; + void bergwerk_path2_galaxy_simple(std::string name) { + runName = name; bergwerk_path2_galaxy(); for (auto& n : grid) {n.imp = 1;} // remove importance GridWalkSimpleControl* walk = new GridWalkSimpleControl(); @@ -492,8 +498,8 @@ public: } - void bergwerk_path3_galaxy_simple() { - runName = "bergwerk_path3_galaxy_simple_interval"; + void bergwerk_path3_galaxy_simple(std::string name) { + runName = name; bergwerk_path3_galaxy(); for (auto& n : grid) {n.imp = 1;} // remove importance GridWalkSimpleControl* walk = new GridWalkSimpleControl(); @@ -536,8 +542,8 @@ public: smoothing_baro_sigma = 0.15; } - void bergwerk_path4_galaxy_simple() { - runName = "bergwerk_path4_galaxy_simple_interval"; + void bergwerk_path4_galaxy_simple(std::string name) { + runName = name; bergwerk_path4_galaxy(); for (auto& n : grid) {n.imp = 1;} // remove importance GridWalkSimpleControl* walk = new GridWalkSimpleControl(); diff --git a/code/main.cpp b/code/main.cpp index 0da376d..09c38f9 100644 --- a/code/main.cpp +++ b/code/main.cpp @@ -87,42 +87,42 @@ void testModelWalk() { int main(void) { - {SmoothingEval1 eval; - eval.fixedIntervallSimpleTransPath4(); - eval.run();} +// {SmoothingEval1 eval; +// eval.fixedIntervallSimpleTransPath4(); +// eval.run();} -// for(int i = 0; i < 10; ++i){ + for(int i = 0; i < 10; ++i){ -// //nexus -// std::string name = "bergwerk_path1_nexus_simple_interval_" + std::to_string(i); -// {SmoothingEval1 eval; eval.bergwerk_path1_nexus_multi(name); eval.run();} + //nexus + std::string name = "bergwerk_path1_nexus_simple_interval_" + std::to_string(i); + {SmoothingEval1 eval; eval.bergwerk_path1_nexus_simple(name); eval.run();} -// name = "bergwerk_path2_nexus_simple_interval" + std::to_string(i); -// {SmoothingEval1 eval; eval.bergwerk_path2_nexus_multi(name); eval.run();} + name = "bergwerk_path2_nexus_simple_interval" + std::to_string(i); + {SmoothingEval1 eval; eval.bergwerk_path2_nexus_simple(name); eval.run();} -// name = "bergwerk_path3_nexus_simple_interval" + std::to_string(i); -// {SmoothingEval1 eval; eval.bergwerk_path3_nexus_multi(name); eval.run();} + name = "bergwerk_path3_nexus_simple_interval" + std::to_string(i); + {SmoothingEval1 eval; eval.bergwerk_path3_nexus_simple(name); eval.run();} -// name = "bergwerk_path4_nexus_simple_interval" + std::to_string(i); -// {SmoothingEval1 eval; eval.bergwerk_path4_nexus_multi(name); eval.run();} + name = "bergwerk_path4_nexus_simple_interval" + std::to_string(i); + {SmoothingEval1 eval; eval.bergwerk_path4_nexus_simple(name); eval.run();} -// //galaxy -// name = "bergwerk_path1_galaxy_simple_interval" + std::to_string(i); -// {SmoothingEval1 eval; eval.bergwerk_path1_galaxy_multi(name); eval.run();} + //galaxy + name = "bergwerk_path1_galaxy_simple_interval" + std::to_string(i); + {SmoothingEval1 eval; eval.bergwerk_path1_galaxy_simple(name); eval.run();} -// name = "bergwerk_path2_galaxy_simple_interval" + std::to_string(i); -// {SmoothingEval1 eval; eval.bergwerk_path2_galaxy_multi(name); eval.run();} + name = "bergwerk_path2_galaxy_simple_interval" + std::to_string(i); + {SmoothingEval1 eval; eval.bergwerk_path2_galaxy_simple(name); eval.run();} -// name = "bergwerk_path3_galaxy_simple_interval" + std::to_string(i); -// {SmoothingEval1 eval; eval.bergwerk_path3_galaxy_multi(name); eval.run();} + name = "bergwerk_path3_galaxy_simple_interval" + std::to_string(i); + {SmoothingEval1 eval; eval.bergwerk_path3_galaxy_simple(name); eval.run();} -// name = "bergwerk_path4_galaxy_simple_interval" + std::to_string(i); -// {SmoothingEval1 eval; eval.bergwerk_path4_galaxy_multi(name); eval.run();} + name = "bergwerk_path4_galaxy_simple_interval" + std::to_string(i); + {SmoothingEval1 eval; eval.bergwerk_path4_galaxy_simple(name); eval.run();} -// std::cout << "We are in loop number: " << i << "of " << 10 << std::endl; -// } + std::cout << "We are in loop number: " << i << "of " << 10 << std::endl; + } return 0;