SUMO - Simulation of Urban MObility
DijkstraRouter< E, V, BASE > Class Template Reference

Computes the shortest path through a network using the Dijkstra algorithm. More...

#include <DijkstraRouter.h>

Inheritance diagram for DijkstraRouter< E, V, BASE >:
Inheritance graph
Collaboration diagram for DijkstraRouter< E, V, BASE >:
Collaboration graph

Data Structures

class  EdgeInfo
 
class  EdgeInfoByEffortComparator
 

Public Member Functions

void buildPathFrom (const EdgeInfo *rbegin, std::vector< const E *> &edges)
 Builds the path from marked edges. More...
 
virtual SUMOAbstractRouter< E, V > * clone ()
 
virtual bool compute (const E *from, const E *to, const V *const vehicle, SUMOTime msTime, std::vector< const E *> &into)
 Builds the route between the given edges using the minimum effort at the given time The definition of the effort depends on the wished routing scheme. More...
 
 DijkstraRouter (const std::vector< E *> &edges, bool unbuildIsWarning, typename BASE::Operation effortOperation, typename BASE::Operation ttOperation=nullptr, bool silent=false, EffortCalculator *calc=nullptr)
 Constructor. More...
 
const EdgeInfo & getEdgeInfo (int index) const
 
void init ()
 
virtual ~DijkstraRouter ()
 Destructor. More...
 

Private Member Functions

 DijkstraRouter (const std::vector< EdgeInfo > &edgeInfos, bool unbuildIsWarning, typename BASE::Operation effortOperation, typename BASE::Operation ttOperation, bool silent, EffortCalculator *calc)
 

Private Attributes

EdgeInfoByEffortComparator myComparator
 
std::vector< EdgeInfo > myEdgeInfos
 The container of edge information. More...
 
MsgHandler *const myErrorMsgHandler
 the handler for routing errors More...
 
EffortCalculator *const myExternalEffort
 
std::vector< EdgeInfo * > myFound
 list of visited Edges (for resetting) More...
 
std::vector< EdgeInfo * > myFrontierList
 A container for reusage of the min edge heap. More...
 
bool mySilent
 whether to supress warning/error if no route was found More...
 

Detailed Description

template<class E, class V, class BASE>
class DijkstraRouter< E, V, BASE >

Computes the shortest path through a network using the Dijkstra algorithm.

The template parameters are:

Parameters
EThe edge class to use (MSEdge/ROEdge)
VThe vehicle class to use (MSVehicle/ROVehicle)
BASEThe base class to use (SUMOAbstractRouterPermissions/SUMOAbstractRouter)

The router is edge-based. It must know the number of edges for internal reasons and whether a missing connection between two given edges (unbuild route) shall be reported as an error or as a warning.

Definition at line 63 of file DijkstraRouter.h.

Constructor & Destructor Documentation

◆ DijkstraRouter() [1/2]

template<class E, class V, class BASE>
DijkstraRouter< E, V, BASE >::DijkstraRouter ( const std::vector< E *> &  edges,
bool  unbuildIsWarning,
typename BASE::Operation  effortOperation,
typename BASE::Operation  ttOperation = nullptr,
bool  silent = false,
EffortCalculator *  calc = nullptr 
)
inline

◆ ~DijkstraRouter()

template<class E, class V, class BASE>
virtual DijkstraRouter< E, V, BASE >::~DijkstraRouter ( )
inlinevirtual

Destructor.

Definition at line 134 of file DijkstraRouter.h.

◆ DijkstraRouter() [2/2]

template<class E, class V, class BASE>
DijkstraRouter< E, V, BASE >::DijkstraRouter ( const std::vector< EdgeInfo > &  edgeInfos,
bool  unbuildIsWarning,
typename BASE::Operation  effortOperation,
typename BASE::Operation  ttOperation,
bool  silent,
EffortCalculator *  calc 
)
inlineprivate

Member Function Documentation

◆ buildPathFrom()

template<class E, class V, class BASE>
void DijkstraRouter< E, V, BASE >::buildPathFrom ( const EdgeInfo *  rbegin,
std::vector< const E *> &  edges 
)
inline

Builds the path from marked edges.

Definition at line 268 of file DijkstraRouter.h.

References DijkstraRouter< E, V, BASE >::EdgeInfo::edge, and DijkstraRouter< E, V, BASE >::EdgeInfo::prev.

Referenced by DijkstraRouter< E, V, BASE >::compute().

◆ clone()

◆ compute()

◆ getEdgeInfo()

template<class E, class V, class BASE>
const EdgeInfo& DijkstraRouter< E, V, BASE >::getEdgeInfo ( int  index) const
inline

Definition at line 277 of file DijkstraRouter.h.

References DijkstraRouter< E, V, BASE >::myEdgeInfos.

◆ init()

template<class E, class V, class BASE>
void DijkstraRouter< E, V, BASE >::init ( )
inline

Field Documentation

◆ myComparator

template<class E, class V, class BASE>
EdgeInfoByEffortComparator DijkstraRouter< E, V, BASE >::myComparator
private

Definition at line 310 of file DijkstraRouter.h.

Referenced by DijkstraRouter< E, V, BASE >::compute().

◆ myEdgeInfos

template<class E, class V, class BASE>
std::vector<EdgeInfo> DijkstraRouter< E, V, BASE >::myEdgeInfos
private

◆ myErrorMsgHandler

template<class E, class V, class BASE>
MsgHandler* const DijkstraRouter< E, V, BASE >::myErrorMsgHandler
private

the handler for routing errors

Definition at line 295 of file DijkstraRouter.h.

Referenced by DijkstraRouter< E, V, BASE >::clone(), and DijkstraRouter< E, V, BASE >::compute().

◆ myExternalEffort

template<class E, class V, class BASE>
EffortCalculator* const DijkstraRouter< E, V, BASE >::myExternalEffort
private

◆ myFound

template<class E, class V, class BASE>
std::vector<EdgeInfo*> DijkstraRouter< E, V, BASE >::myFound
private

list of visited Edges (for resetting)

Definition at line 308 of file DijkstraRouter.h.

Referenced by DijkstraRouter< E, V, BASE >::compute(), and DijkstraRouter< E, V, BASE >::init().

◆ myFrontierList

template<class E, class V, class BASE>
std::vector<EdgeInfo*> DijkstraRouter< E, V, BASE >::myFrontierList
private

A container for reusage of the min edge heap.

Definition at line 306 of file DijkstraRouter.h.

Referenced by DijkstraRouter< E, V, BASE >::compute(), and DijkstraRouter< E, V, BASE >::init().

◆ mySilent

template<class E, class V, class BASE>
bool DijkstraRouter< E, V, BASE >::mySilent
private

whether to supress warning/error if no route was found

Definition at line 298 of file DijkstraRouter.h.

Referenced by DijkstraRouter< E, V, BASE >::clone(), and DijkstraRouter< E, V, BASE >::compute().


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