pgRouting
pgRouting extends the PostGIS / PostgreSQL geospatial database to provide geospatial routing functionality.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GraphDefinition Class Reference

#include "GraphDefinition.h"

Classes

struct  CostHolder
 
class  GraphEdgeInfo
 
struct  PARENT_PATH
 
struct  Rule
 

Public Member Functions

 GraphDefinition (edge_t *edges, unsigned int edge_count, bool directed, bool has_rcost)
 
 ~GraphDefinition (void)
 
void add_virtual_vertices (int start_edge, double start_part, int end_edge, double end_part, int64_t &start_vertex, int64_t &end_vertex)
 
bool construct_graph (edge_t *edges, bool has_rcost, bool directed)
 
int my_dijkstra (int64_t start_vertex, int64_t end_vertex, path_element_t **path, size_t *path_count, std::ostringstream &log)
 
void set_restrictions (int64_t start_vertex, int64_t end_vertex, std::vector< PDVI > &ruleList)
 

Private Types

typedef std::vector
< GraphEdgeInfo
GraphEdgeVector
 
typedef std::map< int64_t,
int64_t > 
Long2LongMap
 
typedef std::map< int64_t,
LongVector
Long2LongVectorMap
 
typedef std::vector< int64_t > LongVector
 
typedef std::pair< double, PIBPDP
 
typedef std::pair< int, boolPIB
 
typedef std::map< int64_t,
std::vector< Rule > > 
RuleTable
 
typedef std::vector< LongVectorVectorOfLongVector
 

Private Member Functions

bool addEdge (edge_t edgeIn)
 
bool connectEdge (GraphEdgeInfo &firstEdge, GraphEdgeInfo &secondEdge, bool bIsStartNodeSame)
 
double construct_path (int64_t ed_id, int64_t v_pos)
 
void deleteall ()
 
void explore (int64_t cur_node, GraphEdgeInfo &cur_edge, bool isStart, LongVector &vecIndex, std::priority_queue< PDP, std::vector< PDP >, std::greater< PDP > > &que)
 
bool get_single_cost (double total_cost, path_element_t **path, size_t *path_count)
 
double getRestrictionCost (int64_t cur_node, GraphEdgeInfo &new_edge, bool isStart)
 
void init ()
 

Private Attributes

bool isEndVirtual
 
bool isStartVirtual
 
bool m_bIsGraphConstructed
 
bool m_bIsturnRestrictOn
 
std::vector< CostHolderm_dCost
 
double m_dEndPart
 
double m_dStartpart
 
unsigned int m_edge_count
 
int m_lEndEdgeId
 
int m_lStartEdgeId
 
Long2LongMap m_mapEdgeId2Index
 
Long2LongVectorMap m_mapNodeId2Edge
 
RuleTable m_ruleTable
 
GraphEdgeVector m_vecEdgeVector
 
std::vector< path_element_tm_vecPath
 
int64_t max_edge_id
 
int64_t max_node_id
 
std::vector< PARENT_PATHparent
 

Detailed Description

Definition at line 39 of file GraphDefinition.h.

Member Typedef Documentation

typedef std::vector<GraphEdgeInfo> GraphDefinition::GraphEdgeVector
private

Definition at line 91 of file GraphDefinition.h.

typedef std::map<int64_t,int64_t> GraphDefinition::Long2LongMap
private

Definition at line 93 of file GraphDefinition.h.

typedef std::map<int64_t,LongVector> GraphDefinition::Long2LongVectorMap
private

Definition at line 92 of file GraphDefinition.h.

typedef std::vector<int64_t> GraphDefinition::LongVector
private

Definition at line 40 of file GraphDefinition.h.

typedef std::pair<double, PIB> GraphDefinition::PDP
private

Definition at line 43 of file GraphDefinition.h.

typedef std::pair<int, bool> GraphDefinition::PIB
private

Definition at line 42 of file GraphDefinition.h.

typedef std::map<int64_t, std::vector<Rule> > GraphDefinition::RuleTable
private

Definition at line 58 of file GraphDefinition.h.

typedef std::vector<LongVector> GraphDefinition::VectorOfLongVector
private

Definition at line 41 of file GraphDefinition.h.

Constructor & Destructor Documentation

GraphDefinition::~GraphDefinition ( void  )

Definition at line 56 of file GraphDefinition.cpp.

GraphDefinition::GraphDefinition ( edge_t edges,
unsigned int  edge_count,
bool  directed,
bool  has_rcost 
)

