End of FRBHM implementation

voila on m'oblige mettre un com

j'ai fini les FRBHM

git-svn-id: https://pif.pu-pm.univ-fcomte.fr/svn/loc@52 785a6c6c-259e-4ff1-8b91-dc31627914f0
This commit is contained in:
Soumaya Zirari 2008-07-09 16:14:21 +00:00 committed by Matteo Cypriani
parent 2a56009c16
commit e9453590ef
2 changed files with 25 additions and 10 deletions

View File

@ -9,7 +9,7 @@
/* Tronque le float "f" à "n" décimales et le retourne */
inline float round_float(float f, int n)
{
n = pow(10, n) ;
n = (int) pow((double) 10, (double) n) ;
float f_dec = modff(f, &f) ;
f_dec = floor(f_dec * n) / n ;
@ -2186,6 +2186,8 @@ void Server::monitorClient(const unsigned int &client_id, const ALGORITHM &algo)
vector<float> friisFromList;
Point pointFastViterbi;
Point Frbhmbasique;
string filename = "trajet.txt";
ofstream fichier;
#ifdef TEST
vector<ReferencePoint> peregrination_point_list ;
@ -2251,20 +2253,33 @@ void Server::monitorClient(const unsigned int &client_id, const ALGORITHM &algo)
//fbcm_friis(vm, friisFromList) ;
Frbhmbasique = fbcm_friis(vm, friisFromList);
cout << "Point selectioné: " << Frbhmbasique << endl;
fichier.open(filename.c_str(), std::ios::app);
if ( !fichier ){
cerr << "Erreur de creation du fichier" << endl;
exit(1);
}
fichier << Frbhmbasique << std::endl;
fichier.close();
break ;
case ALGO_CONTINU_FRBHM : /* Application de l'algorithme FRBHM continu */
cout << "--------FRBHM CONTINU------------" << endl ;
//computeFriisFromRefList();
computeTopologyDistances(&dst_matrix, E_previous, E_current) ; // On calcule les distances entre les points de E_previous et E_current, en tenant compte de la topologie).
for (unsigned int i = 0 ; i < E_current.size() ; i++)
{
friisFromList = computeFriisFromRefList(E_current[i], vm) ;
E_current[i] = fbcm_friis(vm, friisFromList) ;
}
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 ;
fichier.open(filename.c_str(), std::ios::app);
cout << "Point selectionné: " << pointFastViterbi << endl;
if ( !fichier ){
cerr << "Erreur de creation du fichier" << endl;
exit(1);
}
fichier << pointFastViterbi << endl;
fichier.close();
break;
default :
cerr << "Erreur ! Algorithme inconnu." << endl ;

View File

@ -33,7 +33,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/divagation6_10_25000.csv" // Fichier de prérégrination
#define DEFAULT_TRACKING_FILE "csv/agreg/divagation.csv" // Fichier de prérégrination
#define DEFAULT_TOPOLOGY_FILE "cfg/topo.csv"
#define DEFAULT_WAYPOINT_FILE "cfg/waypoints.csv"
#define DEFAULT_IP "127.0.0.1"