changes in kld walker
This commit is contained in:
@@ -81,7 +81,7 @@ namespace NM {
|
||||
// to-be-walked distance;
|
||||
const float toBeWalkedDist = params.getToBeWalkedDistance();
|
||||
const float toBeWalkedDistSafe = 0.75 + toBeWalkedDist * 1.1;
|
||||
const float toBeWalkedDistKld = (kld * qualityWifi);
|
||||
const float toBeWalkedDistKld = (kld * qualityWifi);
|
||||
|
||||
// construct reachable region
|
||||
NavMeshSub<Tria> reachable(params.start, toBeWalkedDistKld); //EDIT HERE: ADD TOBEWALKDISTKLD...
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace NM {
|
||||
|
||||
// to-be-walked distance;
|
||||
const float toBeWalkedDist = params.getToBeWalkedDistance();
|
||||
const float toBeWalkedDistSafe = 0.75 + toBeWalkedDist * 1.1;
|
||||
const float toBeWalkedDistSafe = 0.75 + toBeWalkedDist * 1.1;
|
||||
|
||||
// construct reachable region
|
||||
NavMeshSub<Tria> reachable(params.start, toBeWalkedDistSafe);
|
||||
|
||||
@@ -146,7 +146,7 @@ namespace WiFiOptimizer {
|
||||
return false;
|
||||
};
|
||||
|
||||
const APFilter MIN_2_FPS = [] (const Stats& stats, const MACAddress& mac) {
|
||||
const APFilter MIN_2_FPS = [] (const Stats& stats, const MACAddress& mac) {
|
||||
(void) mac;
|
||||
return stats.usedFingerprins < 2;
|
||||
};
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace SMC {
|
||||
|
||||
// compile-time sanity checks
|
||||
// TODO: this solution requires EXPLICIT overloading which is bad...
|
||||
// static_assert( HasOperatorAssign<State>::value, "your state needs an assignment operator!" );
|
||||
// static_assert( HasOperatorAssign<State>::value, "your state needs an assignment operator!" );
|
||||
|
||||
const uint32_t cnt = (uint32_t) particles.size();
|
||||
|
||||
@@ -67,20 +67,21 @@ namespace SMC {
|
||||
particlesCopy[i].weight = cumWeight;
|
||||
}
|
||||
|
||||
// randomness for drawing particles
|
||||
std::uniform_real_distribution<float> distNewOne(0.0, 1.0);
|
||||
// randomness for drawing particles
|
||||
std::uniform_real_distribution<float> distNewOne(0.0, 1.0);
|
||||
|
||||
// now draw from the copy vector and fill the original one
|
||||
// with the resampled particle-set
|
||||
for (uint32_t i = 0; i < cnt; ++i) {
|
||||
|
||||
// slight chance to get a truely particle in range X m
|
||||
if (distNewOne(gen) < 0.001) {
|
||||
const NM::NavMeshSub<Tria> reachable(particlesCopy[i].state.pos, 10.0);
|
||||
particles[i].state.pos = reachable.getRandom().drawWithin(particlesCopy[i].state.pos.pos, 10.0);
|
||||
particles[i].weight = equalWeight;
|
||||
continue;
|
||||
}
|
||||
// slight chance to get a truely random particle in range X m
|
||||
if (distNewOne(gen) < 0.001) {
|
||||
const double radius = 50.0;
|
||||
const NM::NavMeshSub<Tria> reachable(particlesCopy[i].state.pos, radius);
|
||||
particles[i].state.pos = reachable.getRandom().drawWithin(particlesCopy[i].state.pos.pos, radius);
|
||||
particles[i].weight = equalWeight;
|
||||
continue;
|
||||
}
|
||||
|
||||
particles[i] = draw(cumWeight);
|
||||
particles[i].weight = equalWeight;
|
||||
|
||||
@@ -210,6 +210,15 @@ namespace SMC {
|
||||
BoxGaus<float> boxGaus;
|
||||
boxGaus.approxGaus(grid.image(), sigmaX, sigmaY, nFilt);
|
||||
|
||||
/**
|
||||
* Das hier wird nicht funktionieren!
|
||||
* Wir machen eine Transition von t zu t+1 und nehmen dann diese position um von der kde aus t+1 ein
|
||||
* Gewicht zu erhalten... aber das bringt ja nichts, diese Gewicht haben wir doch schon auf den partikeln in t+1
|
||||
* die transition macht ja nicht 2x was anderes, sondern wieder genau das gleiche.
|
||||
* was das smoothing gut macht, sind die Faltungen mit allen Partikeln (jeder mit jedem vergleichen).
|
||||
**/
|
||||
|
||||
|
||||
// Apply Position from Samples from q_t+1* into KDE of p(q_t+1 | o_1:T) to get p(q_t+1* | o_1:T)
|
||||
// Calculate new weight w(q_(t|T)) = w(q_t) * p(q_t+1* | o_1:T) * p(q_t+1* | q_t) * normalisation
|
||||
smoothedParticles = forwardHistory.getParticleSet(i);
|
||||
|
||||
Reference in New Issue
Block a user