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

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

#include <DijkstraRouter.h>

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

Data Structures

class  EdgeInfo
 
class  EdgeInfoByEffortComparator
 

Public Types

typedef double(* Operation) (const E *const, const V *const, double)
 

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, Operation effortOperation, Operation ttOperation=nullptr)
 Constructor. More...
 
void endQuery (int visits)
 
const EdgeInfogetEdgeInfo (int index) const
 
double getEffort (const E *const e, const V *const v, double t) const
 
double getTravelTime (const E *const e, const V *const v, const double t, const double effort) const
 
void init ()
 
double recomputeCosts (const std::vector< const E *> &edges, const V *const v, SUMOTime msTime) const
 
void setBulkMode (const bool mode)
 
void startQuery ()
 
virtual ~DijkstraRouter ()
 Destructor. More...
 

Protected Attributes

bool myBulkMode
 whether we are currently operating several route queries in a bulk More...
 
Operation myOperation
 The object's operation to perform. More...
 

Private Member Functions

 DijkstraRouter (const std::vector< EdgeInfo > &edgeInfos, bool unbuildIsWarning, Operation effortOperation, Operation ttOperation)
 

Private Attributes

EdgeInfoByEffortComparator myComparator
 
std::vector< EdgeInfomyEdgeInfos
 The container of edge information. More...
 
MsgHandler *const myErrorMsgHandler
 the handler for routing errors More...
 
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...
 
Operation myTTOperation
 The object's operation to perform for travel times. More...
 

Detailed Description

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

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)
PFThe prohibition function to use (prohibited_withPermissions/noProhibitions)
ECThe class to retrieve the effort for an edge from

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 69 of file DijkstraRouter.h.

Member Typedef Documentation

◆ Operation

template<class E, class V, class PF>
typedef double(* DijkstraRouter< E, V, PF >::Operation) (const E *const, const V *const, double)

Definition at line 72 of file DijkstraRouter.h.

Constructor & Destructor Documentation

◆ DijkstraRouter() [1/2]

template<class E, class V, class PF>
DijkstraRouter< E, V, PF >::DijkstraRouter ( const std::vector< E *> &  edges,
bool  unbuildIsWarning,
Operation  effortOperation,
Operation  ttOperation = nullptr 
)
inline

Constructor.

Definition at line 128 of file DijkstraRouter.h.

◆ ~DijkstraRouter()

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

Destructor.

Definition at line 137 of file DijkstraRouter.h.

◆ DijkstraRouter() [2/2]

template<class E, class V, class PF>
DijkstraRouter< E, V, PF >::DijkstraRouter ( const std::vector< EdgeInfo > &  edgeInfos,
bool  unbuildIsWarning,
Operation  effortOperation,
Operation  ttOperation 
)
inlineprivate

Definition at line 290 of file DijkstraRouter.h.

Member Function Documentation

◆ buildPathFrom()

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

◆ clone()

template<class E, class V, class PF>
virtual SUMOAbstractRouter<E, V>* DijkstraRouter< E, V, PF >::clone ( )
inlinevirtual

Implements SUMOAbstractRouter< E, V >.

Definition at line 139 of file DijkstraRouter.h.

◆ compute()

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

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.

Implements SUMOAbstractRouter< E, V >.

Definition at line 162 of file DijkstraRouter.h.

◆ endQuery()

◆ getEdgeInfo()

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

Definition at line 285 of file DijkstraRouter.h.

◆ getEffort()

◆ getTravelTime()

◆ init()

◆ recomputeCosts()

template<class E, class V, class PF>
double DijkstraRouter< E, V, PF >::recomputeCosts ( const std::vector< const E *> &  edges,
const V *const  v,
SUMOTime  msTime 
) const
inlinevirtual

Implements SUMOAbstractRouter< E, V >.

Definition at line 261 of file DijkstraRouter.h.

◆ setBulkMode()

template<class E, class V>
void SUMOAbstractRouter< E, V >::setBulkMode ( const bool  mode)
inlineinherited

Definition at line 100 of file SUMOAbstractRouter.h.

Referenced by ROMAAssignments::incremental().

◆ startQuery()

Field Documentation

◆ myBulkMode

◆ myComparator

◆ myEdgeInfos

◆ myErrorMsgHandler

◆ myFound

◆ myFrontierList

◆ myOperation

◆ myTTOperation


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