fixed some small issues regarding museum project

This commit is contained in:
toni
2018-02-12 13:47:23 +01:00
parent 4985d3bcdd
commit 0fef66ac62
7 changed files with 16 additions and 19 deletions

View File

@@ -99,7 +99,7 @@ int main(int argc, char** argv) {
//::testing::GTEST_FLAG(filter) = "*Dijkstra.*";
//::testing::GTEST_FLAG(filter) = "*LogDistanceCeilingModelBeacon*";
//::testing::GTEST_FLAG(filter) = "*WiFiOptimizer*";
::testing::GTEST_FLAG(filter) = "*WiFiOptimizer*";
//::testing::GTEST_FLAG(filter) = "*Offline.readWrite*";
@@ -109,7 +109,7 @@ int main(int argc, char** argv) {
//::testing::GTEST_FLAG(filter) = "*Matrix4*";
//::testing::GTEST_FLAG(filter) = "*Sphere3*";
::testing::GTEST_FLAG(filter) = "NavMeshD*";
//::testing::GTEST_FLAG(filter) = "NavMeshD*";
//::testing::GTEST_FLAG(filter) = "Timestamp*";
//::testing::GTEST_FLAG(filter) = "*RayTrace3*";

View File

@@ -23,10 +23,6 @@ public:
RealArray2D kernelReal;
ComplexArray2D kernelSpectrum;
signal.data().data
//convert image2d single vector to 2d vector, just use pointers
int signal_x = signal.width;
int signal_y = signal.height;

View File

@@ -36,7 +36,7 @@ namespace NM {
/** algorithm choice */
SamplePartitionType partitionType = SamplePartitionType::SAMPLE_PARTITION_WATERSHED;
float regionMinSize = 8; // (isolated) regions smaller than this will not be rendered?!
float regionMinSize = 80; // (isolated) regions smaller than this will not be rendered?!
const float regionMergeSize = 20; //??

View File

@@ -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);

View File

@@ -160,7 +160,7 @@ namespace SMC {
void updateTransitionOnly(const Control* control) {
// sanity checks (if enabled)
Assert::isNotNull(transition, "transition MUST not be null! call setTransition() first!");
Assert::isNotNull(transition, "transition MUST not be null! call setTransition() first!");
// perform the transition step
transition->transition(particles, control);
@@ -171,9 +171,9 @@ namespace SMC {
State updateEvaluationOnly(const Observation& observation) {
// sanity checks (if enabled)
Assert::isNotNull(resampler, "resampler MUST not be null! call setResampler() first!");
Assert::isNotNull(resampler, "resampler MUST not be null! call setResampler() first!");
Assert::isNotNull(evaluation, "evaluation MUST not be null! call setEvaluation() first!");
Assert::isNotNull(estimation, "estimation MUST not be null! call setEstimation() first!");
Assert::isNotNull(estimation, "estimation MUST not be null! call setEstimation() first!");
// perform the evaluation step and calculate the sum of all particle weights
evaluation->evaluation(particles, observation);
@@ -184,13 +184,13 @@ namespace SMC {
//Assert::isNotNull(weightSum, "sum of all particle weights (returned from eval) is 0.0!");
// normalize the particle weights and thereby calculate N_eff
const double neff = normalize();
const double neff = normalize();
// estimate the current state
const State est = estimation->estimate(particles);
// if the number of efficient particles is too low, perform resampling
if (neff < particles.size() * nEffThresholdPercent) { resampler->resample(particles); }
// if the number of efficient particles is too low, perform resampling
if (neff < particles.size() * nEffThresholdPercent) { resampler->resample(particles); }
// done
return est;

View File

@@ -6,6 +6,7 @@
#include "ParticleFilterResampling.h"
#include "../../ParticleAssertions.h"
#include "../../../Assertions.h"
int fuck_off = 0;
@@ -39,7 +40,7 @@ namespace SMC {
void resample(std::vector<Particle<State>>& particles) override{
Assert::doThrow("lol, nothing happens here. Get out!");
}
void resample(std::vector<Particle<State>>& particles, double kld, std::vector<Particle<State>>& particlesWifi) override {
@@ -101,7 +102,7 @@ namespace SMC {
Particle<State> posteriorParticle = draw(cumWeight);
Particle<State> wifiParticle = drawWifi(cumWeightWifi);
posteriorParticle.state.position = wifiParticle.state.position;
posteriorParticle.state.pos.pos = wifiParticle.state.pos.pos;
particles[i] = posteriorParticle;
} else {
particles[i] = draw(cumWeight);

View File

@@ -48,11 +48,11 @@ namespace SMC {
public:
/** ctor */
ParticleFilterResamplingKLD(double delta = 0.01, double epsilon = 0.13, uint32_t N_max = 25000) : delta(delta), epsilon(epsilon), N_max(N_max) {
ParticleFilterResamplingKLD(double delta = 0.01, double epsilon = 0.13, uint32_t N_max = 10000) : delta(delta), epsilon(epsilon), N_max(N_max) {
gen.seed(RANDOM_SEED);
bins.setBinSizes({0.01, 0.01, 0.2, 0.3});
bins.setRanges({BinningRange(-1,100), BinningRange(-10,60), BinningRange(-1,15), BinningRange(0, 2 * M_PI)});
bins.setBinSizes({0.01, 0.01, 0.2});
bins.setRanges({BinningRange(-1,100), BinningRange(-10,60), BinningRange(-1,15)});
}
void resample(std::vector<Particle<State>>& particles) override {