huge commit
- worked on about everything - grid walker using plugable modules - wifi models - new distributions - worked on geometric data-structures - added typesafe timestamps - worked on grid-building - added sensor-classes - added sensor analysis (step-detection, turn-detection) - offline data reader - many test-cases
This commit is contained in:
@@ -100,4 +100,44 @@ TEST(Distribution, VonMisesLUT_Performance) {
|
||||
benchDist(dist);
|
||||
}
|
||||
|
||||
template <typename Dist> float distCheckArea(Dist dist, const float min, const float max) {
|
||||
float step = 0.05;
|
||||
float sum = 0;
|
||||
for (float x = min; x <= max; x += step) {
|
||||
float val = dist.getProbability(x);
|
||||
sum += val*step;
|
||||
}
|
||||
return sum;
|
||||
}
|
||||
|
||||
#include <fstream>
|
||||
TEST(Distribution, Region1) {
|
||||
|
||||
// std::ofstream out("/tmp/1.dat");
|
||||
// for (float x = -9; x <= +9; x += 0.025) {
|
||||
// //const float y = Distribution::Region<float>::getProbability(0, 3, 1.2, x);
|
||||
// const float y = Distribution::Region<float>::getProbability(1, 2, x);
|
||||
// out << x << " " << y << "\n";
|
||||
// }
|
||||
// out.close();
|
||||
|
||||
Distribution::Region<float> dist1(0, 3);
|
||||
ASSERT_NEAR(1.0, distCheckArea(dist1, -20, +20), 0.01);
|
||||
|
||||
Distribution::Region<float> dist2(0, 1);
|
||||
ASSERT_NEAR(1.0, distCheckArea(dist2, -20, +20), 0.01);
|
||||
|
||||
Distribution::Region<float> dist3(1, 3);
|
||||
ASSERT_NEAR(1.0, distCheckArea(dist3, -20, +20), 0.01);
|
||||
|
||||
Distribution::Region<float> dist4(1, 2);
|
||||
ASSERT_NEAR(1.0, distCheckArea(dist4, -20, +20), 0.01);
|
||||
|
||||
Distribution::Region<float> dist5(-1, 4);
|
||||
ASSERT_NEAR(1.0, distCheckArea(dist5, -20, +20), 0.01);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user