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

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

#include <CHRouter.h>

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

Data Structures

struct  EdgeInfo
 
class  Unidirectional
 

Public Types

typedef std::pair< const EdgeInfo *, const 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, Operation operation, const SUMOVehicleClass svc, SUMOTime weightPeriod, bool validatePermissions)
 Constructor. More...
 
 CHRouter (const std::vector< E *> &edges, bool unbuildIsWarning, 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...
 
void endQuery (int visits)
 
double getEffort (const E *const e, const V *const v, double t) const
 
double recomputeCosts (const std::vector< const E *> &edges, const V *const v, SUMOTime msTime) const
 
void setBulkMode (const bool mode)
 
void startQuery ()
 
virtual ~CHRouter ()
 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

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 PF>
class CHRouter< E, V, PF >

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

Member Typedef Documentation

◆ Meeting

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

A meeting point of the two search scopes.

Definition at line 110 of file CHRouter.h.

◆ Operation

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

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

Definition at line 73 of file CHRouter.h.

Constructor & Destructor Documentation

◆ CHRouter() [1/2]

template<class E, class V, class PF>
CHRouter< E, V, PF >::CHRouter ( const std::vector< E *> &  edges,
bool  unbuildIsWarning,
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 266 of file CHRouter.h.

◆ CHRouter() [2/2]

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

Cloning constructor.

Definition at line 284 of file CHRouter.h.

◆ ~CHRouter()

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

Destructor.

Definition at line 301 of file CHRouter.h.

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

Member Function Documentation

◆ buildContractionHierarchy()

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

◆ buildPathFromMeeting()

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

normal routing methods

Builds the path from marked edges

Definition at line 382 of file CHRouter.h.

References CHRouter< E, V, PF >::EdgeInfo::edge, CHRouter< E, V, PF >::getVia(), and CHRouter< E, V, PF >::EdgeInfo::prev.

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

◆ clone()

◆ compute()

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

◆ endQuery()

◆ getEffort()

◆ getVia()

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

Definition at line 430 of file CHRouter.h.

References CHRouter< E, V, PF >::myHierarchy.

Referenced by CHRouter< E, V, PF >::buildPathFromMeeting().

◆ recomputeCosts()

template<class E, class V, class PF>
double CHRouter< 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 367 of file CHRouter.h.

References SUMOAbstractRouter< E, V >::getEffort(), and STEPS2TIME.

◆ 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

◆ myBackwardSearch

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

Definition at line 450 of file CHRouter.h.

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

◆ myBulkMode

◆ myEdges

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

all edges with numerical ids

Definition at line 443 of file CHRouter.h.

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

◆ myErrorMsgHandler

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

the handler for routing errors

Definition at line 446 of file CHRouter.h.

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

◆ myForwardSearch

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

the unidirectional search queues

Definition at line 449 of file CHRouter.h.

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

◆ myHierarchy

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

◆ myHierarchyBuilder

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

◆ myOperation

◆ mySVC

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

the permissions for which the hierarchy was constructed

Definition at line 462 of file CHRouter.h.

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

◆ myValidUntil

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

the validity duration of the current hierarchy (exclusive)

Definition at line 459 of file CHRouter.h.

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

◆ myWeightPeriod

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

the validity duration of one weight interval

Definition at line 456 of file CHRouter.h.

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


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