#39 #40 git add for last commit

This commit is contained in:
toni
2017-11-15 17:46:06 +01:00
parent c8063bc862
commit 95a5c8f34f
49 changed files with 4661 additions and 0 deletions

54
smc/Particle.h Normal file
View File

@@ -0,0 +1,54 @@
/*
* Particle.h
*
* Created on: Sep 17, 2013
* Author: Frank Ebner
*/
#ifndef PARTICLE_H_
#define PARTICLE_H_
/**
* a particle consists of a (user-defined) state
* assigned with a weight (importance).
*
* depending on the particle filter's configuration,
* the (user-defined) state must provide several methods
* like:
* assigning values from another state
* multiplication
* etc..
*
*/
namespace SMC {
template <typename State> struct Particle {
/** the particles state */
State state;
/** the (current) probability for this state */
double weight;
/** empty ctor */
Particle() : state(), weight(0) {;}
/** ctor */
Particle(const State& state, double weight) : state(state), weight(weight) {;}
/** assignment operator */
Particle& operator = (const Particle& other) {
this->state = other.state;
this->weight = other.weight;
return *this;
}
};
}
#endif /* PARTICLE_H_ */