Definition at line 36 of file GraphDefinition.cpp.

References construct_graph(), init(), m_bIsGraphConstructed, m_dCost, and parent.

Member Function Documentation

bool GraphDefinition::construct_graph ( edge_t edges,
bool  has_rcost,
bool  directed 
)
void GraphDefinition::deleteall ( )
private

Definition at line 70 of file GraphDefinition.cpp.

References m_dCost, m_vecEdgeVector, and parent.

void GraphDefinition::explore ( int64_t  cur_node,
GraphEdgeInfo cur_edge,
bool  isStart,
LongVector vecIndex,
std::priority_queue< PDP, std::vector< PDP >, std::greater< PDP > > &  que 
)
private
bool GraphDefinition::get_single_cost ( double  total_cost,
path_element_t **  path,
size_t *  path_count 
)
private
double GraphDefinition::getRestrictionCost ( int64_t  cur_node,
GraphEdgeInfo new_edge,
bool  isStart 
)
private

Definition at line 118 of file GraphDefinition.cpp.

References GraphDefinition::GraphEdgeInfo::m_lEdgeID, m_ruleTable, m_vecEdgeVector, and parent.

Referenced by explore().

void GraphDefinition::init ( )
private

Definition at line 60 of file GraphDefinition.cpp.

References isEndVirtual, isStartVirtual, max_edge_id, and max_node_id.

Referenced by GraphDefinition().

void GraphDefinition::set_restrictions ( int64_t  start_vertex,
int64_t  end_vertex,
std::vector< PDVI > &  ruleList 
)

Member Data Documentation

bool GraphDefinition::isEndVirtual
private

Definition at line 150 of file GraphDefinition.h.

Referenced by add_virtual_vertices(), init(), my_dijkstra(), and set_restrictions().

bool GraphDefinition::isStartVirtual
private

Definition at line 149 of file GraphDefinition.h.

Referenced by add_virtual_vertices(), init(), my_dijkstra(), and set_restrictions().

bool GraphDefinition::m_bIsGraphConstructed
private

Definition at line 159 of file GraphDefinition.h.

Referenced by construct_graph(), and GraphDefinition().

bool GraphDefinition::m_bIsturnRestrictOn
private

Definition at line 158 of file GraphDefinition.h.

Referenced by explore(), and set_restrictions().

std::vector< CostHolder > GraphDefinition::m_dCost
private

Definition at line 156 of file GraphDefinition.h.

Referenced by construct_path(), deleteall(), explore(), GraphDefinition(), and my_dijkstra().

double GraphDefinition::m_dEndPart
private

Definition at line 148 of file GraphDefinition.h.

Referenced by add_virtual_vertices(), and get_single_cost().

double GraphDefinition::m_dStartpart
private

Definition at line 147 of file GraphDefinition.h.

Referenced by add_virtual_vertices(), and get_single_cost().

unsigned int GraphDefinition::m_edge_count
private

Definition at line 152 of file GraphDefinition.h.

Referenced by add_virtual_vertices(), construct_graph(), and my_dijkstra().

int GraphDefinition::m_lEndEdgeId
private

Definition at line 146 of file GraphDefinition.h.

Referenced by add_virtual_vertices(), my_dijkstra(), and set_restrictions().

int GraphDefinition::m_lStartEdgeId
private
Long2LongMap GraphDefinition::m_mapEdgeId2Index
private

Definition at line 141 of file GraphDefinition.h.

Referenced by add_virtual_vertices(), addEdge(), and get_single_cost().

Long2LongVectorMap GraphDefinition::m_mapNodeId2Edge
private

Definition at line 142 of file GraphDefinition.h.

Referenced by addEdge(), my_dijkstra(), and set_restrictions().

RuleTable GraphDefinition::m_ruleTable
private

Definition at line 157 of file GraphDefinition.h.

Referenced by getRestrictionCost(), and set_restrictions().

std::vector<path_element_t> GraphDefinition::m_vecPath
private

Definition at line 154 of file GraphDefinition.h.

Referenced by construct_path(), and my_dijkstra().

int64_t GraphDefinition::max_edge_id
private

Definition at line 144 of file GraphDefinition.h.

Referenced by add_virtual_vertices(), addEdge(), and init().

int64_t GraphDefinition::max_node_id
private

Definition at line 143 of file GraphDefinition.h.

Referenced by add_virtual_vertices(), addEdge(), and init().

std::vector< PARENT_PATH > GraphDefinition::parent
private

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