PGROUTING
3.2
|
#include "pgr_trspHandler.h"
Classes | |
class | CostHolder |
class | Predecessor |
Public Member Functions | |
Pgr_trspHandler (pgr_edge_t *edges, const size_t edge_count, const bool directed, const std::vector< Rule > &ruleList) | |
Pgr_trspHandler (void)=delete | |
~Pgr_trspHandler (void)=default | |
void | clear () |
Path | process (const int64_t start_vertex, const int64_t end_vertex) |
process More... | |
std::deque< Path > | process (const std::vector< int64_t > sources, const std::vector< int64_t > targets) |
process More... | |
Private Types | |
typedef std::pair< double, std::pair< int64_t, bool > > | PDP |
Used in the priority queue. More... | |
enum | Position { ILLEGAL = -1, RC_EDGE = 0, C_EDGE = 1 } |
predecesor edge More... | |
Private Member Functions | |
void | add_to_que (double cost, size_t e_idx, bool isStart) |
bool | addEdge (const pgr_edge_t edgeIn) |
void | connectEndEdge (size_t firstEdge_idx, size_t secondEdge_idx) |
void | connectStartEdge (size_t firstEdge_idx, size_t secondEdge_idx) |
void | construct_graph (pgr_edge_t *edges, const size_t edge_count, const bool directed) |
double | construct_path (int64_t ed_id, Position pos) |
EdgeInfo | dijkstra_exploration () |
void | explore (int64_t cur_node, const EdgeInfo cur_edge, bool isStart) |
double | get_tot_cost (double cost, size_t edge_idx, bool isStart) |
double | getRestrictionCost (int64_t cur_node, const EdgeInfo &new_edge, bool isStart) |
void | initialize_que () |
int | initialize_restrictions (const std::vector< Rule > &ruleList) |
Path | process_trsp (size_t edge_count) |
int64_t | renumber_edges (pgr_edge_t *edges, const size_t edge_count) const |
Private Attributes | |
int64_t | current_node |
std::map< int64_t, std::vector< size_t > > | m_adjacency |
m_adjacency[vertex] = {edges} More... | |
std::vector< CostHolder > | m_dCost |
std::vector< EdgeInfo > | m_edges |
int64_t | m_end_vertex |
std::map< int64_t, int64_t > | m_mapEdgeId2Index |
Used only to veryfy that there are no reppetitions inserted the way it orks, repeating edges id is not allowed. More... | |
int64_t | m_min_id |
std::vector< Predecessor > | m_parent |
Path | m_path |
std::map< int64_t, std::vector< Rule > > | m_ruleTable |
int64_t | m_start_vertex |
std::priority_queue< PDP, std::vector< PDP >, std::greater< PDP > > | que |
Definition at line 52 of file pgr_trspHandler.h.
|
private |
Used in the priority queue.
Definition at line 56 of file pgr_trspHandler.h.
|
private |
predecesor edge
because each row represents 2 edges, this enumeration is needed for the predecessors
The "legal" values are indices to vectors
Enumerator | |
---|---|
ILLEGAL | |
RC_EDGE | |
C_EDGE |
Definition at line 68 of file pgr_trspHandler.h.
pgrouting::trsp::Pgr_trspHandler::Pgr_trspHandler | ( | pgr_edge_t * | edges, |
const size_t | edge_count, | ||
const bool | directed, | ||
const std::vector< Rule > & | ruleList | ||
) |
Definition at line 43 of file pgr_trspHandler.cpp.
References construct_graph(), initialize_restrictions(), m_min_id, and renumber_edges().
|
delete |
|
default |
|
private |
Definition at line 317 of file pgr_trspHandler.cpp.
References que.
Referenced by explore(), and initialize_que().
|
private |
Definition at line 508 of file pgr_trspHandler.cpp.
References connectEndEdge(), connectStartEdge(), pgr_edge_t::id, pgrouting::trsp::EdgeInfo::idx(), m_adjacency, m_edges, m_mapEdgeId2Index, pgr_edge_t::source, and pgr_edge_t::target.
Referenced by construct_graph().
void pgrouting::trsp::Pgr_trspHandler::clear | ( | ) |
|
private |
Definition at line 485 of file pgr_trspHandler.cpp.
References pgrouting::trsp::EdgeInfo::connect_endEdge(), pgrouting::trsp::EdgeInfo::connect_startEdge(), pgrouting::trsp::EdgeInfo::cost(), pgrouting::trsp::EdgeInfo::endNode(), m_edges, pgrouting::trsp::EdgeInfo::r_cost(), and pgrouting::trsp::EdgeInfo::startNode().
Referenced by addEdge().
|
private |
Definition at line 462 of file pgr_trspHandler.cpp.
References pgrouting::trsp::EdgeInfo::connect_endEdge(), pgrouting::trsp::EdgeInfo::connect_startEdge(), pgrouting::trsp::EdgeInfo::cost(), pgrouting::trsp::EdgeInfo::endNode(), m_edges, pgrouting::trsp::EdgeInfo::r_cost(), and pgrouting::trsp::EdgeInfo::startNode().
Referenced by addEdge().
|
private |
Definition at line 435 of file pgr_trspHandler.cpp.
References addEdge(), and m_mapEdgeId2Index.
Referenced by Pgr_trspHandler().
|
private |
Definition at line 95 of file pgr_trspHandler.cpp.
References Path_t::cost, Path_t::edge, ILLEGAL, m_dCost, m_edges, m_parent, m_path, m_start_vertex, Path_t::node, pgassert, Path::push_back(), RC_EDGE, and Path::start_id().
Referenced by process_trsp().
|
private |
Definition at line 353 of file pgr_trspHandler.cpp.
References pgrouting::trsp::EdgeInfo::cost(), current_node, pgrouting::trsp::EdgeInfo::endNode(), explore(), m_edges, m_end_vertex, m_start_vertex, pgassert, que, pgrouting::trsp::EdgeInfo::r_cost(), and pgrouting::trsp::EdgeInfo::startNode().
Referenced by process_trsp().
|
private |
Definition at line 186 of file pgr_trspHandler.cpp.
References add_to_que(), C_EDGE, edge::cost, pgrouting::trsp::EdgeInfo::get_idx(), get_tot_cost(), getRestrictionCost(), pgrouting::trsp::EdgeInfo::idx(), m_dCost, m_edges, m_parent, and RC_EDGE.
Referenced by dijkstra_exploration().
|
private |
|
private |
Definition at line 139 of file pgr_trspHandler.cpp.
References C_EDGE, m_edges, m_parent, m_ruleTable, pgassert, and RC_EDGE.
Referenced by explore().
|
private |
Definition at line 329 of file pgr_trspHandler.cpp.
References add_to_que(), pgrouting::trsp::EdgeInfo::cost(), pgrouting::trsp::EdgeInfo::endNode(), pgrouting::trsp::EdgeInfo::idx(), ILLEGAL, m_adjacency, m_dCost, m_edges, m_parent, m_start_vertex, pgrouting::trsp::EdgeInfo::r_cost(), and pgrouting::trsp::EdgeInfo::startNode().
Referenced by process_trsp().
|
private |
Definition at line 237 of file pgr_trspHandler.cpp.
References m_ruleTable.
Referenced by Pgr_trspHandler().
Path pgrouting::trsp::Pgr_trspHandler::process | ( | const int64_t | start_vertex, |
const int64_t | end_vertex | ||
) |
process
does the processisng
Definition at line 259 of file pgr_trspHandler.cpp.
References clear(), m_adjacency, m_edges, m_end_vertex, m_min_id, m_path, m_start_vertex, and process_trsp().
std::deque< Path > pgrouting::trsp::Pgr_trspHandler::process | ( | const std::vector< int64_t > | sources, |
const std::vector< int64_t > | targets | ||
) |
process
does many to many processisng
Definition at line 292 of file pgr_trspHandler.cpp.
References process().
|
private |
Definition at line 389 of file pgr_trspHandler.cpp.
References C_EDGE, construct_path(), Path_t::cost, current_node, dijkstra_exploration(), Path_t::edge, Path::end_id(), initialize_que(), m_dCost, m_end_vertex, m_min_id, m_parent, m_path, m_start_vertex, Path_t::node, pgassert, Path::push_back(), RC_EDGE, Path::renumber_vertices(), and Path::start_id().
Referenced by process().
|
private |
Definition at line 62 of file pgr_trspHandler.cpp.
References pgr_edge_t::source, and pgr_edge_t::target.
Referenced by Pgr_trspHandler().
|
private |
Definition at line 199 of file pgr_trspHandler.h.
Referenced by dijkstra_exploration(), and process_trsp().
|
private |
m_adjacency[vertex] = {edges}
Definition at line 190 of file pgr_trspHandler.h.
Referenced by addEdge(), initialize_que(), and process().
|
private |
Definition at line 206 of file pgr_trspHandler.h.
Referenced by clear(), construct_path(), explore(), get_tot_cost(), initialize_que(), and process_trsp().
|
private |
Definition at line 179 of file pgr_trspHandler.h.
Referenced by addEdge(), connectEndEdge(), connectStartEdge(), construct_path(), dijkstra_exploration(), explore(), getRestrictionCost(), initialize_que(), and process().
|
private |
Definition at line 194 of file pgr_trspHandler.h.
Referenced by dijkstra_exploration(), process(), and process_trsp().
|
private |
Used only to veryfy that there are no reppetitions inserted the way it orks, repeating edges id is not allowed.
Definition at line 185 of file pgr_trspHandler.h.
Referenced by addEdge(), and construct_graph().
|
private |
Definition at line 201 of file pgr_trspHandler.h.
Referenced by Pgr_trspHandler(), process(), and process_trsp().
|
private |
Definition at line 205 of file pgr_trspHandler.h.
Referenced by clear(), construct_path(), explore(), getRestrictionCost(), initialize_que(), and process_trsp().
|
private |
Definition at line 203 of file pgr_trspHandler.h.
Referenced by clear(), construct_path(), process(), and process_trsp().
|
private |
Definition at line 208 of file pgr_trspHandler.h.
Referenced by getRestrictionCost(), and initialize_restrictions().
|
private |
Definition at line 193 of file pgr_trspHandler.h.
Referenced by construct_path(), dijkstra_exploration(), initialize_que(), process(), and process_trsp().
|
private |
Definition at line 213 of file pgr_trspHandler.h.
Referenced by add_to_que(), and dijkstra_exploration().