diff --git a/GuiNuMo-server/server.cc b/GuiNuMo-server/server.cc index 032644c..8401a6e 100644 --- a/GuiNuMo-server/server.cc +++ b/GuiNuMo-server/server.cc @@ -2275,8 +2275,8 @@ void Server::monitorClient(const unsigned int &client_id, const ALGORITHM &algo) //fbcm_friis(vm, friisFromList) ; //Just to see cout << "---------------------------" << endl; - for(unsigned int prout = 0 ; prout < access_point_list.size() ; prout ++) - cout << "Dist between ap " << access_point_list[prout].getCoordinates() << " and true point = " << access_point_list[prout].getCoordinates().distance(peregrination_point_list[pt].getCoordinates()) << endl; + for(unsigned int i = 0 ; i < access_point_list.size() ; i ++) + cout << "Dist between ap " << access_point_list[i].getCoordinates() << " and true point = " << access_point_list[i].getCoordinates().distance(peregrination_point_list[pt].getCoordinates()) << endl; //end of 'just to see' Frbhmbasique = fbcm_friis(vm, friisFromList, position.getZ()); cout << "Point selectionné final: " << Frbhmbasique << endl; @@ -2295,8 +2295,8 @@ void Server::monitorClient(const unsigned int &client_id, const ALGORITHM &algo) //Just to see cout << "---------------------------" << endl; - for(unsigned int prout = 0 ; prout < access_point_list.size() ; prout ++) - cout << "Dist between ap " << access_point_list[prout].getCoordinates() << " and true point " << peregrination_point_list[pt].getCoordinates() << " = " << access_point_list[prout].getCoordinates().distance(peregrination_point_list[pt].getCoordinates()) << endl; + for(unsigned int i = 0 ; i < access_point_list.size() ; i ++) + cout << "Dist between ap " << access_point_list[i].getCoordinates() << " and true point " << peregrination_point_list[pt].getCoordinates() << " = " << access_point_list[i].getCoordinates().distance(peregrination_point_list[pt].getCoordinates()) << endl; //end of 'just to see' for (unsigned int i = 0 ; i < E_current.size() ; i++) @@ -2461,17 +2461,77 @@ void Server::radar_exp() \tInterlink\t(Error)\ \tRADAR\t(Error)\ \tFBCM\t(Error)\ +\t1 NSS + FBCM\t(Error)\ \t2 NSS\t(Error)\ \t3 NSS\t(Error)\ \t5 NSS\t(Error)\ " << endl ; cout << reference_point_list.size() << " reference points." << endl ; - for (i = 0 ; i < reference_point_list.size() ; i++) + +//#define PEREGRINATION // À décommenter pour utiliser les points du fichier DEFAULT_TRACKING_FILE plutôt que les points de référence. + +#ifdef PEREGRINATION + /* *** Code pour utiliser les points de prérégrination : *** */ + + vector peregrination_point_list ; + makePointListFromFile(peregrination_point_list, DEFAULT_TRACKING_FILE, false) ; + cout << peregrination_point_list.size() << " peregrination points to test." << endl ; + + for (i = 0 ; i < peregrination_point_list.size() ; i++) { /* Get point measurements */ - vm = reference_point_list[i].getMeasurementList(); - ref_coords = reference_point_list[i].getCoordinates(); + vm = peregrination_point_list[i].getMeasurementList(); + ref_coords = peregrination_point_list[i].getCoordinates(); + + /* Print point coordinates */ + logfile << ref_coords << "\t"; + + /* Interlink Networks */ + solution = interlink(vm, 0) ; + logfile << solution << "\t" << solution.distance(ref_coords) << "\t" ; + + /* RADAR */ + solution = getkClosestInSs(vm, 1, NULL)[0] ; + logfile << solution << "\t" << solution.distance(ref_coords) << "\t" ; + + /* FBCM */ + solution = fbcm(vm, 0) ; + logfile << solution << "\t" << solution.distance(ref_coords) << "\t" ; + + /* 1-NSS + FBCM */ + solution = getkClosestInSs(vm, 1, NULL)[0] ; + solution = fbcm_friis(vm, computeFriisFromRefList(solution, vm), solution.getZ()) ; + logfile << solution << "\t" << solution.distance(ref_coords) << "\t" ; + + /* 2-NSS */ + solution = getkWeightedInSs(vm, 2, NULL); + logfile << solution << "\t" << solution.distance(ref_coords) << "\t"; + + /* 3-NSS */ + solution = getkWeightedInSs(vm, 3, NULL); + logfile << solution << "\t" << solution.distance(ref_coords) << "\t"; + + /* 5-NSS */ + solution = getkWeightedInSs(vm, 5, NULL); + logfile << solution << "\t" << solution.distance(ref_coords) << "\t"; + + logfile << endl ; + vm.clear() ; + } + +#else // PEREGRINATION + /* *** Code pour utiliser les points de référence : *** */ + + vector test_point_list ; + makePointListFromFile(test_point_list, DEFAULT_REF_POINT_FILE_1M, true) ; + cout << test_point_list.size() << " reference points to test." << endl ; + + for (i = 0 ; i < test_point_list.size() ; i++) + { + /* Get point measurements */ + vm = test_point_list[i].getMeasurementList(); + ref_coords = test_point_list[i].getCoordinates(); /* Print point coordinates */ logfile << ref_coords << "\t"; @@ -2488,21 +2548,27 @@ void Server::radar_exp() solution = fbcm(vm, 0) ; logfile << solution << "\t" << solution.distance(ref_coords) << "\t" ; - /* K-weighted-SS, K = 2 */ + /* 1-NSS + FBCM */ + solution = getkClosestInSs(vm, 1, &ref_coords)[0] ; + solution = fbcm_friis(vm, computeFriisFromRefList(solution, vm), solution.getZ()) ; + logfile << solution << "\t" << solution.distance(ref_coords) << "\t" ; + + /* 2-NSS */ solution = getkWeightedInSs(vm, 2, &ref_coords); logfile << solution << "\t" << solution.distance(ref_coords) << "\t"; - /* K-weighted-SS, K = 3 */ + /* 3-NSS */ solution = getkWeightedInSs(vm, 3, &ref_coords); logfile << solution << "\t" << solution.distance(ref_coords) << "\t"; - /* K-weighted-SS, K = 5 */ + /* 5-NSS */ solution = getkWeightedInSs(vm, 5, &ref_coords); logfile << solution << "\t" << solution.distance(ref_coords) << "\t"; logfile << endl ; vm.clear() ; } +#endif // PEREGRINATION logfile.close(); } diff --git a/GuiNuMo-server/server.hh b/GuiNuMo-server/server.hh index 8e27afc..1f176be 100644 --- a/GuiNuMo-server/server.hh +++ b/GuiNuMo-server/server.hh @@ -31,9 +31,10 @@ typedef ClientInfo::float_index float_index ; #define DEFAULT_LOGFILE "log/radar_exp.csv" // Fichier de sortie -#define DEFAULT_REF_POINT_FILE "csv/agreg/1m/toutes.csv" // Fichier des points de référence +#define DEFAULT_REF_POINT_FILE "csv/agreg/1ppp/toutes.csv" // Fichier des points de référence +#define DEFAULT_REF_POINT_FILE_1M "csv/agreg/1m/toutes.csv" // Fichier contenant tous les points de référence (maillage à 1m) #define DEFAULT_AP_FILE "cfg/minipc.cfg" // Fichier de configuration des AP -#define DEFAULT_TRACKING_FILE "csv/agreg/divagation/divagation9.csv" // Fichier de prérégrination +#define DEFAULT_TRACKING_FILE "csv/agreg/divagation/divagation9_interpolé.csv" // Fichier de prérégrination #define DEFAULT_TOPOLOGY_FILE "cfg/topo.csv" #define DEFAULT_WAYPOINT_FILE "cfg/waypoints.csv" #define DEFAULT_IP "127.0.0.1"