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  EdgeInfoByEffortComparator
 

Public Member Functions

void buildPathFrom (const typename BASE::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 BASE::EdgeInfo & getEdgeInfo (int index) const
 
void init ()
 
virtual ~DijkstraRouter ()
 Destructor. More...
 

Private Member Functions

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

Private Attributes

EdgeInfoByEffortComparator myComparator
 
std::vector< typename BASE::EdgeInfo > myEdgeInfos
 The container of edge information. More...
 
MsgHandler *const myErrorMsgHandler
 the handler for routing errors More...
 
EffortCalculator *const myExternalEffort
 
std::vector< typename BASE::EdgeInfo * > myFound
 list of visited Edges (for resetting) More...
 
std::vector< typename BASE::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

Constructor.

Definition at line 82 of file DijkstraRouter.h.

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

◆ ~DijkstraRouter()

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

Destructor.

Definition at line 93 of file DijkstraRouter.h.

◆ DijkstraRouter() [2/2]

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

Definition at line 241 of file DijkstraRouter.h.

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

Member Function Documentation

◆ buildPathFrom()

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

Builds the path from marked edges.

Definition at line 227 of file DijkstraRouter.h.

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

◆ clone()

◆ compute()

template<class E, class V, class BASE>
virtual bool DijkstraRouter< E, V, BASE >::compute ( const E *  from,
const E *  to,
const V *const  vehicle,
SUMOTime  msTime,
std::vector< const E *> &  into 
)
inlinevirtual

◆ getEdgeInfo()

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

Definition at line 236 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 269 of file DijkstraRouter.h.

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

◆ myEdgeInfos

template<class E, class V, class BASE>
std::vector<typename BASE::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 254 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<typename BASE::EdgeInfo*> DijkstraRouter< E, V, BASE >::myFound
private

list of visited Edges (for resetting)

Definition at line 267 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<typename BASE::EdgeInfo*> DijkstraRouter< E, V, BASE >::myFrontierList
private

A container for reusage of the min edge heap.

Definition at line 265 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 257 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: