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:
@@ -4,6 +4,7 @@
|
||||
#include <cmath>
|
||||
#include <random>
|
||||
#include "../Random.h"
|
||||
#include "../../Assertions.h"
|
||||
|
||||
namespace Distribution {
|
||||
|
||||
@@ -46,6 +47,7 @@ namespace Distribution {
|
||||
|
||||
/** get the probability for the given value */
|
||||
static T getProbability(const T mu, const T sigma, const T val) {
|
||||
Assert::isTrue(sigma > 0, "sigma must be >= 0");
|
||||
const T a = 1.0 / (sigma * std::sqrt(2.0 * M_PI));
|
||||
const T b = -0.5 * ((val-mu)/sigma) * ((val-mu)/sigma);
|
||||
return a * std::exp(b);
|
||||
|
||||
Reference in New Issue
Block a user