Eclipse SUMO - Simulation of Urban MObility
CHRouterWrapper< E, V > Class Template Reference

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

#include <CHRouterWrapper.h>

Inheritance diagram for CHRouterWrapper< E, V >:
Collaboration diagram for CHRouterWrapper< E, V >:

Public Types

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

 CHRouterWrapper (const std::vector< E * > &edges, const bool ignoreErrors, typename SUMOAbstractRouter< E, V >::Operation operation, const SUMOTime begin, const SUMOTime end, const SUMOTime weightPeriod, const int numThreads)
 Constructor. More...
 
virtual SUMOAbstractRouter< E, V > * clone ()
 
bool compute (const E *from, const E *to, const V *const vehicle, SUMOTime msTime, std::vector< const E * > &into, bool silent=false)
 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...
 
bool computeLooped (const E *from, const E *to, const V *const vehicle, SUMOTime msTime, std::vector< const E * > &into, bool silent=false)
 Builds the route between the given edges using the minimum effort at the given time if from == to, return the shortest looped route. More...
 
void endQuery (int visits)
 
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
 
bool isProhibited (const E *const edge, const V *const vehicle) const
 
virtual void prohibit (const std::vector< E * > &)
 
double recomputeCosts (const std::vector< const E * > &edges, const V *const v, SUMOTime msTime, double *lengthp=nullptr) const
 
void setBulkMode (const bool mode)
 
void startQuery ()
 
void updateViaCost (const E *const prev, const E *const e, const V *const v, double &time, double &effort, double &length) const
 
void updateViaEdgeCost (const E *viaEdge, const V *const v, double &time, double &effort, double &length) const
 
 ~CHRouterWrapper ()
 

Protected Attributes

bool myBulkMode
 whether we are currently operating several route queries in a bulk More...
 
MsgHandler *const myErrorMsgHandler
 the handler for routing errors More...
 
const bool myHavePermissions
 whether edge permissions need to be considered More...
 
const bool myHaveRestrictions
 whether edge restrictions need to be considered More...
 
Operation myOperation
 The object's operation to perform. More...
 
std::vector< E * > myProhibited
 
Operation myTTOperation
 The object's operation to perform for travel times. More...
 

Private Types

typedef CHRouter< E, V > CHRouterType
 
typedef std::map< std::pair< const SUMOVehicleClass, const double >, CHRouterType * > RouterMap
 

Private Attributes

const SUMOTime myBegin
 
const std::vector< E * > & myEdges
 all edges with numerical ids More...
 
const SUMOTime myEnd
 
const bool myIgnoreErrors
 
const int myMaxNumInstances
 
long long int myNumQueries
 
long long int myQueryStartTime
 the time spent querying in milliseconds More...
 
long long int myQueryTimeSum
 
long long int myQueryVisits
 counters for performance logging More...
 
RouterMap myRouters
 
const std::string myType
 the type of this router More...
 
const SUMOTime myWeightPeriod
 

Detailed Description

template<class E, class V>
class CHRouterWrapper< E, V >

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)

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

Member Typedef Documentation

◆ CHRouterType

template<class E , class V >
typedef CHRouter<E, V> CHRouterWrapper< E, V >::CHRouterType
private

Definition at line 109 of file CHRouterWrapper.h.

◆ Operation

template<class E , class V >
typedef double(* SUMOAbstractRouter< E, V >::Operation) (const E *const, const V *const, double)
inherited

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

Definition at line 96 of file SUMOAbstractRouter.h.

◆ RouterMap

template<class E , class V >
typedef std::map<std::pair<const SUMOVehicleClass, const double>, CHRouterType*> CHRouterWrapper< E, V >::RouterMap
private

Definition at line 112 of file CHRouterWrapper.h.

Constructor & Destructor Documentation

◆ CHRouterWrapper()

template<class E , class V >
CHRouterWrapper< E, V >::CHRouterWrapper ( const std::vector< E * > &  edges,
const bool  ignoreErrors,
typename SUMOAbstractRouter< E, V >::Operation  operation,
const SUMOTime  begin,
const SUMOTime  end,
const SUMOTime  weightPeriod,
const int  numThreads 
)
inline

Constructor.

Definition at line 68 of file CHRouterWrapper.h.

◆ ~CHRouterWrapper()

template<class E , class V >
CHRouterWrapper< E, V >::~CHRouterWrapper ( )
inline

Definition at line 79 of file CHRouterWrapper.h.

References CHRouterWrapper< E, V >::myRouters.

Member Function Documentation

◆ clone()

◆ compute()

template<class E , class V >
bool CHRouterWrapper< E, V >::compute ( const E *  from,
const E *  to,
const V *const  vehicle,
SUMOTime  msTime,
std::vector< const E * > &  into,
bool  silent = false 
)
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 95 of file CHRouterWrapper.h.

References CHRouterWrapper< E, V >::myEdges, CHRouterWrapper< E, V >::myIgnoreErrors, CHRouterWrapper< E, V >::myRouters, and CHRouterWrapper< E, V >::myWeightPeriod.

◆ computeLooped()

template<class E , class V >
bool SUMOAbstractRouter< E, V >::computeLooped ( const E *  from,
const E *  to,
const V *const  vehicle,
SUMOTime  msTime,
std::vector< const E * > &  into,
bool  silent = false 
)
inlineinherited

Builds the route between the given edges using the minimum effort at the given time if from == to, return the shortest looped route.

Definition at line 130 of file SUMOAbstractRouter.h.

Referenced by MSBaseVehicle::reroute(), and MSTriggeredRerouter::rerouteParkingArea().

◆ endQuery()

