Constante pour les algos dans monitorClient()
server.{cc,hh} : * Ajout d'un type "ALGORITHM" pour utiliser des noms compréhensibles plutôt que des entiers pour désigner les différents algorithmes utilisables dans la fonction monitorClient(). git-svn-id: https://pif.pu-pm.univ-fcomte.fr/svn/loc@45 785a6c6c-259e-4ff1-8b91-dc31627914f0
This commit is contained in:
parent
7a938066a0
commit
269594c26e
|
@ -19,7 +19,7 @@ int main(int argc, char ** argv)
|
|||
Server server ;
|
||||
|
||||
server.createClient() ;
|
||||
server.monitorClient(0,2) ;
|
||||
server.monitorClient(0, ALGO_BASIC_FRBHM) ;
|
||||
|
||||
cout << argv[0] << " : fin." << endl ;
|
||||
fflush(stdout) ;
|
||||
|
|
|
@ -1228,7 +1228,7 @@ ClientInfo& Server::createClient()
|
|||
|
||||
|
||||
/* Localise le client d'identifiant "client_id" en appliquant l'algorithme voulu. */
|
||||
void Server::monitorClient(const unsigned int &client_id, int algo)
|
||||
void Server::monitorClient(const unsigned int &client_id, ALGORITHM algo)
|
||||
{
|
||||
Point pointFastViterbi;
|
||||
vector<float> friisFromList;
|
||||
|
@ -1294,20 +1294,24 @@ void Server::monitorClient(const unsigned int &client_id, int algo)
|
|||
#ifdef DEBUG
|
||||
cout << "Point courant : " << peregrination_point_list[pt] ;
|
||||
#endif // DEBUG
|
||||
switch(algo)
|
||||
|
||||
switch (algo)
|
||||
{
|
||||
case 1:/* Application de l'algorithme Viterbi */
|
||||
fastViterbiLike(client_id, NULL) ;
|
||||
break;
|
||||
case 2 :/*Application de l'algorithme FRBHM basique*/
|
||||
cout<<"-------FRBHM---------"<<endl;
|
||||
computeFriisFromRefList();
|
||||
pointFastViterbi=fastViterbiLike(client_id, NULL) ;
|
||||
friisFromList= computeFriisFromRefList(pointFastViterbi,vm);
|
||||
fbcm_friis(vm, friisFromList);
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
case ALGO_VLI : /* Application de l'algorithme Viterbi */
|
||||
fastViterbiLike(client_id, NULL) ;
|
||||
break ;
|
||||
|
||||
case ALGO_BASIC_FRBHM : /* Application de l'algorithme FRBHM basique */
|
||||
cout << "-------FRBHM---------" << endl ;
|
||||
computeFriisFromRefList() ;
|
||||
pointFastViterbi = fastViterbiLike(client_id, NULL) ;
|
||||
friisFromList = computeFriisFromRefList(pointFastViterbi, vm) ;
|
||||
fbcm_friis(vm, friisFromList) ;
|
||||
break ;
|
||||
|
||||
default :
|
||||
cerr << "Erreur ! Algorithme inconnu." << endl ;
|
||||
}
|
||||
|
||||
#ifdef TEST
|
||||
pt++ ;
|
||||
|
|
|
@ -32,7 +32,7 @@ typedef ClientInfo::float_index float_index ;
|
|||
#define DEFAULT_LOGFILE "log/radar_exp.csv" // Fichier de sortie
|
||||
#define DEFAULT_REF_POINT_FILE "csv/agreg/toutes.csv" // Fichier des points de référence
|
||||
#define DEFAULT_AP_FILE "cfg/minipc.cfg" // Fichier de configuration des AP
|
||||
#define DEFAULT_TRACKING_FILE "csv/agreg/divagation.csv" // Fichier de prérégrination
|
||||
#define DEFAULT_TRACKING_FILE "csv/agreg/divagation6_10_25000.csv" // Fichier de prérégrination
|
||||
#define DEFAULT_TOPOLOGY_FILE "cfg/topo.csv"
|
||||
#define DEFAULT_DISTANCE_FILE "cfg/distances.csv"
|
||||
#define DEFAULT_IP "127.0.0.1"
|
||||
|
@ -47,6 +47,8 @@ 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 ;
|
||||
|
||||
|
||||
class Server
|
||||
{
|
||||
|
@ -110,7 +112,7 @@ public:
|
|||
|
||||
unsigned int getNbReferencePoints()const { return reference_point_list.size(); };
|
||||
|
||||
void monitorClient(const unsigned int &client_id, int algo) ;
|
||||
void monitorClient(const unsigned int &client_id, ALGORITHM algo) ;
|
||||
Point fastViterbiLike(const unsigned int &id_client, float **distance_matrix) ;
|
||||
|
||||
/* For experimentation purpose only ! */
|
||||
|
|
Loading…
Reference in New Issue