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

A graph containing dummy nodes and edges used in map matching. More...

#include <composite_graph.hpp>

Public Member Functions

 DummyGraph ()
 Default constructor of dummy graph.
 
 DummyGraph (const Traj_Candidates &traj_candidates)
 Constructor of dummy graph from trajectory candidates. More...
 
NETWORK::Graph_Tget_graph_ptr ()
 Get the inner graph data. More...
 
const NETWORK::Graph_Tget_boost_graph () const
 Get a const reference to the inner graph data. More...
 
int get_num_vertices () const
 Get the number of vertices in the dummy graph.
 
bool containNodeIndex (NETWORK::NodeIndex external_index) const
 Check if a node is contained in the dummy graph. More...
 
NETWORK::NodeIndex get_external_index (DummyIndex inner_index) const
 Get the NodeIndex of a node according to the inner index of the dummy graph. More...
 
DummyIndex get_internal_index (NETWORK::NodeIndex external_index) const
 Get the internal index of a node in dummy graph If the node is not contained in the dummy graph, an exception will be thrown. More...
 
int get_edge_index (NETWORK::NodeIndex source, NETWORK::NodeIndex target, double cost) const
 Get the edge index in the original network graph. More...
 
void print_node_index_map () const
 Print the mapping from dummy index to node index.
 

Protected Member Functions

void add_edge (NETWORK::NodeIndex source, NETWORK::NodeIndex target, NETWORK::EdgeIndex edge_index, double cost)
 Add an edge to the dummy graph. More...
 

Detailed Description

A graph containing dummy nodes and edges used in map matching.

It connects candidate node (dummy node) matched to GPS observations with the nodes in the original road network. The connected edges are dummy edges.

Definition at line 31 of file composite_graph.hpp.

Constructor & Destructor Documentation

◆ DummyGraph()

DummyGraph::DummyGraph ( const Traj_Candidates traj_candidates)

Constructor of dummy graph from trajectory candidates.

Each candidate will be connected with two end nodes of the matched edge.

Parameters
traj_candidatesinput information

Definition at line 11 of file composite_graph.cpp.

Member Function Documentation

◆ add_edge()

void DummyGraph::add_edge ( NETWORK::NodeIndex  source,
NETWORK::NodeIndex  target,
NETWORK::EdgeIndex  edge_index,
double  cost 
)
protected

Add an edge to the dummy graph.

Parameters
sourcesource node index
targettarget node index
edge_indexEdge index. It will be the same edge index where the dummy edge is located.
costcost of the edge

Definition at line 94 of file composite_graph.cpp.

◆ containNodeIndex()

bool DummyGraph::containNodeIndex ( NETWORK::NodeIndex  external_index) const

Check if a node is contained in the dummy graph.

A node is contained in the dummy graph if (a) it is a dummy node representing a candidate or (b) it is the end node of a matched candidate edge.

Parameters
external_indexThe NodeIndex of a node
Returns
true if a node is contained

Definition at line 52 of file composite_graph.cpp.

◆ get_boost_graph()

const Graph_T & DummyGraph::get_boost_graph ( ) const

Get a const reference to the inner graph data.

Returns
A pointer to the inner boost graph.

Definition at line 44 of file composite_graph.cpp.

◆ get_edge_index()

int DummyGraph::get_edge_index ( NETWORK::NodeIndex  source,
NETWORK::NodeIndex  target,
double  cost 
) const

Get the edge index in the original network graph.

Parameters
sourcesource NodeIndex in the original network graph
targettarget NodeIndex in the original network graph
costCost value of the edge
Returns
the corresponding edge index in the origin network graph. If edge is not found, -1 is returned.

Definition at line 64 of file composite_graph.cpp.

◆ get_external_index()

NodeIndex DummyGraph::get_external_index ( DummyIndex  inner_index) const

Get the NodeIndex of a node according to the inner index of the dummy graph.

Parameters
inner_indexan inner index of the dummy graph
Returns
a node index of the node in the original network graph

Definition at line 56 of file composite_graph.cpp.

◆ get_graph_ptr()

Graph_T * DummyGraph::get_graph_ptr ( )

Get the inner graph data.

Returns
A pointer to the inner boost graph.

Definition at line 40 of file composite_graph.cpp.

◆ get_internal_index()

DummyIndex DummyGraph::get_internal_index ( NETWORK::NodeIndex  external_index) const

Get the internal index of a node in dummy graph If the node is not contained in the dummy graph, an exception will be thrown.

Call the containNodeIndex before invoking this function.

Parameters
external_indexThe node index in original network graph
Returns
a internal index

Definition at line 60 of file composite_graph.cpp.


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