template<class E , class V >
void SUMOAbstractRouter< E, V >::endQuery ( int  visits)
inlineinherited

◆ getEffort()

◆ getTravelTime()

template<class E , class V >
double SUMOAbstractRouter< E, V >::getTravelTime ( const E *const  e,
const V *const  v,
const double  t,
const double  effort 
) const
inlineinherited

◆ isProhibited()

template<class E , class V >
bool SUMOAbstractRouter< E, V >::isProhibited ( const E *const  edge,
const V *const  vehicle 
) const
inlineinherited

◆ prohibit()

template<class E , class V >
virtual void SUMOAbstractRouter< E, V >::prohibit ( const std::vector< E * > &  )
inlinevirtualinherited

◆ recomputeCosts()

◆ setBulkMode()

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

Definition at line 230 of file SUMOAbstractRouter.h.

Referenced by ROMAAssignments::incremental().

◆ startQuery()

template<class E , class V >
void SUMOAbstractRouter< E, V >::startQuery ( )
inlineinherited

◆ updateViaCost()

template<class E , class V >
void SUMOAbstractRouter< E, V >::updateViaCost ( const E *const  prev,
const E *const  e,
const V *const  v,
double &  time,
double &  effort,
double &  length 
) const
inlineinherited

◆ updateViaEdgeCost()

template<class E , class V >
void SUMOAbstractRouter< E, V >::updateViaEdgeCost ( const E *  viaEdge,
const V *const  v,
double &  time,
double &  effort,
double &  length 
) const
inlineinherited

Field Documentation

◆ myBegin

template<class E , class V >
const SUMOTime CHRouterWrapper< E, V >::myBegin
private

Definition at line 121 of file CHRouterWrapper.h.

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

◆ myBulkMode

template<class E , class V >
bool SUMOAbstractRouter< E, V >::myBulkMode
protectedinherited

whether we are currently operating several route queries in a bulk

Definition at line 245 of file SUMOAbstractRouter.h.

Referenced by AStarRouter< E, V >::compute(), DijkstraRouter< E, V >::compute(), and SUMOAbstractRouter< NBRouterEdge, NBVehicle >::setBulkMode().

◆ myEdges

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

all edges with numerical ids

Definition at line 117 of file CHRouterWrapper.h.

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

◆ myEnd

template<class E , class V >
const SUMOTime CHRouterWrapper< E, V >::myEnd
private

Definition at line 122 of file CHRouterWrapper.h.

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

◆ myErrorMsgHandler

◆ myHavePermissions

template<class E , class V >
const bool SUMOAbstractRouter< E, V >::myHavePermissions
protectedinherited

whether edge permissions need to be considered

Definition at line 248 of file SUMOAbstractRouter.h.

Referenced by CHRouter< E, V >::clone(), DijkstraRouter< E, V >::clone(), and SUMOAbstractRouter< NBRouterEdge, NBVehicle >::isProhibited().

◆ myHaveRestrictions

template<class E , class V >
const bool SUMOAbstractRouter< E, V >::myHaveRestrictions
protectedinherited

whether edge restrictions need to be considered

Definition at line 251 of file SUMOAbstractRouter.h.

Referenced by CHRouter< E, V >::clone(), DijkstraRouter< E, V >::clone(), and SUMOAbstractRouter< NBRouterEdge, NBVehicle >::isProhibited().

◆ myIgnoreErrors

template<class E , class V >
const bool CHRouterWrapper< E, V >::myIgnoreErrors
private

◆ myMaxNumInstances

template<class E , class V >
const int CHRouterWrapper< E, V >::myMaxNumInstances
private

Definition at line 124 of file CHRouterWrapper.h.

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

◆ myNumQueries

template<class E , class V >
long long int SUMOAbstractRouter< E, V >::myNumQueries
privateinherited

◆ myOperation

template<class E , class V >
Operation SUMOAbstractRouter< E, V >::myOperation
protectedinherited

◆ myProhibited

template<class E , class V >
std::vector<E*> SUMOAbstractRouter< E, V >::myProhibited
protectedinherited

◆ myQueryStartTime

template<class E , class V >
long long int SUMOAbstractRouter< E, V >::myQueryStartTime
privateinherited

the time spent querying in milliseconds

Definition at line 263 of file SUMOAbstractRouter.h.

Referenced by SUMOAbstractRouter< NBRouterEdge, NBVehicle >::endQuery(), and SUMOAbstractRouter< NBRouterEdge, NBVehicle >::startQuery().

◆ myQueryTimeSum

template<class E , class V >
long long int SUMOAbstractRouter< E, V >::myQueryTimeSum
privateinherited

◆ myQueryVisits

template<class E , class V >
long long int SUMOAbstractRouter< E, V >::myQueryVisits
privateinherited

◆ myRouters

template<class E , class V >
RouterMap CHRouterWrapper< E, V >::myRouters
private

◆ myTTOperation

template<class E , class V >
Operation SUMOAbstractRouter< E, V >::myTTOperation
protectedinherited

The object's operation to perform for travel times.

Definition at line 242 of file SUMOAbstractRouter.h.

Referenced by DijkstraRouter< E, V >::clone(), and SUMOAbstractRouter< NBRouterEdge, NBVehicle >::getTravelTime().

◆ myType

template<class E , class V >
const std::string SUMOAbstractRouter< E, V >::myType
privateinherited

the type of this router

Definition at line 257 of file SUMOAbstractRouter.h.

Referenced by SUMOAbstractRouter< NBRouterEdge, NBVehicle >::~SUMOAbstractRouter().

◆ myWeightPeriod

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

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