![]() |
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. More... | |
Public Member Functions | |
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 | 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. 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 |
const std::string & | getType () const |
bool | isProhibited (const E *const edge, const V *const vehicle) const |
void | prohibit (const std::vector< E * > &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, const bool havePermissions=false, const bool haveRestrictions=false, double maxTrainLength=5000) | |
Constructor. More... | |
double | recomputeCosts (const std::vector< const E * > &edges, const V *const v, double fromPos, double toPos, SUMOTime msTime, double *lengthp=nullptr) const |
double | recomputeCosts (const std::vector< const E * > &edges, const V *const v, SUMOTime msTime, double *lengthp=nullptr) const |
virtual void | reset (const V *const vehicle) |
reset internal caches, used by CHRouter More... | |
void | setAutoBulkMode (const bool mode) |
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 | ~RailwayRouter () |
Destructor. More... | |
Protected Attributes | |
bool | myAutoBulkMode |
whether we are currently trying to detect bulk mode automatically More... | |
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 DijkstraRouter< _RailEdge, V > | _InternalDijkstra |
typedef SUMOAbstractRouter< _RailEdge, V > | _InternalRouter |
typedef RailEdge< E, V > | _RailEdge |
Private Member Functions | |
void | ensureInternalRouter () |
const std::vector< _RailEdge * > & | getRailEdges () |
RailwayRouter & | operator= (const RailwayRouter &s) |
Invalidated assignment operator. More... | |
RailwayRouter (RailwayRouter *other) | |
Static Private Member Functions | |
static const E * | getStraightPredecessor (const E *edge) |
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) More... | |
_InternalRouter * | myInternalRouter |
const double | myMaxTrainLength |
long long int | myNumQueries |
RailwayRouter< E, V > *const | myOriginal |
long long int | myQueryStartTime |
the time spent querying in milliseconds More... | |
long long int | myQueryTimeSum |
long long int | myQueryVisits |
counters for performance logging More... | |
std::vector< _RailEdge * > | myRailEdges |
complete rail network filled on demand (but not in clones) More... | |
const bool | mySilent |
whether to suppress warning/error if no route was found More... | |
const std::string | myType |
the type of this router More... | |
Static Private Attributes | |
static double | myReversalPenalty |
static double | myReversalPenaltyFactor |
static SUMOAbstractRouter< E, V >::Operation | myStaticOperation |
The object's operation to perform. (hack) More... | |
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 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 94 of file SUMOAbstractRouter.h.
|
inline |
Constructor.
Definition at line 79 of file RailwayRouter.h.
References RailwayRouter< E, V >::myInitialEdges, and RailwayRouter< E, V >::myStaticOperation.
|
inlinevirtual |
Destructor.
Definition at line 92 of file RailwayRouter.h.
References RailwayRouter< E, V >::myInternalRouter.
|
inlineprivate |
Definition at line 166 of file RailwayRouter.h.
|
inlinevirtual |
Implements SUMOAbstractRouter< E, V >.
Definition at line 96 of file RailwayRouter.h.
|
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 102 of file RailwayRouter.h.
References SUMOAbstractRouter< E, V >::compute(), RailwayRouter< E, V >::ensureInternalRouter(), RailwayRouter< E, V >::getStraightPredecessor(), RailwayRouter< E, V >::myInternalRouter, RailwayRouter< E, V >::myMaxTrainLength, time2string(), toString(), WRITE_WARNING, 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 157 of file SUMOAbstractRouter.h.
References SUMOAbstractRouter< E, V >::compute(), and SUMOAbstractRouter< E, V >::computeLooped().
|
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 172 of file SUMOAbstractRouter.h.
References SUMOAbstractRouter< E, V >::compute(), MsgHandler::informf(), SUMOAbstractRouter< E, V >::myErrorMsgHandler, SUMOAbstractRouter< E, V >::recomputeCosts(), and SVC_IGNORING.
Referenced by SUMOAbstractRouter< E, V >::compute(), MSBaseVehicle::reroute(), and MSTriggeredRerouter::rerouteParkingArea().
|
inlineinherited |
Definition at line 279 of file SUMOAbstractRouter.h.
References SysUtils::getCurrentMillis(), SUMOAbstractRouter< E, V >::myQueryStartTime, SUMOAbstractRouter< E, V >::myQueryTimeSum, and SUMOAbstractRouter< E, V >::myQueryVisits.
Referenced by AStarRouter< E, V >::compute(), CHRouter< E, V >::compute(), and DijkstraRouter< E, V >::compute().
|
inlineprivate |
Definition at line 174 of file RailwayRouter.h.
References RailwayRouter< E, V >::getRailEdges(), RailwayRouter< E, V >::getTravelTimeStatic(), MsgHandler::getWarningInstance(), SUMOAbstractRouter< E, V >::myErrorMsgHandler, SUMOAbstractRouter< E, V >::myHavePermissions, SUMOAbstractRouter< E, V >::myHaveRestrictions, RailwayRouter< E, V >::myInternalRouter, and RailwayRouter< E, V >::mySilent.
Referenced by RailwayRouter< E, V >::compute(), and RailwayRouter< E, V >::prohibit().
|
inlineinherited |
Definition at line 270 of file SUMOAbstractRouter.h.
References SUMOAbstractRouter< E, V >::myOperation.
Referenced by IntermodalRouter< E, L, N, V >::compute(), AStarRouter< E, V >::compute(), DijkstraRouter< E, V >::compute(), PedestrianRouter< E, L, N, V >::compute(), SUMOAbstractRouter< E, V >::recomputeCosts(), CHBuilder< E, V >::synchronize(), SUMOAbstractRouter< E, V >::updateViaCost(), and SUMOAbstractRouter< E, V >::updateViaEdgeCost().
|
inlineprivate |
Definition at line 181 of file RailwayRouter.h.
References RailwayRouter< E, V >::myInitialEdges, RailwayRouter< E, V >::myMaxTrainLength, RailwayRouter< E, V >::myOriginal, and RailwayRouter< E, V >::myRailEdges.
Referenced by RailwayRouter< E, V >::ensureInternalRouter().
|
inlinestaticprivate |
Definition at line 227 of file RailwayRouter.h.
Referenced by RailwayRouter< E, V >::compute().
|
inlineinherited |
Definition at line 207 of file SUMOAbstractRouter.h.
References SUMOAbstractRouter< E, V >::myTTOperation.
Referenced by AStarRouter< E, V >::compute(), DijkstraRouter< E, V >::compute(), SUMOAbstractRouter< E, V >::updateViaCost(), and SUMOAbstractRouter< E, V >::updateViaEdgeCost().
|
inlinestaticprivate |
Definition at line 198 of file RailwayRouter.h.
References RailEdge< E, V >::getOriginal(), RailEdge< E, V >::insertOriginalEdges(), RailEdge< E, V >::isVirtual(), MAX2(), RailwayRouter< E, V >::myReversalPenalty, RailwayRouter< E, V >::myReversalPenaltyFactor, and RailwayRouter< E, V >::myStaticOperation.
Referenced by RailwayRouter< E, V >::ensureInternalRouter().
|
inlineinherited |
Definition at line 143 of file SUMOAbstractRouter.h.
References SUMOAbstractRouter< E, V >::myType.
|
inlineinherited |
Definition at line 201 of file SUMOAbstractRouter.h.
References SUMOAbstractRouter< E, V >::myHavePermissions, and SUMOAbstractRouter< E, V >::myHaveRestrictions.
Referenced by SUMOAbstractRouter< E, V >::recomputeCosts().
|
private |
Invalidated assignment operator.
|
inlinevirtual |
Reimplemented from SUMOAbstractRouter< E, V >.
Definition at line 155 of file RailwayRouter.h.
References RailwayRouter< E, V >::ensureInternalRouter(), RailwayRouter< E, V >::myInternalRouter, and SUMOAbstractRouter< E, V >::prohibit().
|
inlineinherited |
Definition at line 258 of file SUMOAbstractRouter.h.
References SUMOAbstractRouter< E, V >::getEffort(), SUMOAbstractRouter< E, V >::recomputeCosts(), and STEPS2TIME.
|
inlineinherited |
Definition at line 237 of file SUMOAbstractRouter.h.
References SUMOAbstractRouter< E, V >::isProhibited(), STEPS2TIME, and SUMOAbstractRouter< E, V >::updateViaCost().
Referenced by RORouteDef::addAlternative(), AStarRouter< E, V >::compute(), MSDispatch::computeDetourTime(), SUMOAbstractRouter< E, V >::computeLooped(), ROMAAssignments::computePath(), MSDispatch::computePickupTime(), computeRoutes(), LIBSUMO_NAMESPACE::Simulation::findRoute(), NBPTLineCont::getCost(), LandmarkLookupTable< E, V >::LandmarkLookupTable(), MSTriggeredRerouter::notifyEnter(), SUMOAbstractRouter< E, V >::recomputeCosts(), MSVehicle::replaceStop(), MSBaseVehicle::reroute(), MSTriggeredRerouter::rerouteParkingArea(), MSVehicle::rerouteParkingArea(), and ROMAAssignments::sue().
|
inlinevirtualinherited |
reset internal caches, used by CHRouter
Reimplemented in CHRouter< E, V >.
Definition at line 139 of file SUMOAbstractRouter.h.
References UNUSED_PARAMETER.
Referenced by computeRoutes(), and ROMAAssignments::incremental().
|
inlineinherited |
Definition at line 288 of file SUMOAbstractRouter.h.
References SUMOAbstractRouter< E, V >::myAutoBulkMode.
Referenced by LandmarkLookupTable< E, V >::LandmarkLookupTable().
|
inlineinherited |
Definition at line 284 of file SUMOAbstractRouter.h.
References SUMOAbstractRouter< E, V >::myBulkMode.
Referenced by ROMAAssignments::incremental().
|
inlineinherited |
Definition at line 274 of file SUMOAbstractRouter.h.
References SysUtils::getCurrentMillis(), SUMOAbstractRouter< E, V >::myNumQueries, and SUMOAbstractRouter< E, V >::myQueryStartTime.
Referenced by AStarRouter< E, V >::compute(), CHRouter< E, V >::compute(), and DijkstraRouter< E, V >::compute().
|
inlineinherited |
Definition at line 221 of file SUMOAbstractRouter.h.
References SUMOAbstractRouter< E, V >::getEffort(), SUMOAbstractRouter< E, V >::getTravelTime(), and SUMOAbstractRouter< E, V >::updateViaEdgeCost().
Referenced by IntermodalRouter< E, L, N, V >::compute(), and SUMOAbstractRouter< E, V >::recomputeCosts().
|
inlineinherited |
Definition at line 211 of file SUMOAbstractRouter.h.
References SUMOAbstractRouter< E, V >::getEffort(), and SUMOAbstractRouter< E, V >::getTravelTime().
Referenced by AStarRouter< E, V >::compute(), DijkstraRouter< E, V >::compute(), and SUMOAbstractRouter< E, V >::updateViaCost().
|
protectedinherited |
whether we are currently trying to detect bulk mode automatically
Definition at line 306 of file SUMOAbstractRouter.h.
Referenced by DijkstraRouter< E, V >::clone(), DijkstraRouter< E, V >::compute(), and SUMOAbstractRouter< E, V >::setAutoBulkMode().
|
protectedinherited |
whether we are currently operating several route queries in a bulk
Definition at line 303 of file SUMOAbstractRouter.h.
Referenced by AStarRouter< E, V >::compute(), DijkstraRouter< E, V >::compute(), and SUMOAbstractRouter< E, V >::setBulkMode().
|
protectedinherited |
the handler for routing errors
Definition at line 294 of file SUMOAbstractRouter.h.
Referenced by AStarRouter< E, V >::clone(), CHRouter< E, V >::clone(), DijkstraRouter< E, V >::clone(), AStarRouter< E, V >::compute(), CHRouter< E, V >::compute(), DijkstraRouter< E, V >::compute(), SUMOAbstractRouter< E, V >::computeLooped(), and RailwayRouter< E, V >::ensureInternalRouter().
|
protectedinherited |
whether edge permissions need to be considered
Definition at line 309 of file SUMOAbstractRouter.h.
Referenced by AStarRouter< E, V >::clone(), CHRouter< E, V >::clone(), DijkstraRouter< E, V >::clone(), RailwayRouter< E, V >::ensureInternalRouter(), and SUMOAbstractRouter< E, V >::isProhibited().
|
protectedinherited |
whether edge restrictions need to be considered
Definition at line 312 of file SUMOAbstractRouter.h.
Referenced by AStarRouter< E, V >::clone(), CHRouter< E, V >::clone(), DijkstraRouter< E, V >::clone(), RailwayRouter< E, V >::ensureInternalRouter(), and SUMOAbstractRouter< E, V >::isProhibited().
|
private |
a RailEdge for every existing edge, filled on construction (but not in clones)
Definition at line 248 of file RailwayRouter.h.
Referenced by RailwayRouter< E, V >::getRailEdges(), and RailwayRouter< E, V >::RailwayRouter().
|
private |
Definition at line 245 of file RailwayRouter.h.
Referenced by RailwayRouter< E, V >::compute(), RailwayRouter< E, V >::ensureInternalRouter(), RailwayRouter< E, V >::prohibit(), and RailwayRouter< E, V >::~RailwayRouter().
|
private |
Definition at line 255 of file RailwayRouter.h.
Referenced by RailwayRouter< E, V >::compute(), and RailwayRouter< E, V >::getRailEdges().
|
privateinherited |
Definition at line 322 of file SUMOAbstractRouter.h.
Referenced by SUMOAbstractRouter< E, V >::startQuery(), and SUMOAbstractRouter< E, V >::~SUMOAbstractRouter().
|
protectedinherited |
The object's operation to perform.
Definition at line 297 of file SUMOAbstractRouter.h.
Referenced by AStarRouter< E, V >::clone(), CHRouter< E, V >::clone(), CHRouterWrapper< E, V >::clone(), DijkstraRouter< E, V >::clone(), and SUMOAbstractRouter< E, V >::getEffort().
|
private |
Definition at line 246 of file RailwayRouter.h.
Referenced by RailwayRouter< E, V >::getRailEdges().
|
protectedinherited |
Definition at line 314 of file SUMOAbstractRouter.h.
Referenced by AStarRouter< E, V >::prohibit(), and DijkstraRouter< E, V >::prohibit().
|
privateinherited |
the time spent querying in milliseconds
Definition at line 324 of file SUMOAbstractRouter.h.
Referenced by SUMOAbstractRouter< E, V >::endQuery(), and SUMOAbstractRouter< E, V >::startQuery().
|
privateinherited |
Definition at line 325 of file SUMOAbstractRouter.h.
Referenced by SUMOAbstractRouter< E, V >::endQuery(), and SUMOAbstractRouter< E, V >::~SUMOAbstractRouter().
|
privateinherited |
counters for performance logging
Definition at line 321 of file SUMOAbstractRouter.h.
Referenced by SUMOAbstractRouter< E, V >::endQuery(), and SUMOAbstractRouter< E, V >::~SUMOAbstractRouter().
|
private |
complete rail network filled on demand (but not in clones)
Definition at line 250 of file RailwayRouter.h.
Referenced by RailwayRouter< E, V >::getRailEdges().
|
staticprivate |
Definition at line 265 of file RailwayRouter.h.
Referenced by RailwayRouter< E, V >::getTravelTimeStatic().
|
staticprivate |
Definition at line 266 of file RailwayRouter.h.
Referenced by RailwayRouter< E, V >::getTravelTimeStatic().
|
private |
whether to suppress warning/error if no route was found
Definition at line 253 of file RailwayRouter.h.
Referenced by RailwayRouter< E, V >::ensureInternalRouter().
|
staticprivate |
The object's operation to perform. (hack)
Definition at line 263 of file RailwayRouter.h.
Referenced by RailwayRouter< E, V >::getTravelTimeStatic(), and RailwayRouter< E, V >::RailwayRouter().
|
protectedinherited |
The object's operation to perform for travel times.
Definition at line 300 of file SUMOAbstractRouter.h.
Referenced by DijkstraRouter< E, V >::clone(), and SUMOAbstractRouter< E, V >::getTravelTime().
|
privateinherited |
the type of this router
Definition at line 318 of file SUMOAbstractRouter.h.
Referenced by SUMOAbstractRouter< E, V >::getType(), and SUMOAbstractRouter< E, V >::~SUMOAbstractRouter().