diff --git a/GuiNuMo-server/guinumo.cc b/GuiNuMo-server/guinumo.cc index 1f2a9e2..c1d383e 100644 --- a/GuiNuMo-server/guinumo.cc +++ b/GuiNuMo-server/guinumo.cc @@ -19,7 +19,7 @@ int main(int argc, char ** argv) Server server ; server.createClient() ; - server.monitorClient(0, ALGO_BASIC_FRBHM) ; + server.monitorClient(0, ALGO_CONTINU_FRBHM) ; cout << argv[0] << " : fin." << endl ; fflush(stdout) ; diff --git a/GuiNuMo-server/server.cc b/GuiNuMo-server/server.cc index 78581da..c124cc3 100644 --- a/GuiNuMo-server/server.cc +++ b/GuiNuMo-server/server.cc @@ -1,5 +1,4 @@ #include "server.hh" -#include @@ -1934,11 +1933,18 @@ void Server::makeReferencePointDistances() */ void Server::selectDistances(float_array *matrix, const vector &l1, const vector &l2) const { +#ifdef DEBUG_T + cout << "//--> Server::selectDistances()" << endl ; fflush(stdout) ; +#endif // DEBUG_T matrix->resize(boost::extents[l1.size()][l2.size()]) ; for (unsigned int i = 0 ; i < l1.size() ; i++) for (unsigned int j = 0 ; j < l2.size() ; j++) (*matrix)[i][j] = reference_point_matrix[pointIndex(l1[i])][pointIndex(l2[j])] ; + +#ifdef DEBUG_T + cout << "//<-- Server::selectDistances()" << endl ; fflush(stdout) ; +#endif // DEBUG_T } @@ -1947,11 +1953,40 @@ void Server::selectDistances(float_array *matrix, const vector &l1, const */ void Server::computeEuclideanDistances(float_array *matrix, const vector &l1, const vector &l2) const { +#ifdef DEBUG_T + cout << "//--> Server::computeEuclideanDistances()" << endl ; fflush(stdout) ; +#endif // DEBUG_T + matrix->resize(boost::extents[l1.size()][l2.size()]) ; for (unsigned int i = 0 ; i < l1.size() ; i++) for (unsigned int j = 0 ; j < l2.size() ; j++) (*matrix)[i][j] = l1[i].distance(l2[j]) ; + +#ifdef DEBUG_T + cout << "//<-- Server::computeEuclideanDistances()" << endl ; fflush(stdout) ; +#endif // DEBUG_T +} + + + +/* Calcule et place dans "matrix" les distances euclidiennes entre les points de "l1" et de "l2". + */ +void Server::computeTopologyDistances(float_array *matrix, const vector &l1, const vector &l2) +{ +#ifdef DEBUG_T + cout << "//--> Server::computeTopologyDistances()" << endl ; fflush(stdout) ; +#endif // DEBUG_T + + matrix->resize(boost::extents[l1.size()][l2.size()]) ; + + for (unsigned int i = 0 ; i < l1.size() ; i++) + for (unsigned int j = 0 ; j < l2.size() ; j++) + (*matrix)[i][j] = distanceTopology(l1[i], l2[j]) ; + +#ifdef DEBUG_T + cout << "//<-- Server::computeTopologyDistances()" << endl ; fflush(stdout) ; +#endif // DEBUG_T } @@ -2217,17 +2252,20 @@ void Server::monitorClient(const unsigned int &client_id, const ALGORITHM &algo) 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 &l1, const vector &l2) const ; void computeEuclideanDistances(float_array *matrix, const vector &l1, const vector &l2) const ; + void computeTopologyDistances(float_array *matrix, const vector &l1, const vector &l2) ; void printReferencePointList() ; void printPointList(vector &point_list) ;