Map Matching
solver.h
Go to the documentation of this file.
1 #ifndef SOLVER_H
2 #define SOLVER_H
3 
4 #include <QObject>
5 
6 #include "file.h"
7 #include "grid.h"
8 #include "pointGPS.h"
9 #include "pointroad.h"
10 #include "road.h"
11 #include "track.h"
12 
13 #include <unordered_map>
14 #include <vector>
15 
16 class Solver : public QObject {
17  Q_OBJECT
18 public:
19  explicit Solver(QObject* parent = 0);
20 
21  void start();
22  void viterbiSetup();
23 
29  void setDistance(PointGPS* p, Road* r);
30 
31  void buildRoadPath();
32 
38  void readFiles(File file1, File file2);
39 
44  void filterSpace(double val);
45 
50  void filterTemp(int val);
51 
52  int getIndexFromRoadId(long id);
53 
54  QString m_gridFilename; // to move in protected once signals are in use
55  QString m_trackFilename;
56  //protected:
59  std::unordered_map<long, Road>* m_roads;
60  std::vector<PointRoad>* m_roadPoints;
61  std::vector<PointGPS*>* m_trackPoints;
62 
63 signals:
64  void signalMessage(QString);
65  void signalDimension(double xMin, double xMax, double yMin, double yMax);
66  void signalAllPoints(std::vector<PointGPS*>*);
67  void signalAllRoads(std::unordered_map<long, Road>*, std::vector<PointRoad>*);
68  void signalCurrentPoint(int id);
69  void signalRoadPath(std::vector<long>* rp);
70 public slots:
71  void onSignalSetGrid(QString s);
72  void onSignalSetTrack(QString s);
73  void onSignalStart();
74  void onSignalNextStep();
75  void onSignalNeighbours(std::vector<long>* roadsId);
76 
77 protected:
78  unsigned int m_currentStep;
79  std::vector<std::vector<float> > T1, T2;
80  std::vector<long> m_fromIndexToRoadId;
81  std::unordered_map<long, int> m_fromRoadIdToIndex;
82  std::vector<long>* prevRoadIds;
84 };
85 
86 #endif // SOLVER_H
void onSignalStart()
Definition: solver.cpp:105
void viterbiSetup()
Definition: solver.cpp:32
void signalCurrentPoint(int id)
std::vector< std::vector< float > > T2
Definition: solver.h:79
The File class.
Definition: file.h:13
unsigned int m_currentStep
Definition: solver.h:78
Track track
Definition: solver.h:57
Solver(QObject *parent=0)
Definition: solver.cpp:4
void onSignalNeighbours(std::vector< long > *roadsId)
Definition: solver.cpp:118
QString m_gridFilename
Definition: solver.h:54
int getIndexFromRoadId(long id)
Definition: solver.cpp:214
Road is an element of a network. Road are strongly linked with Points.
Definition: road.h:14
std::unordered_map< long, Road > * m_roads
Definition: solver.h:59
void setDistance(PointGPS *p, Road *r)
setDistance Calculate distance between GPS point et Road
Definition: solver.cpp:52
Grid grid
Definition: solver.h:58
Definition: solver.h:16
std::vector< PointGPS * > * m_trackPoints
Definition: solver.h:61
PointGPS * prevPoint
Definition: solver.h:83
The Track class.
Definition: track.h:26
void start()
Definition: solver.cpp:9
std::vector< std::vector< float > > T1
Definition: solver.h:79
void signalMessage(QString)
void filterSpace(double val)
filterSpace Use Spatial filter with a value
Definition: solver.cpp:198
std::unordered_map< long, int > m_fromRoadIdToIndex
Definition: solver.h:81
void filterTemp(int val)
filterTemp Use Temporal filter with a value
Definition: solver.cpp:206
void onSignalNextStep()
Definition: solver.cpp:111
void signalDimension(double xMin, double xMax, double yMin, double yMax)
void signalRoadPath(std::vector< long > *rp)
void onSignalSetTrack(QString s)
Definition: solver.cpp:100
std::vector< long > m_fromIndexToRoadId
Definition: solver.h:80
void readFiles(File file1, File file2)
readFiles Read files : track and grid
Definition: solver.cpp:182
std::vector< PointRoad > * m_roadPoints
Definition: solver.h:60
Grid embedded roads. This describes the network.
Definition: grid.h:36
QString m_trackFilename
Definition: solver.h:55
void signalAllPoints(std::vector< PointGPS * > *)
void signalAllRoads(std::unordered_map< long, Road > *, std::vector< PointRoad > *)
The class Track.
void onSignalSetGrid(QString s)
Definition: solver.cpp:95
std::vector< long > * prevRoadIds
Definition: solver.h:82
void buildRoadPath()
Definition: solver.cpp:72