![]() |
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. | |
| typedef double(* | Operation) (const E *const, const V *const, double) |
| Type of the function that is used to retrieve the edge effort. | |
| typedef std::map< const E *, double > | Prohibitions |
| Prohibitions and their estimated end time. | |
Public Member Functions | |
| void | buildPathFrom (const typename SUMOAbstractRouter< E, V >::EdgeInfo *rbegin, std::vector< const E * > &edges) |
| Builds the path from marked edges. | |
| void | buildPathFromMeeting (Meeting meeting, std::vector< const E * > &into) const |
| normal routing methods | |
| 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. | |
| CHRouter (const std::vector< E * > &edges, bool unbuildIsWarning, typename SUMOAbstractRouter< E, V >::Operation operation, const SUMOVehicleClass svc, typename CHBuilder< E, V >::Hierarchy *hierarchy, const bool havePermissions, const bool haveRestrictions) | |
| Cloning constructor, should be used only for time independent instances which build a hierarchy only once. | |
| 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. | |
| bool | compute (const E *from, double fromPos, const E *to, double toPos, 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, also taking into account position along the edges to ensure currect handling of looped routes The definition of the effort depends on the wished routing scheme. | |
| 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. | |
| void | endQuery (int visits) |
| const SUMOAbstractRouter< E, V >::EdgeInfo & | getEdgeInfo (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 |
| const std::string & | getType () const |
| void | init (const int edgeID, const SUMOTime msTime) |
| bool | isProhibited (const E *const edge, const V *const vehicle) const |
| bool | isValid (const std::vector< const E * > &edges, const V *const v) const |
| virtual void | prohibit (const std::map< const E *, double > &toProhibit) |
| virtual double | recomputeCosts (const std::vector< const E * > &edges, const V *const v, SUMOTime msTime, double *lengthp=nullptr) const |
| double | recomputeCostsPos (const std::vector< const E * > &edges, const V *const v, double fromPos, double toPos, SUMOTime msTime, double *lengthp=nullptr) const |
| virtual void | reset (const V *const vehicle) |
| trigger hierarchy rebuild | |
| void | setAutoBulkMode (const bool mode) |
| virtual void | setBulkMode (const bool mode) |
| double | setHint (const typename std::vector< const E * >::const_iterator routeBegin, const typename std::vector< const E * >::const_iterator routeEnd, const V *const v, SUMOTime msTime) |
| 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. | |
Protected Attributes | |
| bool | myAmClean |
| whether we are already initialized | |
| bool | myAutoBulkMode |
| whether we are currently trying to detect bulk mode automatically | |
| bool | myBulkMode |
| whether we are currently operating several route queries in a bulk | |
| std::vector< typename SUMOAbstractRouter< E, V >::EdgeInfo > | myEdgeInfos |
| The container of edge information. | |
| MsgHandler *const | myErrorMsgHandler |
| the handler for routing errors | |
| std::vector< typename SUMOAbstractRouter< E, V >::EdgeInfo * > | myFound |
| list of visited Edges (for resetting) | |
| std::vector< typename SUMOAbstractRouter< E, V >::EdgeInfo * > | myFrontierList |
| A container for reusage of the min edge heap. | |
| const bool | myHavePermissions |
| whether edge permissions need to be considered | |
| const bool | myHaveRestrictions |
| whether edge restrictions need to be considered | |
| Operation | myOperation |
| The object's operation to perform. | |
| Prohibitions | myProhibited |
| The list of explicitly prohibited edges and estimated end time of prohibition. | |
| Operation | myTTOperation |
| The object's operation to perform for travel times. | |
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 | |
| Unidirectional | myForwardSearch |
| the unidirectional search queues | |
| CHBuilder< E, V >::Hierarchy * | myHierarchy |
| CHBuilder< E, V > * | myHierarchyBuilder |
| long long int | myNumQueries |
| long long int | myQueryStartTime |
| the time spent querying in milliseconds | |
| long long int | myQueryTimeSum |
| long long int | myQueryVisits |
| counters for performance logging | |
| const SUMOVehicleClass | mySVC |
| the permissions for which the hierarchy was constructed | |
| const std::string | myType |
| the type of this router | |
| SUMOTime | myValidUntil |
| the validity duration of the current hierarchy (exclusive) | |
| const SUMOTime | myWeightPeriod |
| the validity duration of one weight interval | |
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 59 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 63 of file CHRouter.h.
|
inherited |
Type of the function that is used to retrieve the edge effort.
Definition at line 95 of file SUMOAbstractRouter.h.
|
inherited |
Prohibitions and their estimated end time.
Definition at line 98 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 218 of file CHRouter.h.
References myBackwardSearch, myEdges, myForwardSearch, myHierarchy, myHierarchyBuilder, mySVC, myValidUntil, myWeightPeriod, and SUMOAbstractRouter< E, V >::SUMOAbstractRouter().
Referenced by clone().
|
inline |
Cloning constructor, should be used only for time independent instances which build a hierarchy only once.
Definition at line 235 of file CHRouter.h.
References myBackwardSearch, myEdges, myForwardSearch, myHierarchy, myHierarchyBuilder, mySVC, myValidUntil, myWeightPeriod, SUMOAbstractRouter< E, V >::SUMOAbstractRouter(), and SUMOTime_MAX.
Destructor.
Definition at line 251 of file CHRouter.h.
References myHierarchy, and myHierarchyBuilder.
|
inlineinherited |
Builds the path from marked edges.
Definition at line 382 of file SUMOAbstractRouter.h.
Referenced by AFRouter< E, N, V, M >::compute(), AStarRouter< _IntermodalEdge, _IntermodalTrip, _MapMatcher >::compute(), DijkstraRouter< _IntermodalEdge, _IntermodalTrip >::compute(), and Node2EdgeRouter< E, N, V, M >::computeNode2Edge().
|
inline |
normal routing methods
Builds the path from marked edges
Definition at line 346 of file CHRouter.h.
References getVia().
Referenced by compute().
|
inlinevirtual |
Implements SUMOAbstractRouter< E, V >.
Definition at line 259 of file CHRouter.h.
References CHRouter(), MsgHandler::getWarningInstance(), myEdges, SUMOAbstractRouter< E, V >::myErrorMsgHandler, SUMOAbstractRouter< E, V >::myHavePermissions, SUMOAbstractRouter< E, V >::myHaveRestrictions, myHierarchy, SUMOAbstractRouter< E, V >::myOperation, mySVC, myWeightPeriod, SUMOAbstractRouter< E, V >::SUMOAbstractRouter(), and SUMOTime_MAX.
|
inlinevirtual |
Builds the route between the given edges using the minimum traveltime in the contracted graph.
Implements SUMOAbstractRouter< E, V >.
Definition at line 295 of file CHRouter.h.
References buildPathFromMeeting(), SUMOAbstractRouter< E, V >::endQuery(), myBackwardSearch, SUMOAbstractRouter< E, V >::myErrorMsgHandler, myForwardSearch, myHierarchy, myHierarchyBuilder, myValidUntil, myWeightPeriod, reset(), SUMOAbstractRouter< E, V >::startQuery(), TL, and toString().
|
inlineinherited |
Builds the route between the given edges using the minimum effort at the given time, also taking into account position along the edges to ensure currect handling of looped routes The definition of the effort depends on the wished routing scheme.
Definition at line 191 of file SUMOAbstractRouter.h.
|
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 206 of file SUMOAbstractRouter.h.
Referenced by SUMOAbstractRouter< MSEdge, SUMOVehicle >::compute(), MSBaseVehicle::optimizeSkipped(), MSBaseVehicle::reroute(), and MSBaseVehicle::routeAlongStops().
|
inlineinherited |
Definition at line 352 of file SUMOAbstractRouter.h.
Referenced by AStarRouter< _IntermodalEdge, _IntermodalTrip, _MapMatcher >::compute(), CHRouter< E, V >::compute(), DijkstraRouter< _IntermodalEdge, _IntermodalTrip >::compute(), Node2EdgeRouter< E, N, V, M >::computeNode2Edge(), Node2EdgeRouter< E, N, V, M >::computeNode2Edges(), and AFRouter< E, N, V, M >::endQuery().
|
inlineinherited |
Definition at line 177 of file SUMOAbstractRouter.h.
|
inlineinherited |
Definition at line 338 of file SUMOAbstractRouter.h.
Referenced by AFRouter< E, N, V, M >::compute(), AStarRouter< _IntermodalEdge, _IntermodalTrip, _MapMatcher >::compute(), DijkstraRouter< _IntermodalEdge, _IntermodalTrip >::compute(), Node2EdgeRouter< E, N, V, M >::computeNode2Edge(), Node2EdgeRouter< E, N, V, M >::computeNode2Edges(), RailwayRouter< E, V >::recomputeCosts(), SUMOAbstractRouter< MSEdge, SUMOVehicle >::recomputeCostsPos(), SUMOAbstractRouter< MSEdge, SUMOVehicle >::setHint(), CHBuilder< E, V >::synchronize(), SUMOAbstractRouter< MSEdge, SUMOVehicle >::updateViaCost(), and SUMOAbstractRouter< MSEdge, SUMOVehicle >::updateViaEdgeCost().
|
inlineinherited |
Definition at line 239 of file SUMOAbstractRouter.h.
Referenced by AFRouter< E, N, V, M >::compute(), AStarRouter< _IntermodalEdge, _IntermodalTrip, _MapMatcher >::compute(), DijkstraRouter< _IntermodalEdge, _IntermodalTrip >::compute(), Node2EdgeRouter< E, N, V, M >::computeNode2Edge(), Node2EdgeRouter< E, N, V, M >::computeNode2Edges(), SUMOAbstractRouter< MSEdge, SUMOVehicle >::updateViaCost(), and SUMOAbstractRouter< MSEdge, SUMOVehicle >::updateViaEdgeCost().
|
inlineinherited |
Definition at line 173 of file SUMOAbstractRouter.h.
|
inlineprivate |
Definition at line 381 of file CHRouter.h.
References myHierarchy.
Referenced by buildPathFromMeeting().
|
inlineinherited |
Definition at line 144 of file SUMOAbstractRouter.h.
Referenced by AStarRouter< _IntermodalEdge, _IntermodalTrip, _MapMatcher >::compute(), DijkstraRouter< _IntermodalEdge, _IntermodalTrip >::compute(), and SUMOAbstractRouter< MSEdge, SUMOVehicle >::setHint().
|
inlineinherited |
Definition at line 235 of file SUMOAbstractRouter.h.
Referenced by SUMOAbstractRouter< MSEdge, SUMOVehicle >::isValid(), Node2EdgeRouter< E, N, V, M >::recomputeCostsNoLastEdge(), and SUMOAbstractRouter< MSEdge, SUMOVehicle >::setHint().
|
inlineinherited |
Definition at line 268 of file SUMOAbstractRouter.h.
Referenced by RORouteDef::addAlternative().
|
inlinevirtual |
Reimplemented from SUMOAbstractRouter< E, V >.
Definition at line 270 of file CHRouter.h.
References TL, and WRITE_WARNINGF.
|
inlinevirtualinherited |
Reimplemented in RailwayRouter< E, V >.
Definition at line 277 of file SUMOAbstractRouter.h.
Referenced by RORouteDef::addAlternative(), AStarRouter< _IntermodalEdge, _IntermodalTrip, _MapMatcher >::compute(), DijkstraRouter< _IntermodalEdge, _IntermodalTrip >::compute(), SUMOAbstractRouter< MSEdge, SUMOVehicle >::computeLooped(), ROMAAssignments::computePath(), MSDispatch::computePickupTime(), computeRoutes(), MSDevice_StationFinder::estimateConsumption(), MSStoppingPlaceRerouter::evaluateDestination(), LIBSUMO_NAMESPACE::Simulation::findRoute(), NBPTLineCont::getCost(), MSBaseVehicle::insertStop(), LandmarkLookupTable< E, V, M >::LandmarkLookupTable(), RailwayRouter< E, V >::recomputeCosts(), SUMOAbstractRouter< MSEdge, SUMOVehicle >::recomputeCostsPos(), MSBaseVehicle::replaceStop(), MSBaseVehicle::reroute(), MSBaseVehicle::rerouteBetweenStops(), MSVehicle::rerouteParkingArea(), and MSTriggeredRerouter::triggerRouting().
|
inlineinherited |
Definition at line 295 of file SUMOAbstractRouter.h.
Referenced by MSDispatch::computeDetourTime(), MSBaseVehicle::optimizeSkipped(), MSBaseVehicle::reroute(), and MSBaseVehicle::routeAlongStops().
|
inlinevirtual |
trigger hierarchy rebuild
Reimplemented from SUMOAbstractRouter< E, V >.
Definition at line 278 of file CHRouter.h.
References myHierarchy, myHierarchyBuilder, myValidUntil, and myWeightPeriod.
Referenced by compute().
|
inlineinherited |
Definition at line 361 of file SUMOAbstractRouter.h.
Referenced by LandmarkLookupTable< E, V, M >::LandmarkLookupTable().
|
inlinevirtualinherited |
Reimplemented in AFRouter< E, N, V, M >, IntermodalRouter< E, L, N, V >, IntermodalRouter< MSEdge, MSLane, MSJunction, SUMOVehicle >, IntermodalRouter< ROEdge, ROLane, RONode, ROVehicle >, Node2EdgeRouter< E, N, V, M >, Node2EdgeRouter< FlippedEdge< E, N, V >, FlippedNode< E, N, V >, V, M >, and RailwayRouter< E, V >.
Definition at line 357 of file SUMOAbstractRouter.h.
Referenced by ROMAAssignments::computePath(), and IntermodalRouter< MSEdge, MSLane, MSJunction, SUMOVehicle >::setBulkMode().
|
inlineinherited |
Definition at line 307 of file SUMOAbstractRouter.h.
|
inlineinherited |
Definition at line 347 of file SUMOAbstractRouter.h.
Referenced by AStarRouter< _IntermodalEdge, _IntermodalTrip, _MapMatcher >::compute(), CHRouter< E, V >::compute(), DijkstraRouter< _IntermodalEdge, _IntermodalTrip >::compute(), Node2EdgeRouter< E, N, V, M >::computeNode2Edge(), Node2EdgeRouter< E, N, V, M >::computeNode2Edges(), and AFRouter< E, N, V, M >::startQuery().
|
inlineinherited |
Definition at line 253 of file SUMOAbstractRouter.h.
Referenced by RailwayRouter< E, V >::recomputeCosts(), SUMOAbstractRouter< MSEdge, SUMOVehicle >::recomputeCosts(), Node2EdgeRouter< E, N, V, M >::recomputeCostsNoLastEdge(), and SUMOAbstractRouter< MSEdge, SUMOVehicle >::setHint().
|
inlineinherited |
Definition at line 243 of file SUMOAbstractRouter.h.
Referenced by AFRouter< E, N, V, M >::compute(), AStarRouter< _IntermodalEdge, _IntermodalTrip, _MapMatcher >::compute(), DijkstraRouter< _IntermodalEdge, _IntermodalTrip >::compute(), Node2EdgeRouter< E, N, V, M >::computeNode2Edge(), Node2EdgeRouter< E, N, V, M >::computeNode2Edges(), SUMOAbstractRouter< MSEdge, SUMOVehicle >::updateViaCost(), and Node2EdgeRouter< E, N, V, M >::updateViaCostUpToEdge().
|
protectedinherited |
whether we are already initialized
Definition at line 408 of file SUMOAbstractRouter.h.
Referenced by AFRouter< E, N, V, M >::compute(), Node2EdgeRouter< E, N, V, M >::computeNode2Edge(), and Node2EdgeRouter< E, N, V, M >::computeNode2Edges().
|
protectedinherited |
whether we are currently trying to detect bulk mode automatically
Definition at line 405 of file SUMOAbstractRouter.h.
|
private |
Definition at line 398 of file CHRouter.h.
Referenced by CHRouter(), CHRouter(), and compute().
|
protectedinherited |
whether we are currently operating several route queries in a bulk
Definition at line 402 of file SUMOAbstractRouter.h.
|
protectedinherited |
The container of edge information.
Definition at line 420 of file SUMOAbstractRouter.h.
Referenced by AFRouter< E, N, V, M >::AFRouter(), AFRouter< E, N, V, M >::AFRouter(), AFRouter< E, N, V, M >::AFRouter(), AFRouter< E, N, V, M >::clone(), Node2EdgeRouter< E, N, V, M >::clone(), AFRouter< E, N, V, M >::compute(), Node2EdgeRouter< E, N, V, M >::computeNode2Edge(), Node2EdgeRouter< E, N, V, M >::computeNode2Edges(), AFRouter< E, N, V, M >::edgeInfo(), AFRouter< E, N, V, M >::edgeInfo(), Node2EdgeRouter< E, N, V, M >::edgeInfo(), Node2EdgeRouter< E, N, V, M >::edgeInfo(), AFRouter< E, N, V, M >::init(), and Node2EdgeRouter< E, N, V, M >::init().
all edges with numerical ids
Definition at line 394 of file CHRouter.h.
Referenced by CHRouter(), CHRouter(), and clone().
|
protectedinherited |
the handler for routing errors
Definition at line 393 of file SUMOAbstractRouter.h.
Referenced by AFRouter< E, N, V, M >::clone(), CHRouter< E, V >::clone(), Node2EdgeRouter< E, N, V, M >::clone(), AFRouter< E, N, V, M >::compute(), CHRouter< E, V >::compute(), Node2EdgeRouter< E, N, V, M >::computeNode2Edge(), Node2EdgeRouter< E, N, V, M >::computeNode2Edges(), and RailwayRouter< E, V >::ensureInternalRouter().
|
private |
the unidirectional search queues
Definition at line 397 of file CHRouter.h.
Referenced by CHRouter(), CHRouter(), and compute().
|
protectedinherited |
list of visited Edges (for resetting)
Definition at line 425 of file SUMOAbstractRouter.h.
Referenced by AFRouter< E, N, V, M >::compute(), Node2EdgeRouter< E, N, V, M >::computeNode2Edge(), Node2EdgeRouter< E, N, V, M >::computeNode2Edges(), AFRouter< E, N, V, M >::init(), Node2EdgeRouter< E, N, V, M >::init(), and Node2EdgeRouter< E, N, V, M >::reset().
|
protectedinherited |
A container for reusage of the min edge heap.
Definition at line 423 of file SUMOAbstractRouter.h.
Referenced by AFRouter< E, N, V, M >::compute(), Node2EdgeRouter< E, N, V, M >::computeNode2Edge(), Node2EdgeRouter< E, N, V, M >::computeNode2Edges(), AFRouter< E, N, V, M >::init(), Node2EdgeRouter< E, N, V, M >::init(), and Node2EdgeRouter< E, N, V, M >::reset().
|
protectedinherited |
whether edge permissions need to be considered
Definition at line 411 of file SUMOAbstractRouter.h.
Referenced by AFRouter< E, N, V, M >::clone(), CHRouter< E, V >::clone(), CHRouterWrapper< E, V >::clone(), Node2EdgeRouter< E, N, V, M >::clone(), and RailwayRouter< E, V >::ensureInternalRouter().
|
protectedinherited |
whether edge restrictions need to be considered
Definition at line 414 of file SUMOAbstractRouter.h.
Referenced by AFRouter< E, N, V, M >::clone(), CHRouter< E, V >::clone(), Node2EdgeRouter< E, N, V, M >::clone(), and RailwayRouter< E, V >::ensureInternalRouter().
Definition at line 401 of file CHRouter.h.
Referenced by CHRouter(), CHRouter(), clone(), compute(), getVia(), reset(), and ~CHRouter().
Definition at line 400 of file CHRouter.h.
Referenced by CHRouter(), CHRouter(), compute(), reset(), and ~CHRouter().
|
privateinherited |
Definition at line 433 of file SUMOAbstractRouter.h.
|
protectedinherited |
The object's operation to perform.
Definition at line 396 of file SUMOAbstractRouter.h.
Referenced by AFRouter< E, N, V, M >::clone(), CHRouter< E, V >::clone(), CHRouterWrapper< E, V >::clone(), Node2EdgeRouter< E, N, V, M >::clone(), and CHRouterWrapper< E, V >::compute().
|
protectedinherited |
The list of explicitly prohibited edges and estimated end time of prohibition.
Definition at line 417 of file SUMOAbstractRouter.h.
Referenced by RailwayRouter< E, V >::_compute(), and RailwayRouter< E, V >::prohibit().
|
privateinherited |
the time spent querying in milliseconds
Definition at line 435 of file SUMOAbstractRouter.h.
|
privateinherited |
Definition at line 436 of file SUMOAbstractRouter.h.
|
privateinherited |
counters for performance logging
Definition at line 432 of file SUMOAbstractRouter.h.
|
private |
the permissions for which the hierarchy was constructed
Definition at line 410 of file CHRouter.h.
Referenced by CHRouter(), CHRouter(), and clone().
|
protectedinherited |
The object's operation to perform for travel times.
Definition at line 399 of file SUMOAbstractRouter.h.
|
privateinherited |
the type of this router
Definition at line 429 of file SUMOAbstractRouter.h.
the validity duration of the current hierarchy (exclusive)
Definition at line 407 of file CHRouter.h.
Referenced by CHRouter(), CHRouter(), compute(), and reset().
the validity duration of one weight interval
Definition at line 404 of file CHRouter.h.
Referenced by CHRouter(), CHRouter(), clone(), compute(), and reset().