Fast map matching  0.1.0
Public Member Functions | Static Public Member Functions | List of all members
FMM::MM::TransitionGraph Class Reference

Transition graph class in HMM. More...

#include <transition_graph.hpp>

Public Member Functions

 TransitionGraph (const Traj_Candidates &tc, double gps_error)
 Transition graph constructor. More...
 
void reset_layer (TGLayer *layer)
 Reset all the proability data stored in a layer of the transition graph. More...
 
const TGNodefind_optimal_candidate (const TGLayer &layer)
 Find the optimal candidate in a layer with the highest accumulative probability. More...
 
TGOpath backtrack ()
 Backtrack the transition graph to find an optimal path. More...
 
std::vector< TGLayer > & get_layers ()
 Get a reference to the inner layers of the transition graph.
 

Static Public Member Functions

static double calc_tp (double sp_dist, double eu_dist)
 Calculate transition probability. More...
 
static double calc_ep (double dist, double error)
 Calculate emission probability. More...
 

Detailed Description

Transition graph class in HMM.

The class stores the underlying transition graph of a HMM, which stores the probabilities of candidates matched to a trajectories.

Definition at line 54 of file transition_graph.hpp.

Constructor & Destructor Documentation

◆ TransitionGraph()

TransitionGraph::TransitionGraph ( const Traj_Candidates tc,
double  gps_error 
)

Transition graph constructor.

A transition graph is created to store the probability of emission and transition in HMM model where optimal path will be infered.

Parameters
tcTrajectory candidates
gps_errorGPS error

Definition at line 19 of file transition_graph.cpp.

Member Function Documentation

◆ backtrack()

TGOpath TransitionGraph::backtrack ( )

Backtrack the transition graph to find an optimal path.

Returns
An optimal path connecting the first layer with last layer and has the highest accumulative probability value.

Definition at line 62 of file transition_graph.cpp.

◆ calc_ep()

double TransitionGraph::calc_ep ( double  dist,
double  error 
)
static

Calculate emission probability.

Parameters
distThe actual gps error from observed point to matched point
errorThe GPS sensor's accuracy
Returns
emission probability in HMM

Definition at line 37 of file transition_graph.cpp.

◆ calc_tp()

double TransitionGraph::calc_tp ( double  sp_dist,
double  eu_dist 
)
static

Calculate transition probability.

Parameters
sp_distShortest path distance between two candidates
eu_distEuclidean distance between two candidates
Returns
transition probability in HMM

Definition at line 33 of file transition_graph.cpp.

◆ find_optimal_candidate()

const TGNode * TransitionGraph::find_optimal_candidate ( const TGLayer layer)

Find the optimal candidate in a layer with the highest accumulative probability.

Parameters
layer[description]
Returns
pointer to the optimal node in the transition graph

Definition at line 50 of file transition_graph.cpp.

◆ reset_layer()

void TransitionGraph::reset_layer ( TGLayer layer)

Reset all the proability data stored in a layer of the transition graph.

Parameters
layerA layer in the transition graph

Definition at line 43 of file transition_graph.cpp.


The documentation for this class was generated from the following files: