owlps/owlps-positioning/src/multilaterationalgorithm.hh

45 lines
1.0 KiB
C++

#ifndef _OWLPS_POSITIONING_MULTILATERATIONALGORITHM_HH_
#define _OWLPS_POSITIONING_MULTILATERATIONALGORITHM_HH_
#include "positioningalgorithm.hh"
#include "multilaterationmethod.hh"
/// Super-class of multilateration-based positioning algorithms
class MultilaterationAlgorithm: public PositioningAlgorithm
{
protected:
const Mobile *mobile ;
const Request *request ;
std::tr1::unordered_map<AccessPoint*, float> ap_distances ;
MultilaterationMethod *multilateration_method ;
/** @name Operations */
//@{
void compute_ap_distance_circles() ;
Point3D multilaterate() ;
//@}
public:
MultilaterationAlgorithm(const Mobile *_mobile = NULL) ;
virtual ~MultilaterationAlgorithm(void) ;
/** @name Operations */
//@{
Result compute(const Request &_request) ;
virtual float estimate_distance(const Measurement &measurement) = 0 ;
//@}
} ;
inline Point3D MultilaterationAlgorithm::multilaterate()
{
return multilateration_method->multilaterate(ap_distances) ;
}
#endif // _OWLPS_POSITIONING_MULTILATERATIONALGORITHM_HH_