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

Computes the shortest path through a contracted network. More...

#include <CHRouter.h>

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

Data Structures

class  Unidirectional
 

Public Types

typedef std::pair< const typename BASE::EdgeInfo *, const typename BASE::EdgeInfo * > Meeting
 A meeting point of the two search scopes. More...
 
typedef double(* Operation) (const E *const, const V *const, double)
 Type of the function that is used to retrieve the edge effort. More...
 

Public Member Functions

void buildContractionHierarchy (SUMOTime time, const V *const vehicle)
 
void buildPathFromMeeting (Meeting meeting, std::vector< const E *> &into) const
 normal routing methods More...
 
 CHRouter (const std::vector< E *> &edges, bool unbuildIsWarning, typename BASE::Operation operation, const SUMOVehicleClass svc, SUMOTime weightPeriod, bool validatePermissions)
 Constructor. More...
 
 CHRouter (const std::vector< E *> &edges, bool unbuildIsWarning, typename BASE::Operation operation, const SUMOVehicleClass svc, SUMOTime weightPeriod, const typename CHBuilder< E, V >::Hierarchy *hierarchy)
 Cloning constructor. 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 traveltime in the contracted graph. More...
 
virtual ~CHRouter ()
 Destructor. More...
 

Private Member Functions

const E * getVia (const E *forwardFrom, const E *forwardTo) const
 

Private Attributes

Unidirectional myBackwardSearch
 
const std::vector< E * > & myEdges
 all edges with numerical ids More...
 
MsgHandler *const myErrorMsgHandler
 the handler for routing errors More...
 
Unidirectional myForwardSearch
 the unidirectional search queues More...
 
const CHBuilder< E, V >::Hierarchy * myHierarchy
 
CHBuilder< E, V > * myHierarchyBuilder
 
const SUMOVehicleClass mySVC
 the permissions for which the hierarchy was constructed More...
 
SUMOTime myValidUntil
 the validity duration of the current hierarchy (exclusive) More...
 
const SUMOTime myWeightPeriod
 the validity duration of one weight interval More...
 

Detailed Description

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

Computes the shortest path through a contracted network.

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)

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 CHRouter.h.

Member Typedef Documentation

◆ Meeting

template<class E, class V, class BASE>
typedef std::pair<const typename BASE::EdgeInfo*, const typename BASE::EdgeInfo*> CHRouter< E, V, BASE >::Meeting

A meeting point of the two search scopes.

Definition at line 70 of file CHRouter.h.

◆ Operation

template<class E, class V, class BASE>
typedef double(* CHRouter< E, V, BASE >::Operation) (const E *const, const V *const, double)

Type of the function that is used to retrieve the edge effort.

Definition at line 67 of file CHRouter.h.

Constructor & Destructor Documentation

◆ CHRouter() [1/2]

template<class E, class V, class BASE>
CHRouter< E, V, BASE >::CHRouter ( const std::vector< E *> &  edges,
bool  unbuildIsWarning,
typename BASE::Operation  operation,
const SUMOVehicleClass  svc,
SUMOTime  weightPeriod,
bool  validatePermissions 
)
inline

Constructor.

Parameters
[in]validatePermissionsWhether a multi-permission hierarchy shall be built If set to false, the net is pruned in synchronize() and the hierarchy is tailored to the svc

Definition at line 225 of file CHRouter.h.

◆ CHRouter() [2/2]

template<class E, class V, class BASE>
CHRouter< E, V, BASE >::CHRouter ( const std::vector< E *> &  edges,
bool  unbuildIsWarning,
typename BASE::Operation  operation,
const SUMOVehicleClass  svc,
SUMOTime  weightPeriod,
const typename CHBuilder< E, V >::Hierarchy *  hierarchy 
)
inline

Cloning constructor.

Definition at line 243 of file CHRouter.h.

◆ ~CHRouter()

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

Destructor.

