41 lines
1004 B
C++
41 lines
1004 B
C++
#ifndef _OWLPS_POSITIONING_MINMAX_HH_
|
|
#define _OWLPS_POSITIONING_MINMAX_HH_
|
|
|
|
#include "multilaterationmethod.hh"
|
|
|
|
/// Multilaterates using the Lassabe's MinMax algorithm
|
|
class MinMax: public MultilaterationMethod
|
|
{
|
|
private:
|
|
float min ;
|
|
Point3D centre ;
|
|
std::tr1::unordered_map<AccessPoint*, float> const *ap_distances ;
|
|
|
|
void iterate(float x, float y, float z) ;
|
|
|
|
protected:
|
|
const Point3D start ;
|
|
const Point3D stop ;
|
|
float step ;
|
|
|
|
static const float MINMAX_DEFAULT_STEP = 0.5 ;
|
|
static const float INFINITE = 1000000 ;
|
|
|
|
public:
|
|
MinMax(const Point3D &_start,
|
|
const Point3D &_stop,
|
|
const float _step = MINMAX_DEFAULT_STEP):
|
|
min(INFINITE),
|
|
start(_start), stop(_stop), step(_step) {}
|
|
|
|
~MinMax(void) {}
|
|
|
|
Point3D multilaterate(
|
|
const std::tr1::unordered_map<AccessPoint*, float> &_ap_distances) ;
|
|
Point3D multilaterate_2d(
|
|
const std::tr1::unordered_map<AccessPoint*, float> &_ap_distances,
|
|
float z) ;
|
|
} ;
|
|
|
|
#endif // _OWLPS_POSITIONING_MINMAX_HH_
|