![]() |
Eclipse SUMO - Simulation of Urban MObility
|
Computes the shortest path through a contracted network. More...
#include <CHRouter.h>
Data Structures | |
class | Unidirectional |
Public Types | |
typedef std::pair< const typename SUMOAbstractRouter< E, V >::EdgeInfo *, const typename SUMOAbstractRouter< E, V >::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 SUMOAbstractRouter< E, V >::Operation operation, const SUMOVehicleClass svc, SUMOTime weightPeriod, const bool havePermissions, const bool haveRestrictions) | |
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, bool silent=false) |
Builds the route between the given edges using the minimum traveltime in the contracted graph. 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 |
virtual | ~CHRouter () |
Destructor. More... | |
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 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... | |
Unidirectional | myForwardSearch |
the unidirectional search queues More... | |
const CHBuilder< E, V >::Hierarchy * | myHierarchy |
CHBuilder< E, V > * | myHierarchyBuilder |
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... | |
const SUMOVehicleClass | mySVC |
the permissions for which the hierarchy was constructed More... | |
const std::string | myType |
the type of this router More... | |
SUMOTime | myValidUntil |
the validity duration of the current hierarchy (exclusive) More... | |
const SUMOTime | myWeightPeriod |
the validity duration of one weight interval More... | |
Computes the shortest path through a contracted network.
The template parameters are:
E | The edge class to use (MSEdge/ROEdge) |
V | The vehicle class to use (MSVehicle/ROVehicle) |
PF | The 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.
The template parameters are:
E | The edge class to use (MSEdge/ROEdge) |
V | The 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 61 of file CHRouter.h.
typedef std::pair<const typename SUMOAbstractRouter<E, V>::EdgeInfo*, const typename SUMOAbstractRouter<E, V>::EdgeInfo*> CHRouter< E, V >::Meeting |
A meeting point of the two search scopes.
Definition at line 65 of file CHRouter.h.
|
inherited |
Type of the function that is used to retrieve the edge effort.
Definition at line 96 of file SUMOAbstractRouter.h.
|
inline |
Constructor.
[in] | validatePermissions | Whether 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 220 of file CHRouter.h.
Destructor.
Definition at line 236 of file CHRouter.h.
References CHRouter< E, V >::myHierarchy, and CHRouter< E, V >::myHierarchyBuilder.
|
inline |
Definition at line 338 of file CHRouter.h.
References CHRouter< E, V >::myHierarchy, CHRouter< E, V >::myHierarchyBuilder, CHRouter< E, V >::myValidUntil, and CHRouter< E, V >::myWeightPeriod.
Referenced by CHRouter< E, V >::compute().
|
inline |
normal routing methods
Builds the path from marked edges
Definition at line 305 of file CHRouter.h.
References CHRouter< E, V >::getVia().
Referenced by CHRouter< E, V >::compute().
|
inlinevirtual |
Implements SUMOAbstractRouter< E, V >.
Definition at line 244 of file CHRouter.h.
References MsgHandler::getWarningInstance(), CHRouter< E, V >::myEdges, SUMOAbstractRouter< E, V >::myErrorMsgHandler, SUMOAbstractRouter< E, V >::myHavePermissions, SUMOAbstractRouter< E, V >::myHaveRestrictions, SUMOAbstractRouter< E, V >::myOperation, CHRouter< E, V >::mySVC, and CHRouter< E, V >::myWeightPeriod.
|
inlinevirtual |
Builds the route between the given edges using the minimum traveltime in the contracted graph.
Implements SUMOAbstractRouter< E, V >.
Definition at line 255 of file CHRouter.h.
References CHRouter< E, V >::buildContractionHierarchy(), CHRouter< E, V >::buildPathFromMeeting(), SUMOAbstractRouter< E, V >::endQuery(), MsgHandler::informf(), CHRouter< E, V >::Unidirectional::init(), CHRouter< E, V >::myBackwardSearch, SUMOAbstractRouter< E, V >::myErrorMsgHandler, CHRouter< E, V >::myForwardSearch, CHRouter< E, V >::myHierarchy, CHRouter< E, V >::myValidUntil, CHRouter< E, V >::myWeightPeriod, SUMOAbstractRouter< E, V >::startQuery(), CHRouter< E, V >::Unidirectional::step(), and toString().
|
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().
|
inlineinherited |
Definition at line 225 of file SUMOAbstractRouter.h.
Referenced by DijkstraRouter< E, V >::compute(), AStarRouter< E, V >::compute(), and CHRouter< E, V >::compute().
|
inlineinherited |
Definition at line 216 of file SUMOAbstractRouter.h.
Referenced by PedestrianRouter< E, L, N, V >::compute(), IntermodalRouter< E, L, N, V >::compute(), DijkstraRouter< E, V >::compute(), AStarRouter< E, V >::compute(), CHBuilder< E, V >::synchronize(), SUMOAbstractRouter< NBRouterEdge, NBVehicle >::updateViaCost(), and SUMOAbstractRouter< NBRouterEdge, NBVehicle >::updateViaEdgeCost().
|
inlineinherited |
Definition at line 165 of file SUMOAbstractRouter.h.
Referenced by DijkstraRouter< E, V >::compute(), AStarRouter< E, V >::compute(), SUMOAbstractRouter< NBRouterEdge, NBVehicle >::updateViaCost(), and SUMOAbstractRouter< NBRouterEdge, NBVehicle >::updateViaEdgeCost().
|
inlineprivate |
Definition at line 353 of file CHRouter.h.
References CHRouter< E, V >::myHierarchy.
Referenced by CHRouter< E, V >::buildPathFromMeeting().
|
inlineinherited |
Definition at line 159 of file SUMOAbstractRouter.h.
Referenced by SUMOAbstractRouter< NBRouterEdge, NBVehicle >::recomputeCosts().
|
inlinevirtualinherited |
Reimplemented in AStarRouter< E, V >, and DijkstraRouter< E, V >.
Definition at line 163 of file SUMOAbstractRouter.h.
Referenced by MSRoutingEngine::getRouterTT(), IntermodalRouter< E, L, N, V >::prohibit(), and MSRoutingEngine::reroute().
|
inlineinherited |
Definition at line 195 of file SUMOAbstractRouter.h.
Referenced by RORouteDef::addAlternative(), AStarRouter< E, V >::compute(), SUMOAbstractRouter< NBRouterEdge, NBVehicle >::computeLooped(), ROMAAssignments::computePath(), computeRoutes(), libsumo::Simulation::findRoute(), NBPTLineCont::getCost(), LandmarkLookupTable< E, V >::LandmarkLookupTable(), MSTriggeredRerouter::notifyEnter(), MSBaseVehicle::reroute(), MSTriggeredRerouter::rerouteParkingArea(), MSVehicle::rerouteParkingArea(), and ROMAAssignments::sue().
|
inlineinherited |
Definition at line 230 of file SUMOAbstractRouter.h.
Referenced by ROMAAssignments::incremental().
|
inlineinherited |
Definition at line 220 of file SUMOAbstractRouter.h.
Referenced by DijkstraRouter< E, V >::compute(), AStarRouter< E, V >::compute(), and CHRouter< E, V >::compute().
|
inlineinherited |
Definition at line 179 of file SUMOAbstractRouter.h.
Referenced by IntermodalRouter< E, L, N, V >::compute(), and SUMOAbstractRouter< NBRouterEdge, NBVehicle >::recomputeCosts().
|
inlineinherited |
Definition at line 169 of file SUMOAbstractRouter.h.
Referenced by DijkstraRouter< E, V >::compute(), AStarRouter< E, V >::compute(), and SUMOAbstractRouter< NBRouterEdge, NBVehicle >::updateViaCost().
|
private |
Definition at line 370 of file CHRouter.h.
Referenced by CHRouter< E, V >::compute().
|
protectedinherited |
whether we are currently operating several route queries in a bulk
Definition at line 245 of file SUMOAbstractRouter.h.
Referenced by DijkstraRouter< E, V >::compute(), AStarRouter< E, V >::compute(), and SUMOAbstractRouter< NBRouterEdge, NBVehicle >::setBulkMode().
|
private |
all edges with numerical ids
Definition at line 366 of file CHRouter.h.
Referenced by CHRouter< E, V >::clone().
|
protectedinherited |
the handler for routing errors
Definition at line 236 of file SUMOAbstractRouter.h.
Referenced by DijkstraRouter< E, V >::clone(), AStarRouter< E, V >::clone(), CHRouter< E, V >::clone(), DijkstraRouter< E, V >::compute(), AStarRouter< E, V >::compute(), CHRouter< E, V >::compute(), and SUMOAbstractRouter< NBRouterEdge, NBVehicle >::computeLooped().
|
private |
the unidirectional search queues
Definition at line 369 of file CHRouter.h.
Referenced by CHRouter< E, V >::compute().
|
protectedinherited |
whether edge permissions need to be considered
Definition at line 248 of file SUMOAbstractRouter.h.
Referenced by DijkstraRouter< E, V >::clone(), CHRouter< E, V >::clone(), and SUMOAbstractRouter< NBRouterEdge, NBVehicle >::isProhibited().
|
protectedinherited |
whether edge restrictions need to be considered
Definition at line 251 of file SUMOAbstractRouter.h.
Referenced by DijkstraRouter< E, V >::clone(), CHRouter< E, V >::clone(), and SUMOAbstractRouter< NBRouterEdge, NBVehicle >::isProhibited().
|
private |
Definition at line 373 of file CHRouter.h.
Referenced by CHRouter< E, V >::buildContractionHierarchy(), CHRouter< E, V >::compute(), CHRouter< E, V >::getVia(), and CHRouter< E, V >::~CHRouter().
Definition at line 372 of file CHRouter.h.
Referenced by CHRouter< E, V >::buildContractionHierarchy(), and CHRouter< E, V >::~CHRouter().
|
privateinherited |
Definition at line 261 of file SUMOAbstractRouter.h.
Referenced by SUMOAbstractRouter< NBRouterEdge, NBVehicle >::startQuery(), and SUMOAbstractRouter< NBRouterEdge, NBVehicle >::~SUMOAbstractRouter().
|
protectedinherited |
The object's operation to perform.
Definition at line 239 of file SUMOAbstractRouter.h.
Referenced by CHRouterWrapper< E, V >::clone(), DijkstraRouter< E, V >::clone(), AStarRouter< E, V >::clone(), CHRouter< E, V >::clone(), and SUMOAbstractRouter< NBRouterEdge, NBVehicle >::getEffort().
|
protectedinherited |
Definition at line 253 of file SUMOAbstractRouter.h.
Referenced by DijkstraRouter< E, V >::prohibit(), and AStarRouter< E, V >::prohibit().
|
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().
|
privateinherited |
Definition at line 264 of file SUMOAbstractRouter.h.
Referenced by SUMOAbstractRouter< NBRouterEdge, NBVehicle >::endQuery(), and SUMOAbstractRouter< NBRouterEdge, NBVehicle >::~SUMOAbstractRouter().
|
privateinherited |
counters for performance logging
Definition at line 260 of file SUMOAbstractRouter.h.
Referenced by SUMOAbstractRouter< NBRouterEdge, NBVehicle >::endQuery(), and SUMOAbstractRouter< NBRouterEdge, NBVehicle >::~SUMOAbstractRouter().
|
private |
the permissions for which the hierarchy was constructed
Definition at line 382 of file CHRouter.h.
Referenced by CHRouter< E, V >::clone().
|
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().
|
privateinherited |
the type of this router
Definition at line 257 of file SUMOAbstractRouter.h.
Referenced by SUMOAbstractRouter< NBRouterEdge, NBVehicle >::~SUMOAbstractRouter().
the validity duration of the current hierarchy (exclusive)
Definition at line 379 of file CHRouter.h.
Referenced by CHRouter< E, V >::buildContractionHierarchy(), and CHRouter< E, V >::compute().
the validity duration of one weight interval
Definition at line 376 of file CHRouter.h.
Referenced by CHRouter< E, V >::buildContractionHierarchy(), CHRouter< E, V >::clone(), and CHRouter< E, V >::compute().