Affichage debug dans monitorClient()
Qql affichages de débug dans monitorClient pour Soum. (et Dom qui parle de têtes et de queues à Seb en face de moi) git-svn-id: https://pif.pu-pm.univ-fcomte.fr/svn/loc@61 785a6c6c-259e-4ff1-8b91-dc31627914f0
This commit is contained in:
parent
87ce0df1c5
commit
9b12e3cb0d
|
@ -16,4 +16,4 @@
|
|||
00:13:CE:8F:77:43;7.085;4.13;0.74;2417000000;5.0;20.0
|
||||
|
||||
# mini1 (Adrien)
|
||||
00:13:CE:8F:78:D9;30.35;5.74;0.98;2417000000;5.0;20.0
|
||||
00:13:CE:8F:78:D9;5.74;30.35;0.98;2417000000;5.0;20.0
|
||||
|
|
|
@ -1092,7 +1092,7 @@ Point Server::fbcm(const vector<Measurement> &m, const int &client_idx)const
|
|||
minmax_res = 1000000;
|
||||
for (x = MINMAX_X_START ; x < MINMAX_X_STOP ; x += MINMAX_STEP)
|
||||
for (y = MINMAX_Y_START ; y < MINMAX_Y_STOP ; y += MINMAX_STEP)
|
||||
for(z = MINMAX_Z_START ; z <= MINMAX_Z_STOP ; z += MINMAX_Z_STEP)
|
||||
for(z = MINMAX_Z_START ; z <= MINMAX_Z_STOP ; z += MINMAX_STEP)
|
||||
{
|
||||
minmax_max = 0;
|
||||
for (i = 0 ; i < centres.size() ; i++)
|
||||
|
@ -2111,46 +2111,44 @@ vector<float> Server::computeFriisFromRefList(const Point &p, const vector<Measu
|
|||
string ap_mac;
|
||||
|
||||
|
||||
for (unsigned int i = 0 ; i < access_point_list.size() ; i++)
|
||||
{
|
||||
cout << "La distance entre le point d'accés: " << access_point_list[i].getCoordinates()<< "et le point -->" << p.distance(access_point_list[i].getCoordinates()) << endl;
|
||||
}
|
||||
for (unsigned int i = 0 ; i < access_point_list.size() ; i++)
|
||||
{
|
||||
cout << "La distance entre le point d'accés: " << access_point_list[i].getCoordinates()<< "et le point -->" << p.distance(access_point_list[i].getCoordinates()) << endl;
|
||||
}
|
||||
|
||||
/* Compute an index for each ref point. List stored in friis_idx_list */
|
||||
/* Compute an index for Point p. List stored in friis_idx_list */
|
||||
for (unsigned int j = 0 ; j < reference_point_list.size() ; j++)
|
||||
{
|
||||
pt_coords = reference_point_list[j].getCoordinates();
|
||||
//cout << "Distance entre le point de reference" << reference_point_list[j].getCoordinates() << "et le point: "<< j << "-->" << p.distance(pt_coords) << endl;
|
||||
if (pt_coords==p)
|
||||
{
|
||||
for (unsigned int i = 0 ; i < access_point_list.size() ; i++)
|
||||
{
|
||||
ap_power = access_point_list[i].getOutputPower();
|
||||
ap_coords = access_point_list[i].getCoordinates();
|
||||
ap_freq = access_point_list[i].getFrequency();
|
||||
ap_gain = access_point_list[i].getAntennaGain();
|
||||
ap_mac = access_point_list[i].getApAddr();
|
||||
/* Compute an index for each ref point. List stored in friis_idx_list */
|
||||
/* Compute an index for Point p. List stored in friis_idx_list */
|
||||
for (unsigned int j = 0 ; j < reference_point_list.size() ; j++)
|
||||
{
|
||||
pt_coords = reference_point_list[j].getCoordinates();
|
||||
//cout << "Distance entre le point de reference" << reference_point_list[j].getCoordinates() << "et le point: "<< j << "-->" << p.distance(pt_coords) << endl;
|
||||
if (pt_coords==p)
|
||||
{
|
||||
for (unsigned int i = 0 ; i < access_point_list.size() ; i++)
|
||||
{
|
||||
ap_power = access_point_list[i].getOutputPower();
|
||||
ap_coords = access_point_list[i].getCoordinates();
|
||||
ap_freq = access_point_list[i].getFrequency();
|
||||
ap_gain = access_point_list[i].getAntennaGain();
|
||||
ap_mac = access_point_list[i].getApAddr();
|
||||
|
||||
/* Compute main general term, independant from scans */
|
||||
const_term = calib_gain + ap_gain;
|
||||
const_term -= 20 * log10(4 * M_PI);
|
||||
const_term += 20 * log10 (300000000.0 / ap_freq) + ap_power;
|
||||
|
||||
if (reference_point_list[j].getPowerForAp(ap_mac, &mes_power)){
|
||||
friis_idx_list.push_back((const_term - mes_power) / (10 * log10(ap_coords.distance(pt_coords))));
|
||||
}
|
||||
}
|
||||
/* Compute main general term, independant from scans */
|
||||
const_term = calib_gain + ap_gain;
|
||||
const_term -= 20 * log10(4 * M_PI);
|
||||
const_term += 20 * log10 (300000000.0 / ap_freq) + ap_power;
|
||||
|
||||
if (reference_point_list[j].getPowerForAp(ap_mac, &mes_power)){
|
||||
friis_idx_list.push_back((const_term - mes_power) / (10 * log10(ap_coords.distance(pt_coords))));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for (unsigned int k=0; k < friis_idx_list.size();k++)
|
||||
cout<<"friis_idx_list"<< k <<": "<<friis_idx_list[k]<<endl;//
|
||||
}
|
||||
|
||||
#ifdef DEBUG_T
|
||||
cout << "//<-- Server::computeFriisFromRefList(&Point, &vector<Measurement>)" << endl ; fflush(stdout) ;
|
||||
#endif // DEBUG_T
|
||||
|
||||
return friis_idx_list;
|
||||
return friis_idx_list;
|
||||
}
|
||||
|
||||
|
||||
|
@ -2263,6 +2261,11 @@ void Server::monitorClient(const unsigned int &client_id, const ALGORITHM &algo)
|
|||
cout << "Position: " << position << endl;
|
||||
friisFromList = computeFriisFromRefList(position, vm) ;
|
||||
//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;
|
||||
//end of 'just to see'
|
||||
Frbhmbasique = fbcm_friis(vm, friisFromList, position.getZ());
|
||||
cout << "Point selectionné final: " << Frbhmbasique << endl;
|
||||
fichier.open(filename.c_str(), std::ios::app);
|
||||
|
@ -2277,6 +2280,13 @@ void Server::monitorClient(const unsigned int &client_id, const ALGORITHM &algo)
|
|||
case ALGO_CONTINU_FRBHM : /* Application de l'algorithme FRBHM continu */
|
||||
cout << "--------FRBHM CONTINU------------" << endl ;
|
||||
//computeFriisFromRefList();
|
||||
|
||||
//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;
|
||||
//end of 'just to see'
|
||||
|
||||
for (unsigned int i = 0 ; i < E_current.size() ; i++)
|
||||
{
|
||||
friisFromList = computeFriisFromRefList(E_current[i], vm) ;
|
||||
|
|
|
@ -40,13 +40,12 @@ typedef ClientInfo::float_index float_index ;
|
|||
#define DEFAULT_LISTEN_PORT 7777
|
||||
#define LIGHT_SPEED 300000000
|
||||
#define MINMAX_STEP 0.5
|
||||
#define MINMAX_Z_STEP 3
|
||||
#define MINMAX_X_START -1
|
||||
#define MINMAX_Y_START -1
|
||||
#define MINMAX_Z_START 0
|
||||
#define MINMAX_X_STOP 15
|
||||
#define MINMAX_Y_STOP 45
|
||||
#define MINMAX_Z_STOP 3
|
||||
#define MINMAX_Z_STOP 6
|
||||
#define BUFFER_LENGTH 5000
|
||||
//#define DEFAULT_Z 3 // Décommenter pour utiliser des fichiers d'entrée avec des coordonnées dans un seul plan (X, Y).
|
||||
//#define FRED_CSV_FORMAT // Décommenter pour utiliser les fichiers CSV au « format Fred » (plusieurs lignes par mesure, avec un AP par ligne).
|
||||
|
|
Loading…
Reference in New Issue