Soum, faut mettre des commentaires de révisions !

git-svn-id: https://pif.pu-pm.univ-fcomte.fr/svn/loc@50 785a6c6c-259e-4ff1-8b91-dc31627914f0
This commit is contained in:
Soumaya Zirari 2008-07-08 22:19:56 +00:00 committed by Matteo Cypriani
parent 3b02ec985f
commit 1f5ce0426a
2 changed files with 29 additions and 11 deletions

View File

@ -1,4 +1,5 @@
#include "server.hh"
#include <cmath>
@ -1152,14 +1153,17 @@ Point Server::fbcm_friis( const vector<Measurement> &m, const vector<float> frii
}
/* Then: min-max */
minmax_res = 1000000;
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)
{
minmax_max = 0;
for (i = 0 ; i < centres.size() ; i++)
if ((centres[i].squareDistance(x, y, 3) - (dist_vect[i]*dist_vect[i])) > minmax_max)
minmax_max = centres[i].squareDistance(x, y, 3) - (dist_vect[i] * dist_vect[i]);
minmax_max = 0;
for (i = 0 ; i < centres.size() ; i++)
if ((std::abs(centres[i].distance(Point(x, y, 3)) - dist_vect[i])) > minmax_max)
{
minmax_max = std::abs(centres[i].distance(Point(x, y, 3)) - dist_vect[i]);
//cout << "minmax_max: " << minmax_max << endl;
}
if (minmax_max < minmax_res)
{
ret.setX(x);
@ -1172,7 +1176,7 @@ Point Server::fbcm_friis( const vector<Measurement> &m, const vector<float> frii
addr.clear();
dist_vect.clear();
centres.clear();
cout << "RESULTAT DU FRBHM ---> " << ret << endl ;
//cout << "RESULTAT DU FRBHM ---> " << ret << endl ;
#ifdef DEBUG_T
cout << "//<-- Server::fbcm_friis()" << endl ; fflush(stdout) ;
@ -2145,6 +2149,8 @@ void Server::monitorClient(const unsigned int &client_id, const ALGORITHM &algo)
Point position ;
float_array dst_matrix ;
vector<float> friisFromList;
Point pointFastViterbi;
Point Frbhmbasique;
#ifdef TEST
vector<ReferencePoint> peregrination_point_list ;
@ -2202,14 +2208,26 @@ void Server::monitorClient(const unsigned int &client_id, const ALGORITHM &algo)
break ;
case ALGO_BASIC_FRBHM : /* Application de l'algorithme FRBHM basique */
cout << "-------FRBHM---------" << endl ;
computeFriisFromRefList() ;
cout << "-------FRBHM BASIQUE---------" << endl ;
//computeFriisFromRefList() ;
selectDistances(&dst_matrix, E_previous, E_current) ; // On récupère une sous-matrice de reference_point_matrix avec les distances entre les points de E_previous et E_current.
position = fastViterbiLike(client_id, dst_matrix) ;
friisFromList = computeFriisFromRefList(position, vm) ;
fbcm_friis(vm, friisFromList) ;
//fbcm_friis(vm, friisFromList) ;
Frbhmbasique = fbcm_friis(vm, friisFromList);
cout << "Point selectioné: " << Frbhmbasique << endl;
break ;
case ALGO_CONTINU_FRBHM : /*Application de l'algorithme FRBHM continu */
cout << "--------FRBHM CONTINU------------" << endl ;
//computeFriisFromRefList();
for(unsigned int i= 0 ; i<E_current.size() ;i++)
{
friisFromList = computeFriisFromRefList(E_current[i],vm);
E_current[i] = fbcm_friis(vm, friisFromList);
}
pointFastViterbi = fastViterbiLike(client_id, dst_matrix) ;
cout << "Point selectionné: " << pointFastViterbi << endl;
break;
default :
cerr << "Erreur ! Algorithme inconnu." << endl ;
}

View File

@ -48,7 +48,7 @@ typedef ClientInfo::float_index float_index ;
//#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).
typedef enum { ALGO_VLI = 1, ALGO_BASIC_FRBHM } ALGORITHM ;
typedef enum { ALGO_VLI = 1, ALGO_BASIC_FRBHM = 2, ALGO_CONTINU_FRBHM = 3 } ALGORITHM ;
class Server