started removing KLib related code:
- assertions - distributions new helper methods worked on stairs worked on grid-walkers worked on navigation
This commit is contained in:
@@ -6,9 +6,7 @@
|
||||
#include "../Grid.h"
|
||||
|
||||
#include "../../math/DrawList.h"
|
||||
#include <KLib/math/distribution/Normal.h>
|
||||
#include <KLib/math/distribution/Exponential.h>
|
||||
|
||||
#include "../../math/Distributions.h"
|
||||
#include "../../nav/dijkstra/Dijkstra.h"
|
||||
|
||||
#include "GridWalkState.h"
|
||||
@@ -55,11 +53,7 @@ public:
|
||||
|
||||
private:
|
||||
|
||||
// https://de.wikipedia.org/wiki/Logistische_Verteilung
|
||||
/** alpha = move the center, beta = slope */
|
||||
const float logisticDist(const float x, const float alpha, const float beta) {
|
||||
return 1 / (1 + std::exp( -((x-alpha)/beta) ) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
// NOTE: allocate >>ONCE<<! otherwise random numbers will NOT work!
|
||||
@@ -83,10 +77,10 @@ private:
|
||||
const float diffRad = potentialHeading.getDiffHalfRAD(cur.heading);
|
||||
|
||||
// weight this change
|
||||
const float prob1 = K::NormalDistribution::getProbability(0, Angle::degToRad(40), diffRad);
|
||||
const float prob1 = Distribution::Normal<float>::getProbability(0, Angle::degToRad(40), diffRad);
|
||||
|
||||
// add the node's importance factor into the calculation
|
||||
const float prob2 = logisticDist(neighbor.imp, 1.0, 0.05);
|
||||
const float prob2 = Distribution::Logistic<float>::getCDF(neighbor.imp, 1.0, 0.05);
|
||||
//const float prob2 = std::pow(neighbor.imp, 10);
|
||||
|
||||
// final importance
|
||||
|
||||
Reference in New Issue
Block a user