small changes so it works with yasmin
This commit is contained in:
@@ -50,21 +50,17 @@ namespace SMC {
|
||||
for (uint32_t i = start; i < end; ++i) {
|
||||
const int rnd = dist(gen);
|
||||
particles[i] = particles[rnd];
|
||||
particles[i].weight /= 2;
|
||||
particles[rnd].weight /= 2;
|
||||
//particles[i].weight /= 2;
|
||||
//particles[rnd].weight /= 2;
|
||||
}
|
||||
|
||||
// calculate weight-sum
|
||||
double weightSum = 0;
|
||||
for (const auto& p : particles) {
|
||||
double equalweight = 1.0 / (double) cnt;
|
||||
for (auto& p : particles) {
|
||||
weightSum += p.weight;
|
||||
p.weight = equalweight;
|
||||
}
|
||||
|
||||
|
||||
int i = 0;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
@@ -77,8 +77,8 @@ namespace SMC {
|
||||
// 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);
|
||||
const NM::NavMeshSub<Tria> reachable(particlesCopy[i].state.loc, radius);
|
||||
particles[i].state.loc = reachable.getRandom().drawWithin(particlesCopy[i].state.loc.pos, radius);
|
||||
particles[i].weight = equalWeight;
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#include <fstream>
|
||||
#include "../../Tests.h"
|
||||
#include "../../../math/dsp/FIRComplex.h"
|
||||
#include "../../../math/dsp/fir/Complex.h"
|
||||
#include <random>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user