began putting everything together

This commit is contained in:
2016-01-28 21:49:36 +01:00
parent 07d739ebb7
commit 41713a5d47
30 changed files with 1446 additions and 279 deletions

View File

@@ -8,10 +8,10 @@
#include "StepObservation.h"
#include <math.h>
static double mu_walk = 40;
static double sigma_walk = 15;
static double mu_stop = 0;
static double sigma_stop = 5;
static constexpr double mu_walk = 40;
static constexpr double sigma_walk = 15;
static constexpr double mu_stop = 0;
static constexpr double sigma_stop = 5;
class StepEvaluation {
@@ -19,29 +19,31 @@ public:
double getProbability(const MyState& state, const StepObservation* obs) const {
double distance = state.distanceWalkedCM;
return 1;
double a = 1.0;
double mu_distance = 0; //cm
double sigma_distance = 10.0; //cm
// double distance = state.distanceWalkedCM;
if(obs->step) {
a = 1.0;
mu_distance = mu_walk;//80.0; //cm
sigma_distance = sigma_walk;//40.0; //cm
}
// double a = 1.0;
// double mu_distance = 0; //cm
// double sigma_distance = 10.0; //cm
else {
a = 0.0;
mu_distance = mu_stop; //cm
sigma_distance = sigma_stop; //cm
}
// if(obs->step) {
// a = 1.0;
// mu_distance = mu_walk;//80.0; //cm
// sigma_distance = sigma_walk;//40.0; //cm
// }
//Mixed Gaussian model: 1st Gaussian = step, 2nd Gaussian = no step
const double p = a * K::NormalDistribution::getProbability(mu_distance, sigma_distance, distance) +
(1.0-a) * K::NormalDistribution::getProbability(mu_distance, sigma_distance, distance);
// else {
// a = 0.0;
// mu_distance = mu_stop; //cm
// sigma_distance = sigma_stop; //cm
// }
return p;
// //Mixed Gaussian model: 1st Gaussian = step, 2nd Gaussian = no step
// const double p = a * K::NormalDistribution::getProbability(mu_distance, sigma_distance, distance) +
// (1.0-a) * K::NormalDistribution::getProbability(mu_distance, sigma_distance, distance);
// return p;
}
};