diff --git a/owlps-positioning/Makefile b/owlps-positioning/Makefile index c8f0534..ce759f1 100644 --- a/owlps-positioning/Makefile +++ b/owlps-positioning/Makefile @@ -78,7 +78,7 @@ OBJ_LIST = \ interlinknetworks.o \ fbcm.o \ frbhmbasic.o \ - radar.o \ + nss.o \ realposition.o \ configuration.o \ userinterface.o \ @@ -304,9 +304,9 @@ $(OBJ_DIR)/fbcm.o: \ $(OBJ_DIR)/configuration.o \ $(OBJ_DIR)/stock.o $(OBJ_DIR)/frbhmbasic.o: \ - $(OBJ_DIR)/radar.o \ + $(OBJ_DIR)/nss.o \ $(OBJ_DIR)/fbcm.o -$(OBJ_DIR)/radar.o: \ +$(OBJ_DIR)/nss.o: \ $(OBJ_DIR)/cartographyalgorithm.o $(OBJ_DIR)/realposition.o: \ $(SRC_DIR)/positioningalgorithm.hh \ @@ -320,7 +320,7 @@ $(OBJ_DIR)/positioning.o: \ $(OBJ_DIR)/fbcm.o \ $(OBJ_DIR)/frbhmbasic.o \ $(OBJ_DIR)/interlinknetworks.o \ - $(OBJ_DIR)/radar.o \ + $(OBJ_DIR)/nss.o \ $(OBJ_DIR)/resultlist.o \ $(OBJ_DIR)/output.o \ $(OBJ_DIR)/configuration.o \ diff --git a/owlps-positioning/cfg/owlps-positioning.conf b/owlps-positioning/cfg/owlps-positioning.conf index 43f7199..e4f1a54 100644 --- a/owlps-positioning/cfg/owlps-positioning.conf +++ b/owlps-positioning/cfg/owlps-positioning.conf @@ -57,7 +57,7 @@ csv-file = /tmp/owlps-positioning.log #algorithm = Real #algorithm = InterlinkNetworks #algorithm = FBCM -#algorithm = RADAR +#algorithm = NSS #algorithm = FRBHMBasic # This option allows to create a new mobile when a request is sent by @@ -117,9 +117,9 @@ csv-file = /tmp/owlps-positioning.log # serve the positioning process, not to use it. #position-calibration-requests = false -[positioning.radar] -# This subsection contains the options related to the RADAR algorithm -# and derivated. +[positioning.nss] +# This subsection contains the options related to the NSS (a.k.a. RADAR) +# algorithm and derivated. # For a given positioning request, average all the calibration requests # associated with a reference point before to compute the SS distance. diff --git a/owlps-positioning/cfg/topology.csv b/owlps-positioning/cfg/topology.csv index 8abee10..2a30fe0 100644 --- a/owlps-positioning/cfg/topology.csv +++ b/owlps-positioning/cfg/topology.csv @@ -8,7 +8,7 @@ # However, you can describe areas if you want to know when the mobile # is in a particular location. In that case be sure that the algorithm # you use will be able to generate positions that match each described -# area (in particular, with RADAR, at least one reference point should +# area (in particular, with NSS, at least one reference point should # be present in each area). # # ALSO IMPORTANT (EVEN IF YOU DON'T DESCRIBE THE TOPOLOGY): diff --git a/owlps-positioning/src/frbhmbasic.hh b/owlps-positioning/src/frbhmbasic.hh index 44f1470..7f65392 100644 --- a/owlps-positioning/src/frbhmbasic.hh +++ b/owlps-positioning/src/frbhmbasic.hh @@ -2,10 +2,10 @@ #define _OWLPS_POSITIONING_FRBHMBASIC_HH_ #include "fbcm.hh" -#include "radar.hh" +#include "nss.hh" /// Computes a position using the Interlink Networks formula -class FRBHMBasic: public FBCM, public RADAR +class FRBHMBasic: public FBCM, public NSS { protected: ReferencePoint const *closest_in_ss ; diff --git a/owlps-positioning/src/radar.cc b/owlps-positioning/src/nss.cc similarity index 65% rename from owlps-positioning/src/radar.cc rename to owlps-positioning/src/nss.cc index 58acbc8..cb1d19e 100644 --- a/owlps-positioning/src/radar.cc +++ b/owlps-positioning/src/nss.cc @@ -1,13 +1,13 @@ -#include "radar.hh" +#include "nss.hh" #include "stock.hh" #include "configuration.hh" -const ReferencePoint& RADAR::select_point(const Request &request) +const ReferencePoint& NSS::select_point(const Request &request) { if (Configuration::bool_value( - "positioning.radar.average-reference-points")) + "positioning.nss.average-reference-points")) return Stock::closest_reference_point(request) ; const CalibrationRequest &cr = diff --git a/owlps-positioning/src/nss.hh b/owlps-positioning/src/nss.hh new file mode 100644 index 0000000..6525a2f --- /dev/null +++ b/owlps-positioning/src/nss.hh @@ -0,0 +1,22 @@ +#ifndef _OWLPS_POSITIONING_NSS_HH_ +#define _OWLPS_POSITIONING_NSS_HH_ + +#include "cartographyalgorithm.hh" + +/// Computes a position selecting the closest point in SS cartography +/** + * This algorithm was introduced by Paramvir Bahl and Venkata N. + * Padmanabhan in their paper "RADAR: An In-Building RF-Based User + * Location and Tracking System" (2000). For more details, see: + * http://citeseer.ist.psu.edu/bahl00radar.html + */ +class NSS: public CartographyAlgorithm +{ +public: + NSS(void): PositioningAlgorithm("NSS") {} + ~NSS(void) {} + + const ReferencePoint& select_point(const Request &request) ; +} ; + +#endif // _OWLPS_POSITIONING_NSS_HH_ diff --git a/owlps-positioning/src/positioning.cc b/owlps-positioning/src/positioning.cc index 4cdeda0..4dc5649 100644 --- a/owlps-positioning/src/positioning.cc +++ b/owlps-positioning/src/positioning.cc @@ -3,7 +3,7 @@ #include "fbcm.hh" #include "frbhmbasic.hh" #include "interlinknetworks.hh" -#include "radar.hh" +#include "nss.hh" #include "resultlist.hh" #include "configuration.hh" #include "posexcept.hh" @@ -103,12 +103,12 @@ void Positioning::initialise_algorithms() algorithms.push_back(new InterlinkNetworks) ; } - else if (*i == "RADAR") + else if (*i == "NSS") { pair::iterator, bool> stored = - stored_algos.insert("RADAR") ; + stored_algos.insert("NSS") ; if (stored.second) // Check if there was no previous instance - algorithms.push_back(new RADAR) ; + algorithms.push_back(new NSS) ; } else diff --git a/owlps-positioning/src/radar.hh b/owlps-positioning/src/radar.hh deleted file mode 100644 index 1549cb7..0000000 --- a/owlps-positioning/src/radar.hh +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef _OWLPS_POSITIONING_RADAR_HH_ -#define _OWLPS_POSITIONING_RADAR_HH_ - -#include "cartographyalgorithm.hh" - -/// Computes a position selecting the 1-closest point in SS cartography -/** - * This class is named after the positioning system conceived by Paramvir - * Bahl and Venkata N. Padmanabhan in their paper "RADAR: An In-Building - * RF-Based User Location and Tracking System" (2000). For more details, - * see: http://citeseer.ist.psu.edu/bahl00radar.html - */ -class RADAR: public CartographyAlgorithm -{ -public: - RADAR(void): PositioningAlgorithm("RADAR") {} - ~RADAR(void) {} - - const ReferencePoint& select_point(const Request &request) ; -} ; - -#endif // _OWLPS_POSITIONING_RADAR_HH_ diff --git a/owlps-positioning/src/stock.cc b/owlps-positioning/src/stock.cc index a1f8567..d8698b7 100644 --- a/owlps-positioning/src/stock.cc +++ b/owlps-positioning/src/stock.cc @@ -383,7 +383,7 @@ closest_reference_point(const Request &request) " list is empty!") ; bool ignore_aps = Configuration::bool_value( - "positioning.radar.ignore-ap-reference-points") ; + "positioning.nss.ignore-ap-reference-points") ; unordered_set::const_iterator i = reference_points.begin() ; @@ -664,7 +664,7 @@ closest_calibration_request(const Request &request) " requests' list is empty!") ; bool ignore_aps = Configuration::bool_value( - "positioning.radar.ignore-ap-reference-points") ; + "positioning.nss.ignore-ap-reference-points") ; unordered_set::const_iterator i = calibration_requests.begin() ; diff --git a/owlps-positioning/src/userinterface.cc b/owlps-positioning/src/userinterface.cc index 5cf3725..7eb19f6 100644 --- a/owlps-positioning/src/userinterface.cc +++ b/owlps-positioning/src/userinterface.cc @@ -200,7 +200,7 @@ void UserInterface::fill_positioning_options() po::value< vector >()->composing(), "Algorithms used to compute positions. You can specify" " this option more than once (but at least once). Allowed: Real," - " FBCM, FRBHMBasic, InterlinkNetworks, RADAR.") + " FBCM, FRBHMBasic, InterlinkNetworks, NSS.") ("positioning.accept-new-mobiles", po::value()->default_value(false), "When receiving requests, add unknown mobiles (mobiles which are not" @@ -251,16 +251,16 @@ void UserInterface::fill_positioning_options() " calibration requests to be positioned as normal requests." " The default is to add them to the calibration requests' list" " without position them.") - ("positioning.radar.average-reference-points", + ("positioning.nss.average-reference-points", po::value()->default_value(false), - "With the RADAR algorithm, for a given positioning request, average" + "With the NSS algorithm, for a given positioning request, average" " all the calibration requests associated with a reference point" " before to compute the SS distance." " The default is false, i.e the positioning request is compared" " directly to each calibration request.") - ("positioning.radar.ignore-ap-reference-points", + ("positioning.nss.ignore-ap-reference-points", po::value()->default_value(false), - "With the RADAR algorithm, try to avoid selecting the reference" + "With the NSS algorithm, try to avoid selecting the reference" " points which are coordinates of an AP.") ; diff --git a/owlps-positioning/tests/radar_test.hh b/owlps-positioning/tests/nss_test.hh similarity index 79% rename from owlps-positioning/tests/radar_test.hh rename to owlps-positioning/tests/nss_test.hh index f1dab63..7045be4 100644 --- a/owlps-positioning/tests/radar_test.hh +++ b/owlps-positioning/tests/nss_test.hh @@ -1,14 +1,14 @@ #include -#include "radar.hh" +#include "nss.hh" -class RADAR_test: public CxxTest::TestSuite +class NSS_test: public CxxTest::TestSuite { public: void test_select_point(void) { - CartographyAlgorithm *algo = new RADAR() ; + CartographyAlgorithm *algo = new NSS() ; /* * TODO: implement the test.