Definition at line 260 of file CHRouter.h.

References CHRouter< E, V, BASE >::myHierarchy, and CHRouter< E, V, BASE >::myHierarchyBuilder.

Member Function Documentation

◆ buildContractionHierarchy()

template<class E, class V, class BASE>
void CHRouter< E, V, BASE >::buildContractionHierarchy ( SUMOTime  time,
const V *const  vehicle 
)
inline

◆ buildPathFromMeeting()

template<class E, class V, class BASE>
void CHRouter< E, V, BASE >::buildPathFromMeeting ( Meeting  meeting,
std::vector< const E *> &  into 
) const
inline

normal routing methods

Builds the path from marked edges

Definition at line 328 of file CHRouter.h.

References CHRouter< E, V, BASE >::getVia().

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

◆ clone()

◆ compute()

template<class E, class V, class BASE>
virtual bool CHRouter< E, V, BASE >::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 traveltime in the contracted graph.

Note
: since the contracted graph is static (weights averaged over time) the computed routes only approximated shortest paths in the real graph

Definition at line 280 of file CHRouter.h.

References CHRouter< E, V, BASE >::buildContractionHierarchy(), CHRouter< E, V, BASE >::buildPathFromMeeting(), MsgHandler::inform(), CHRouter< E, V, BASE >::Unidirectional::init(), CHRouter< E, V, BASE >::myBackwardSearch, CHRouter< E, V, BASE >::myErrorMsgHandler, CHRouter< E, V, BASE >::myForwardSearch, CHRouter< E, V, BASE >::myHierarchy, CHRouter< E, V, BASE >::myValidUntil, CHRouter< E, V, BASE >::myWeightPeriod, CHRouter< E, V, BASE >::Unidirectional::step(), and toString().

◆ getVia()

template<class E, class V, class BASE>
const E* CHRouter< E, V, BASE >::getVia ( const E *  forwardFrom,
const E *  forwardTo 
) const
inlineprivate

Field Documentation

◆ myBackwardSearch

template<class E, class V, class BASE>
Unidirectional CHRouter< E, V, BASE >::myBackwardSearch
private

Definition at line 396 of file CHRouter.h.

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

◆ myEdges

template<class E, class V, class BASE>
const std::vector<E*>& CHRouter< E, V, BASE >::myEdges
private

all edges with numerical ids

Definition at line 389 of file CHRouter.h.

Referenced by CHRouter< E, V, BASE >::clone().

◆ myErrorMsgHandler

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

the handler for routing errors

Definition at line 392 of file CHRouter.h.

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

◆ myForwardSearch

template<class E, class V, class BASE>
Unidirectional CHRouter< E, V, BASE >::myForwardSearch
private

the unidirectional search queues

Definition at line 395 of file CHRouter.h.

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

◆ myHierarchy

template<class E, class V, class BASE>
const CHBuilder<E, V>::Hierarchy* CHRouter< E, V, BASE >::myHierarchy
private

◆ myHierarchyBuilder

template<class E, class V, class BASE>
CHBuilder<E, V>* CHRouter< E, V, BASE >::myHierarchyBuilder
private

◆ mySVC

template<class E, class V, class BASE>
const SUMOVehicleClass CHRouter< E, V, BASE >::mySVC
private

the permissions for which the hierarchy was constructed

Definition at line 408 of file CHRouter.h.

Referenced by CHRouter< E, V, BASE >::clone().

◆ myValidUntil

template<class E, class V, class BASE>
SUMOTime CHRouter< E, V, BASE >::myValidUntil
private

the validity duration of the current hierarchy (exclusive)

Definition at line 405 of file CHRouter.h.

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

◆ myWeightPeriod

template<class E, class V, class BASE>
const SUMOTime CHRouter< E, V, BASE >::myWeightPeriod
private

the validity duration of one weight interval

Definition at line 402 of file CHRouter.h.

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


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