GuiNuMo: modify radar_exp()
server.hh : * Modification des fichiers de mesures. server.{cc,hh} : * Les variables 'prout' mises par je ne sais pas trop qui dans monitorClient(), ça ne le fait pas quand on montre du code à son suiveur de stage ! * radar_exp() : - Ajout de 1-NSS+FBCM. - Utilisation du maillage complet comme points de tests (nouvelle variable, DEFAULT_REF_POINT_FILE_1M), et d'un éventuel sous-maillage comme points de référence (variable normale, DEFAULT_REF_POINT_FILE). - Ajout de la possibilité d'utiliser les points de pérégrination comme points de test. git-svn-id: https://pif.pu-pm.univ-fcomte.fr/svn/loc@66 785a6c6c-259e-4ff1-8b91-dc31627914f0
This commit is contained in:
parent
2236f24c55
commit
9c3e39ee29
|
@ -2275,8 +2275,8 @@ void Server::monitorClient(const unsigned int &client_id, const ALGORITHM &algo)
|
||||||
//fbcm_friis(vm, friisFromList) ;
|
//fbcm_friis(vm, friisFromList) ;
|
||||||
//Just to see
|
//Just to see
|
||||||
cout << "---------------------------" << endl;
|
cout << "---------------------------" << endl;
|
||||||
for(unsigned int prout = 0 ; prout < access_point_list.size() ; prout ++)
|
for(unsigned int i = 0 ; i < access_point_list.size() ; i ++)
|
||||||
cout << "Dist between ap " << access_point_list[prout].getCoordinates() << " and true point = " << access_point_list[prout].getCoordinates().distance(peregrination_point_list[pt].getCoordinates()) << endl;
|
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'
|
//end of 'just to see'
|
||||||
Frbhmbasique = fbcm_friis(vm, friisFromList, position.getZ());
|
Frbhmbasique = fbcm_friis(vm, friisFromList, position.getZ());
|
||||||
cout << "Point selectionné final: " << Frbhmbasique << endl;
|
cout << "Point selectionné final: " << Frbhmbasique << endl;
|
||||||
|
@ -2295,8 +2295,8 @@ void Server::monitorClient(const unsigned int &client_id, const ALGORITHM &algo)
|
||||||
|
|
||||||
//Just to see
|
//Just to see
|
||||||
cout << "---------------------------" << endl;
|
cout << "---------------------------" << endl;
|
||||||
for(unsigned int prout = 0 ; prout < access_point_list.size() ; prout ++)
|
for(unsigned int i = 0 ; i < access_point_list.size() ; i ++)
|
||||||
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;
|
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'
|
//end of 'just to see'
|
||||||
|
|
||||||
for (unsigned int i = 0 ; i < E_current.size() ; i++)
|
for (unsigned int i = 0 ; i < E_current.size() ; i++)
|
||||||
|
@ -2461,17 +2461,77 @@ void Server::radar_exp()
|
||||||
\tInterlink\t(Error)\
|
\tInterlink\t(Error)\
|
||||||
\tRADAR\t(Error)\
|
\tRADAR\t(Error)\
|
||||||
\tFBCM\t(Error)\
|
\tFBCM\t(Error)\
|
||||||
|
\t1 NSS + FBCM\t(Error)\
|
||||||
\t2 NSS\t(Error)\
|
\t2 NSS\t(Error)\
|
||||||
\t3 NSS\t(Error)\
|
\t3 NSS\t(Error)\
|
||||||
\t5 NSS\t(Error)\
|
\t5 NSS\t(Error)\
|
||||||
" << endl ;
|
" << endl ;
|
||||||
|
|
||||||
cout << reference_point_list.size() << " reference points." << 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<ReferencePoint> 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 */
|
/* Get point measurements */
|
||||||
vm = reference_point_list[i].getMeasurementList();
|
vm = peregrination_point_list[i].getMeasurementList();
|
||||||
ref_coords = reference_point_list[i].getCoordinates();
|
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<ReferencePoint> 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 */
|
/* Print point coordinates */
|
||||||
logfile << ref_coords << "\t";
|
logfile << ref_coords << "\t";
|
||||||
|
@ -2488,21 +2548,27 @@ void Server::radar_exp()
|
||||||
solution = fbcm(vm, 0) ;
|
solution = fbcm(vm, 0) ;
|
||||||
logfile << solution << "\t" << solution.distance(ref_coords) << "\t" ;
|
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);
|
solution = getkWeightedInSs(vm, 2, &ref_coords);
|
||||||
logfile << solution << "\t" << solution.distance(ref_coords) << "\t";
|
logfile << solution << "\t" << solution.distance(ref_coords) << "\t";
|
||||||
|
|
||||||
/* K-weighted-SS, K = 3 */
|
/* 3-NSS */
|
||||||
solution = getkWeightedInSs(vm, 3, &ref_coords);
|
solution = getkWeightedInSs(vm, 3, &ref_coords);
|
||||||
logfile << solution << "\t" << solution.distance(ref_coords) << "\t";
|
logfile << solution << "\t" << solution.distance(ref_coords) << "\t";
|
||||||
|
|
||||||
/* K-weighted-SS, K = 5 */
|
/* 5-NSS */
|
||||||
solution = getkWeightedInSs(vm, 5, &ref_coords);
|
solution = getkWeightedInSs(vm, 5, &ref_coords);
|
||||||
logfile << solution << "\t" << solution.distance(ref_coords) << "\t";
|
logfile << solution << "\t" << solution.distance(ref_coords) << "\t";
|
||||||
|
|
||||||
logfile << endl ;
|
logfile << endl ;
|
||||||
vm.clear() ;
|
vm.clear() ;
|
||||||
}
|
}
|
||||||
|
#endif // PEREGRINATION
|
||||||
|
|
||||||
logfile.close();
|
logfile.close();
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,9 +31,10 @@ typedef ClientInfo::float_index float_index ;
|
||||||
|
|
||||||
|
|
||||||
#define DEFAULT_LOGFILE "log/radar_exp.csv" // Fichier de sortie
|
#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_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_TOPOLOGY_FILE "cfg/topo.csv"
|
||||||
#define DEFAULT_WAYPOINT_FILE "cfg/waypoints.csv"
|
#define DEFAULT_WAYPOINT_FILE "cfg/waypoints.csv"
|
||||||
#define DEFAULT_IP "127.0.0.1"
|
#define DEFAULT_IP "127.0.0.1"
|
||||||
|
|
Loading…
Reference in New Issue