owlps/GuiNuMo-server/clientinfo.hh

56 lines
1.5 KiB
C++

#ifndef _CLIENTINFO_HH_
#define _CLIENTINFO_HH_
#include <iostream>
#include <string>
#include <vector>
#include <boost/multi_array.hpp>
#include "guinumo.hh"
#include "point.hh"
using namespace std;
#define CLIENT_DEFAULT_PORT 7778
#define CLIENT_DEFAULT_IP "127.0.0.1"
#define CLIENT_DEFAULT_ANTENNA_GAIN 2 // Good default value
#define VITERBI_N 5
#define VITERBI_K 8
class ClientInfo
{
public :
typedef boost::multi_array<float, 2> float_array ; // On utilise boost::multi_array pour viterbi_V.
typedef float_array::index float_index ;
protected:
string client_ip;
float antenna_gain;
int client_listen_port;
vector<Point> viterbi_Ecurrent; // Last vector
vector<Point> viterbi_Eprevious; // Previous vector
// float viterbi_distances[5];
float_array viterbi_V ;
unsigned int viterbi_iteration ; // Nombre d'ensembles d'historique qu'on a déjà passés
public:
ClientInfo(const string &ip = CLIENT_DEFAULT_IP, const int &port = CLIENT_DEFAULT_PORT, const float &antg = CLIENT_DEFAULT_ANTENNA_GAIN);
ClientInfo(const ClientInfo &c) ;
~ClientInfo();
ClientInfo operator=(const ClientInfo &c) ;
bool operator==(const ClientInfo &c) ;
float getAntennaGain()const { return antenna_gain; };
vector<Point>& getRef_viterbi_Ecurrent() { return viterbi_Ecurrent; } ;
vector<Point>& getRef_viterbi_Eprevious() { return viterbi_Eprevious; } ;
unsigned int& getRef_viterbi_iteration() { return viterbi_iteration ; } ;
float_array& getRef_viterbi_V() { return viterbi_V; } ;
void print_viterbi_V() const ;
};
#endif // _CLIENTINFO_HH_