![]() |
Eclipse SUMO - Simulation of Urban MObility
|
#include <RailwayRouter.h>
Public Types | |
| typedef double(* | Operation) (const E *const, const V *const, double) |
| Type of the function that is used to retrieve the edge effort. | |
Public Member Functions | |
| void | buildPathFrom (const typename SUMOAbstractRouter< E, V >::EdgeInfo *rbegin, std::vector< const E * > &edges) |
| Builds the path from marked edges. | |
| 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. | |
| 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 |
| void | prohibit (const Prohibitions &toProhibit) |
| RailwayRouter (const std::vector< E * > &edges, bool unbuildIsWarning, typename SUMOAbstractRouter< E, V >::Operation effortOperation, typename SUMOAbstractRouter< E, V >::Operation ttOperation=nullptr, bool silent=false, bool havePermissions=false, const bool haveRestrictions=false, double maxTrainLength=5000, double reversalPenalty=60) | |
| Constructor. | |
| 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) |
| reset internal caches, used by CHRouter | |
| void | setAutoBulkMode (const bool mode) |
| 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 | ~RailwayRouter () |
| 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 Types | |
| typedef DijkstraRouter< _RailEdge, V > | _InternalDijkstra |
| typedef SUMOAbstractRouter< _RailEdge, V > | _InternalRouter |
| typedef RailEdge< E, V > | _RailEdge |
| typedef std::map< const E *, double > | Prohibitions |
Private Member Functions | |
| bool | _compute (const E *from, const E *to, const V *const vehicle, SUMOTime msTime, std::vector< const E * > &into, bool silent, bool avoidUnsafeBackTracking) |
| void | ensureInternalRouter () |
| const std::vector< _RailEdge * > & | getRailEdges () |
| RailwayRouter & | operator= (const RailwayRouter &s) |
| Invalidated assignment operator. | |
| RailwayRouter (RailwayRouter *other) | |
Static Private Member Functions | |
| static const E * | getStraightPredecessor (const E *edge, std::vector< const E * > &prevRoute, int backIndex) |
| static double | getTravelTimeStatic (const RailEdge< E, V > *const edge, const V *const veh, double time) |
Private Attributes | |
| std::vector< _RailEdge * > | myInitialEdges |
| a RailEdge for every existing edge, filled on construction (but not in clones) | |
| _InternalRouter * | myInternalRouter |
| const E * | myLastFrom |
| track previous edge for correct bulk routing | |
| const double | myMaxTrainLength |
| long long int | myNumQueries |
| RailwayRouter< E, V > *const | myOriginal |
| long long int | myQueryStartTime |
| the time spent querying in milliseconds | |
| long long int | myQueryTimeSum |
| long long int | myQueryVisits |
| counters for performance logging | |
| std::vector< _RailEdge * > | myRailEdges |
| complete rail network filled on demand (but not in clones) | |
| const bool | mySilent |
| whether to suppress warning/error if no route was found | |
| const std::string | myType |
| the type of this router | |
Static Private Attributes | |
| static double | myReversalPenalty |
| static double | myReversalPenaltyFactor |
| static SUMOAbstractRouter< E, V >::Operation | myStaticOperation |
| The object's operation to perform. (hack). | |
The router for rail vehicles for track networks where some sections may be used in both directions and trains may reverse depending on location and train length
Example (assume each track section is 100m long) running from left to right and a negative sign indicates reverse direction
A C D
.______.______.______. ._____/ B
Consider a train of 200m length that enters on B and must move to A (with a reversal): The necessary route is B C D -D -C -A were D,-D are needed for the train to fully pass the switch
We shadow the normal edge graph with a railEdge graph to include virtual turnarounds that look at the train length. The graph extension takes place via RailEdge::init() For edge C we create a virtual turnaround (as successor of C) that connectes C with -C and is then expanded to C D -D -C for trains longer than 100m. The expension takes place via RailEdge::insertOriginalEdges()
Definition at line 67 of file RailwayRouter.h.
|
private |
Definition at line 74 of file RailwayRouter.h.
|
private |
Definition at line 73 of file RailwayRouter.h.
|
private |
Definition at line 72 of file RailwayRouter.h.
|
inherited |
Type of the function that is used to retrieve the edge effort.
Definition at line 95 of file SUMOAbstractRouter.h.
|
private |
Definition at line 75 of file RailwayRouter.h.
|
inline |
Constructor.
Definition at line 80 of file RailwayRouter.h.
References myInitialEdges, myInternalRouter, myLastFrom, myMaxTrainLength, myOriginal, myReversalPenalty, mySilent, myStaticOperation, and SUMOAbstractRouter< E, V >::SUMOAbstractRouter().
Referenced by clone(), operator=(), and RailwayRouter().
|
inlinevirtual |
|
inlineprivate |
Definition at line 164 of file RailwayRouter.h.
References myInternalRouter, myMaxTrainLength, myOriginal, mySilent, RailwayRouter(), and SUMOAbstractRouter< E, V >::SUMOAbstractRouter().
|
inlineprivate |
Definition at line 179 of file RailwayRouter.h.
References _compute(), getStraightPredecessor(), MIN2(), myInternalRouter, myLastFrom, SUMOAbstractRouter< E, V >::myProhibited, myReversalPenalty, time2string(), toString(), and WRITE_WARNING.
Referenced by _compute(), and compute().
|
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().
|
inlinevirtual |
Implements SUMOAbstractRouter< E, V >.
Definition at line 101 of file RailwayRouter.h.
References RailwayRouter(), and SUMOAbstractRouter< E, V >::SUMOAbstractRouter().
|
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 107 of file RailwayRouter.h.
References _compute(), ensureInternalRouter(), myMaxTrainLength, toString(), and WRITE_WARNINGF.
|
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().
|
inlineprivate |
Definition at line 172 of file RailwayRouter.h.
References getRailEdges(), getTravelTimeStatic(), MsgHandler::getWarningInstance(), SUMOAbstractRouter< E, V >::myErrorMsgHandler, SUMOAbstractRouter< E, V >::myHavePermissions, SUMOAbstractRouter< E, V >::myHaveRestrictions, myInternalRouter, and mySilent.
Referenced by compute(), and prohibit().
|
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().
|
inlineprivate |
Definition at line 271 of file RailwayRouter.h.
References GLObjectValuePassConnector< double >::myLock, myInitialEdges, myMaxTrainLength, myOriginal, myRailEdges, and myReversalPenalty.
Referenced by ensureInternalRouter().
|
inlinestaticprivate |
Definition at line 319 of file RailwayRouter.h.
Referenced by _compute().
|
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().
|
inlinestaticprivate |
Definition at line 288 of file RailwayRouter.h.
References RailEdge< E, V >::getOriginal(), RailEdge< E, V >::insertOriginalEdges(), RailEdge< E, V >::isVirtual(), MAX2(), myReversalPenalty, myReversalPenaltyFactor, and myStaticOperation.
Referenced by ensureInternalRouter().
|
inlineinherited |
Definition at line 173 of file SUMOAbstractRouter.h.
|
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().
|
private |
Invalidated assignment operator.
References RailwayRouter().
|
inlinevirtual |
Reimplemented from SUMOAbstractRouter< E, V >.
Definition at line 116 of file RailwayRouter.h.
References ensureInternalRouter(), myInternalRouter, and SUMOAbstractRouter< E, V >::myProhibited.
|
inlinevirtual |
Reimplemented from SUMOAbstractRouter< E, V >.
Definition at line 130 of file RailwayRouter.h.
References SUMOAbstractRouter< E, V >::getEffort(), myReversalPenalty, SUMOAbstractRouter< E, V >::recomputeCosts(), STEPS2TIME, and SUMOAbstractRouter< E, V >::updateViaCost().
|
inlineinherited |
Definition at line 295 of file SUMOAbstractRouter.h.
Referenced by MSDispatch::computeDetourTime(), MSBaseVehicle::optimizeSkipped(), MSBaseVehicle::reroute(), and MSBaseVehicle::routeAlongStops().
|
inlinevirtualinherited |
reset internal caches, used by CHRouter
Reimplemented in AFRouter< E, N, V, M >, CHRouter< E, V >, Node2EdgeRouter< E, N, V, M >, and Node2EdgeRouter< FlippedEdge< E, N, V >, FlippedNode< E, N, V >, V, M >.
Definition at line 169 of file SUMOAbstractRouter.h.
Referenced by computeRoutes().
|
inlineinherited |
Definition at line 361 of file SUMOAbstractRouter.h.
Referenced by LandmarkLookupTable< E, V, M >::LandmarkLookupTable().
|
inlinevirtual |
Reimplemented from SUMOAbstractRouter< E, V >.
Definition at line 157 of file RailwayRouter.h.
References myInternalRouter.
|
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.
|
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().
|
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().
|
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().
|
private |
a RailEdge for every existing edge, filled on construction (but not in clones)
Definition at line 345 of file RailwayRouter.h.
Referenced by getRailEdges(), and RailwayRouter().
|
private |
Definition at line 342 of file RailwayRouter.h.
Referenced by _compute(), ensureInternalRouter(), prohibit(), RailwayRouter(), RailwayRouter(), setBulkMode(), and ~RailwayRouter().
|
private |
track previous edge for correct bulk routing
Definition at line 355 of file RailwayRouter.h.
Referenced by _compute(), and RailwayRouter().
|
private |
Definition at line 352 of file RailwayRouter.h.
Referenced by compute(), getRailEdges(), RailwayRouter(), and RailwayRouter().
|
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().
|
private |
Definition at line 343 of file RailwayRouter.h.
Referenced by getRailEdges(), RailwayRouter(), and RailwayRouter().
|
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 |
complete rail network filled on demand (but not in clones)
Definition at line 347 of file RailwayRouter.h.
Referenced by getRailEdges().
|
staticprivate |
Definition at line 365 of file RailwayRouter.h.
Referenced by _compute(), getRailEdges(), getTravelTimeStatic(), RailwayRouter(), and recomputeCosts().
|
staticprivate |
Definition at line 366 of file RailwayRouter.h.
Referenced by getTravelTimeStatic().
|
private |
whether to suppress warning/error if no route was found
Definition at line 350 of file RailwayRouter.h.
Referenced by ensureInternalRouter(), RailwayRouter(), and RailwayRouter().
|
staticprivate |
The object's operation to perform. (hack).
Definition at line 363 of file RailwayRouter.h.
Referenced by getTravelTimeStatic(), and RailwayRouter().
|
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.