push for merge

This commit is contained in:
toni
2016-04-21 09:02:18 +02:00
parent 033466111a
commit b6532dbe7f
5 changed files with 54 additions and 53 deletions

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject> <!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 3.6.0, 2016-04-14T12:59:26. --> <!-- Written by QtCreator 3.6.0, 2016-04-20T09:34:12. -->
<qtcreator> <qtcreator>
<data> <data>
<variable>EnvironmentId</variable> <variable>EnvironmentId</variable>

View File

@@ -17,7 +17,7 @@ namespace MiscSettings {
const int timeSteps = 500; const int timeSteps = 500;
const int numParticles = 500; const int numParticles = 7500;
const int lag = 5; const int lag = 5;

View File

@@ -294,13 +294,17 @@ public:
pathEst.push_back(curEst); pathEst.push_back(curEst);
const float err = diff.length(); const float err = diff.length();
errorsNorm.push_back(err);
// count number of transitions // count number of transitions
++cnt; ++cnt;
if (cnt > 35) {
statsFiltering.add(err);
errorsNorm.push_back(err);
std::cout << "Filtering: " << se.ts << " " << statsFiltering.asString() << std::endl;
}
if(cnt > skip){ if(cnt > skip){
//save the current estimation for later smoothing. //save the current estimation for later smoothing.
@@ -335,10 +339,7 @@ public:
// skip the first 35 scans due to uniform distribution start // skip the first 35 scans due to uniform distribution start
// if (cnt > 35) {
statsFiltering.add(err);
std::cout << "Filtering: " << se.ts << " " << statsFiltering.asString() << std::endl;
//}
const float errSmoothed = diffSmoothed.length(); const float errSmoothed = diffSmoothed.length();
statsSmoothing.add(errSmoothed); statsSmoothing.add(errSmoothed);
@@ -489,7 +490,7 @@ public:
std::ofstream oErrPlot("/tmp/plot_err_" + runName + ".gp"); std::ofstream oErrPlot("/tmp/plot_err_" + runName + ".gp");
oErrPlot << "plot \\\n"; oErrPlot << "plot \\\n";
oErrPlot << "'err_norm_" << runName << ".dat' with lines, \\\n"; oErrPlot << "'err_norm_" << runName << ".dat' with lines, \\\n";
oErrPlot << "'err_smooth_" << runName << ".dat' using (($$0)+" << skip << "):1 with lines"; oErrPlot << "'err_smooth_" << runName << ".dat' with lines";
oErrPlot.close(); oErrPlot.close();

View File

@@ -51,9 +51,9 @@ public:
//create the backward smoothing filter //create the backward smoothing filter
bf = new K::BackwardSimulation<MyState>(50); //bf = new K::BackwardSimulation<MyState>(50);
//bf = new K::CondensationBackwardFilter<MyState>; bf = new K::CondensationBackwardFilter<MyState>;
bf->setSampler( std::unique_ptr<K::CumulativeSampler<MyState>>(new K::CumulativeSampler<MyState>())); //bf->setSampler( std::unique_ptr<K::CumulativeSampler<MyState>>(new K::CumulativeSampler<MyState>()));
} }
@@ -145,7 +145,7 @@ public:
bf->setEstimation(std::unique_ptr<K::ParticleFilterEstimationWeightedAverage<MyState>>(new K::ParticleFilterEstimationWeightedAverage<MyState>())); bf->setEstimation(std::unique_ptr<K::ParticleFilterEstimationWeightedAverage<MyState>>(new K::ParticleFilterEstimationWeightedAverage<MyState>()));
if(smoothing_resample) if(smoothing_resample)
bf->setResampling( std::unique_ptr<K::ParticleFilterResamplingSimple<MyState>>(new K::ParticleFilterResamplingSimple<MyState>()) ); bf->setResampling( std::unique_ptr<K::ParticleFilterResamplingSimple<MyState>>(new K::ParticleFilterResamplingSimple<MyState>()) );
bf->setTransition(std::unique_ptr<MySmoothingTransition>( new MySmoothingTransition(&grid)) ); bf->setTransition(std::unique_ptr<MySmoothingTransitionExperimental>( new MySmoothingTransitionExperimental) );
} }
@@ -164,7 +164,7 @@ public:
//Smoothing Variables //Smoothing Variables
smoothing_walk_mu = 0.7; smoothing_walk_mu = 0.7;
smoothing_walk_sigma = 0.5; smoothing_walk_sigma = 0.5;
smoothing_heading_sigma = 15.0; smoothing_heading_sigma = 5.0;
smoothing_baro_sigma = 0.05; smoothing_baro_sigma = 0.05;
bool smoothing_resample = false; bool smoothing_resample = false;
@@ -174,7 +174,7 @@ public:
bf->setEstimation(std::unique_ptr<K::ParticleFilterEstimationWeightedAverage<MyState>>(new K::ParticleFilterEstimationWeightedAverage<MyState>())); bf->setEstimation(std::unique_ptr<K::ParticleFilterEstimationWeightedAverage<MyState>>(new K::ParticleFilterEstimationWeightedAverage<MyState>()));
if(smoothing_resample) if(smoothing_resample)
bf->setResampling( std::unique_ptr<K::ParticleFilterResamplingSimple<MyState>>(new K::ParticleFilterResamplingSimple<MyState>()) ); bf->setResampling( std::unique_ptr<K::ParticleFilterResamplingSimple<MyState>>(new K::ParticleFilterResamplingSimple<MyState>()) );
bf->setTransition(std::unique_ptr<MySmoothingTransition>( new MySmoothingTransition(&grid)) ); bf->setTransition(std::unique_ptr<MySmoothingTransitionExperimental>( new MySmoothingTransitionExperimental) );
} }
void bergwerk_path1_nexus_simple() { void bergwerk_path1_nexus_simple() {
@@ -242,7 +242,7 @@ public:
bf->setEstimation(std::unique_ptr<K::ParticleFilterEstimationWeightedAverage<MyState>>(new K::ParticleFilterEstimationWeightedAverage<MyState>())); bf->setEstimation(std::unique_ptr<K::ParticleFilterEstimationWeightedAverage<MyState>>(new K::ParticleFilterEstimationWeightedAverage<MyState>()));
if(smoothing_resample) if(smoothing_resample)
bf->setResampling( std::unique_ptr<K::ParticleFilterResamplingSimple<MyState>>(new K::ParticleFilterResamplingSimple<MyState>()) ); bf->setResampling( std::unique_ptr<K::ParticleFilterResamplingSimple<MyState>>(new K::ParticleFilterResamplingSimple<MyState>()) );
bf->setTransition(std::unique_ptr<MySmoothingTransition>( new MySmoothingTransition(&grid)) ); bf->setTransition(std::unique_ptr<MySmoothingTransitionExperimental>( new MySmoothingTransitionExperimental) );
} }
void bergwerk_path2_nexus_simple() { void bergwerk_path2_nexus_simple() {
@@ -311,7 +311,7 @@ public:
bf->setEstimation(std::unique_ptr<K::ParticleFilterEstimationWeightedAverage<MyState>>(new K::ParticleFilterEstimationWeightedAverage<MyState>())); bf->setEstimation(std::unique_ptr<K::ParticleFilterEstimationWeightedAverage<MyState>>(new K::ParticleFilterEstimationWeightedAverage<MyState>()));
if(smoothing_resample) if(smoothing_resample)
bf->setResampling( std::unique_ptr<K::ParticleFilterResamplingSimple<MyState>>(new K::ParticleFilterResamplingSimple<MyState>()) ); bf->setResampling( std::unique_ptr<K::ParticleFilterResamplingSimple<MyState>>(new K::ParticleFilterResamplingSimple<MyState>()) );
bf->setTransition(std::unique_ptr<MySmoothingTransition>( new MySmoothingTransition(&grid)) ); bf->setTransition(std::unique_ptr<MySmoothingTransitionExperimental>( new MySmoothingTransitionExperimental) );
} }
void bergwerk_path3_nexus_simple() { void bergwerk_path3_nexus_simple() {
@@ -379,7 +379,7 @@ public:
bf->setEstimation(std::unique_ptr<K::ParticleFilterEstimationWeightedAverage<MyState>>(new K::ParticleFilterEstimationWeightedAverage<MyState>())); bf->setEstimation(std::unique_ptr<K::ParticleFilterEstimationWeightedAverage<MyState>>(new K::ParticleFilterEstimationWeightedAverage<MyState>()));
if(smoothing_resample) if(smoothing_resample)
bf->setResampling( std::unique_ptr<K::ParticleFilterResamplingSimple<MyState>>(new K::ParticleFilterResamplingSimple<MyState>()) ); bf->setResampling( std::unique_ptr<K::ParticleFilterResamplingSimple<MyState>>(new K::ParticleFilterResamplingSimple<MyState>()) );
bf->setTransition(std::unique_ptr<MySmoothingTransition>( new MySmoothingTransition(&grid)) ); bf->setTransition(std::unique_ptr<MySmoothingTransitionExperimental>( new MySmoothingTransitionExperimental) );
} }
void bergwerk_path4_nexus_simple() { void bergwerk_path4_nexus_simple() {
@@ -448,7 +448,7 @@ public:
bf->setEstimation(std::unique_ptr<K::ParticleFilterEstimationWeightedAverage<MyState>>(new K::ParticleFilterEstimationWeightedAverage<MyState>())); bf->setEstimation(std::unique_ptr<K::ParticleFilterEstimationWeightedAverage<MyState>>(new K::ParticleFilterEstimationWeightedAverage<MyState>()));
if(smoothing_resample) if(smoothing_resample)
bf->setResampling( std::unique_ptr<K::ParticleFilterResamplingSimple<MyState>>(new K::ParticleFilterResamplingSimple<MyState>()) ); bf->setResampling( std::unique_ptr<K::ParticleFilterResamplingSimple<MyState>>(new K::ParticleFilterResamplingSimple<MyState>()) );
bf->setTransition(std::unique_ptr<MySmoothingTransition>( new MySmoothingTransition(&grid)) ); bf->setTransition(std::unique_ptr<MySmoothingTransitionExperimental>( new MySmoothingTransitionExperimental) );
} }
void bergwerk_path1_galaxy_simple() { void bergwerk_path1_galaxy_simple() {
@@ -499,7 +499,7 @@ public:
bf->setEstimation(std::unique_ptr<K::ParticleFilterEstimationWeightedAverage<MyState>>(new K::ParticleFilterEstimationWeightedAverage<MyState>())); bf->setEstimation(std::unique_ptr<K::ParticleFilterEstimationWeightedAverage<MyState>>(new K::ParticleFilterEstimationWeightedAverage<MyState>()));
if(smoothing_resample) if(smoothing_resample)
bf->setResampling( std::unique_ptr<K::ParticleFilterResamplingSimple<MyState>>(new K::ParticleFilterResamplingSimple<MyState>()) ); bf->setResampling( std::unique_ptr<K::ParticleFilterResamplingSimple<MyState>>(new K::ParticleFilterResamplingSimple<MyState>()) );
bf->setTransition(std::unique_ptr<MySmoothingTransition>( new MySmoothingTransition(&grid)) ); bf->setTransition(std::unique_ptr<MySmoothingTransitionExperimental>( new MySmoothingTransitionExperimental) );
} }
void bergwerk_path2_galaxy_simple() { void bergwerk_path2_galaxy_simple() {
@@ -550,7 +550,7 @@ public:
bf->setEstimation(std::unique_ptr<K::ParticleFilterEstimationWeightedAverage<MyState>>(new K::ParticleFilterEstimationWeightedAverage<MyState>())); bf->setEstimation(std::unique_ptr<K::ParticleFilterEstimationWeightedAverage<MyState>>(new K::ParticleFilterEstimationWeightedAverage<MyState>()));
if(smoothing_resample) if(smoothing_resample)
bf->setResampling( std::unique_ptr<K::ParticleFilterResamplingSimple<MyState>>(new K::ParticleFilterResamplingSimple<MyState>()) ); bf->setResampling( std::unique_ptr<K::ParticleFilterResamplingSimple<MyState>>(new K::ParticleFilterResamplingSimple<MyState>()) );
bf->setTransition(std::unique_ptr<MySmoothingTransition>( new MySmoothingTransition(&grid)) ); bf->setTransition(std::unique_ptr<MySmoothingTransitionExperimental>( new MySmoothingTransitionExperimental) );
} }
void bergwerk_path3_galaxy_simple() { void bergwerk_path3_galaxy_simple() {
@@ -603,7 +603,7 @@ public:
bf->setEstimation(std::unique_ptr<K::ParticleFilterEstimationWeightedAverage<MyState>>(new K::ParticleFilterEstimationWeightedAverage<MyState>())); bf->setEstimation(std::unique_ptr<K::ParticleFilterEstimationWeightedAverage<MyState>>(new K::ParticleFilterEstimationWeightedAverage<MyState>()));
if(smoothing_resample) if(smoothing_resample)
bf->setResampling( std::unique_ptr<K::ParticleFilterResamplingSimple<MyState>>(new K::ParticleFilterResamplingSimple<MyState>()) ); bf->setResampling( std::unique_ptr<K::ParticleFilterResamplingSimple<MyState>>(new K::ParticleFilterResamplingSimple<MyState>()) );
bf->setTransition(std::unique_ptr<MySmoothingTransition>( new MySmoothingTransition(&grid)) ); bf->setTransition(std::unique_ptr<MySmoothingTransitionExperimental>( new MySmoothingTransitionExperimental) );
} }
void bergwerk_path4_galaxy_simple() { void bergwerk_path4_galaxy_simple() {

View File

@@ -88,51 +88,51 @@ void testModelWalk() {
int main(void) { int main(void) {
// testModelWalk(); // testModelWalk();
SmoothingEval1 eval; // SmoothingEval1 eval;
eval.fixedIntervallSimpleTransPath4(); // eval.fixedIntervallSimpleTransPath4();
eval.run(); // eval.run();
//Eval1 eval; //Eval1 eval;
//eval.bergwerk_path4_nexus_multi(); //eval.bergwerk_path4_nexus_multi();
//eval.run(); //eval.run();
// {SmoothingEval1 eval; eval.bergwerk_path1_nexus_simple(); eval.run();} //{SmoothingEval1 eval; eval.bergwerk_path1_nexus_simple(); eval.run();}
// //{SmoothingEval1 eval; eval.bergwerk_path1_nexus_imp(); eval.run();} //{SmoothingEval1 eval; eval.bergwerk_path1_nexus_imp(); eval.run();}
// {SmoothingEval1 eval; eval.bergwerk_path1_nexus_multi(); eval.run();} {SmoothingEval1 eval; eval.bergwerk_path1_nexus_multi(); eval.run();}
// {SmoothingEval1 eval; eval.bergwerk_path1_nexus_shortest(); eval.run();} {SmoothingEval1 eval; eval.bergwerk_path1_nexus_shortest(); eval.run();}
// {SmoothingEval1 eval; eval.bergwerk_path2_nexus_simple(); eval.run();} {SmoothingEval1 eval; eval.bergwerk_path2_nexus_simple(); eval.run();}
// //{SmoothingEval1 eval; eval.bergwerk_path2_nexus_imp(); eval.run();} //{SmoothingEval1 eval; eval.bergwerk_path2_nexus_imp(); eval.run();}
// {SmoothingEval1 eval; eval.bergwerk_path2_nexus_multi(); eval.run();} {SmoothingEval1 eval; eval.bergwerk_path2_nexus_multi(); eval.run();}
// {SmoothingEval1 eval; eval.bergwerk_path2_nexus_shortest(); eval.run();} {SmoothingEval1 eval; eval.bergwerk_path2_nexus_shortest(); eval.run();}
// {SmoothingEval1 eval; eval.bergwerk_path3_nexus_simple(); eval.run();} {SmoothingEval1 eval; eval.bergwerk_path3_nexus_simple(); eval.run();}
// //{SmoothingEval1 eval; eval.bergwerk_path3_nexus_imp(); eval.run();} //{SmoothingEval1 eval; eval.bergwerk_path3_nexus_imp(); eval.run();}
// {SmoothingEval1 eval; eval.bergwerk_path3_nexus_multi(); eval.run();} {SmoothingEval1 eval; eval.bergwerk_path3_nexus_multi(); eval.run();}
// {SmoothingEval1 eval; eval.bergwerk_path3_nexus_shortest(); eval.run();} {SmoothingEval1 eval; eval.bergwerk_path3_nexus_shortest(); eval.run();}
// {SmoothingEval1 eval; eval.bergwerk_path4_nexus_simple(); eval.run();} {SmoothingEval1 eval; eval.bergwerk_path4_nexus_simple(); eval.run();}
// {SmoothingEval1 eval; eval.bergwerk_path4_nexus_imp(); eval.run();} {SmoothingEval1 eval; eval.bergwerk_path4_nexus_imp(); eval.run();}
// {SmoothingEval1 eval; eval.bergwerk_path4_nexus_multi(); eval.run();} {SmoothingEval1 eval; eval.bergwerk_path4_nexus_multi(); eval.run();}
// {SmoothingEval1 eval; eval.bergwerk_path4_nexus_shortest(); eval.run();} {SmoothingEval1 eval; eval.bergwerk_path4_nexus_shortest(); eval.run();}
// {SmoothingEval1 eval; eval.bergwerk_path1_galaxy_simple(); eval.run();} {SmoothingEval1 eval; eval.bergwerk_path1_galaxy_simple(); eval.run();}
// {SmoothingEval1 eval; eval.bergwerk_path1_galaxy_multi(); eval.run();} {SmoothingEval1 eval; eval.bergwerk_path1_galaxy_multi(); eval.run();}
// {SmoothingEval1 eval; eval.bergwerk_path1_galaxy_shortest(); eval.run();} {SmoothingEval1 eval; eval.bergwerk_path1_galaxy_shortest(); eval.run();}
// {SmoothingEval1 eval; eval.bergwerk_path2_galaxy_simple(); eval.run();} {SmoothingEval1 eval; eval.bergwerk_path2_galaxy_simple(); eval.run();}
// {SmoothingEval1 eval; eval.bergwerk_path2_galaxy_multi(); eval.run();} {SmoothingEval1 eval; eval.bergwerk_path2_galaxy_multi(); eval.run();}
// {SmoothingEval1 eval; eval.bergwerk_path2_galaxy_shortest(); eval.run();} {SmoothingEval1 eval; eval.bergwerk_path2_galaxy_shortest(); eval.run();}
// {SmoothingEval1 eval; eval.bergwerk_path3_galaxy_simple(); eval.run();} {SmoothingEval1 eval; eval.bergwerk_path3_galaxy_simple(); eval.run();}
// {SmoothingEval1 eval; eval.bergwerk_path3_galaxy_multi(); eval.run();} {SmoothingEval1 eval; eval.bergwerk_path3_galaxy_multi(); eval.run();}
// {SmoothingEval1 eval; eval.bergwerk_path3_galaxy_shortest(); eval.run();} {SmoothingEval1 eval; eval.bergwerk_path3_galaxy_shortest(); eval.run();}
// {SmoothingEval1 eval; eval.bergwerk_path4_galaxy_simple(); eval.run();} {SmoothingEval1 eval; eval.bergwerk_path4_galaxy_simple(); eval.run();}
// {SmoothingEval1 eval; eval.bergwerk_path4_galaxy_multi(); eval.run();} {SmoothingEval1 eval; eval.bergwerk_path4_galaxy_multi(); eval.run();}
// {SmoothingEval1 eval; eval.bergwerk_path4_galaxy_shortest(); eval.run();} {SmoothingEval1 eval; eval.bergwerk_path4_galaxy_shortest(); eval.run();}