From 1f5ce0426abeb915ee17c4c1f792d9a5f32afdb0 Mon Sep 17 00:00:00 2001 From: Soumaya Zirari Date: Tue, 8 Jul 2008 22:19:56 +0000 Subject: [PATCH] =?UTF-8?q?Soum,=20faut=20mettre=20des=20commentaires=20de?= =?UTF-8?q?=20r=C3=A9visions=20!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://pif.pu-pm.univ-fcomte.fr/svn/loc@50 785a6c6c-259e-4ff1-8b91-dc31627914f0 --- GuiNuMo-server/server.cc | 38 ++++++++++++++++++++++++++++---------- GuiNuMo-server/server.hh | 2 +- 2 files changed, 29 insertions(+), 11 deletions(-) diff --git a/GuiNuMo-server/server.cc b/GuiNuMo-server/server.cc index 904c104..78581da 100644 --- a/GuiNuMo-server/server.cc +++ b/GuiNuMo-server/server.cc @@ -1,4 +1,5 @@ #include "server.hh" +#include @@ -1152,14 +1153,17 @@ Point Server::fbcm_friis( const vector &m, const vector 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 &m, const vector 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 friisFromList; + Point pointFastViterbi; + Point Frbhmbasique; #ifdef TEST vector 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