LCOV - code coverage report
Current view: top level - src/router - ROEdge.h (source / functions) Coverage Total Hit
Test: lcov.info Lines: 92.2 % 77 71
Test Date: 2024-12-21 15:45:41 Functions: 87.5 % 16 14

            Line data    Source code
       1              : /****************************************************************************/
       2              : // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
       3              : // Copyright (C) 2002-2024 German Aerospace Center (DLR) and others.
       4              : // This program and the accompanying materials are made available under the
       5              : // terms of the Eclipse Public License 2.0 which is available at
       6              : // https://www.eclipse.org/legal/epl-2.0/
       7              : // This Source Code may also be made available under the following Secondary
       8              : // Licenses when the conditions for such availability set forth in the Eclipse
       9              : // Public License 2.0 are satisfied: GNU General Public License, version 2
      10              : // or later which is available at
      11              : // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
      12              : // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
      13              : /****************************************************************************/
      14              : /// @file    ROEdge.h
      15              : /// @author  Daniel Krajzewicz
      16              : /// @author  Jakob Erdmann
      17              : /// @author  Christian Roessel
      18              : /// @author  Michael Behrisch
      19              : /// @author  Melanie Knocke
      20              : /// @author  Yun-Pang Floetteroed
      21              : /// @author  Ruediger Ebendt
      22              : /// @date    Sept 2002
      23              : ///
      24              : // A basic edge for routing applications
      25              : /****************************************************************************/
      26              : #pragma once
      27              : #include <config.h>
      28              : 
      29              : #include <string>
      30              : #include <map>
      31              : #include <vector>
      32              : #include <algorithm>
      33              : #include <utils/common/Named.h>
      34              : #include <utils/common/StdDefs.h>
      35              : #include <utils/common/ValueTimeLine.h>
      36              : #include <utils/common/SUMOVehicleClass.h>
      37              : #include <utils/common/RandHelper.h>
      38              : #include <utils/emissions/PollutantsInterface.h>
      39              : #include <utils/geom/Boundary.h>
      40              : #ifdef HAVE_FOX
      41              : #include <utils/foxtools/fxheader.h>
      42              : #endif
      43              : #include <utils/vehicle/SUMOVTypeParameter.h>
      44              : #include "RONode.h"
      45              : #include "ROVehicle.h"
      46              : #include <utils/router/FlippedEdge.h>
      47              : 
      48              : 
      49              : // ===========================================================================
      50              : // class declarations
      51              : // ===========================================================================
      52              : class ROLane;
      53              : class ROEdge;
      54              : 
      55              : typedef std::vector<ROEdge*> ROEdgeVector;
      56              : typedef std::vector<const ROEdge*> ConstROEdgeVector;
      57              : typedef std::vector<std::pair<const ROEdge*, const ROEdge*> > ROConstEdgePairVector;
      58              : 
      59              : 
      60              : // ===========================================================================
      61              : // class definitions
      62              : // ===========================================================================
      63              : /**
      64              :  * @class ROEdge
      65              :  * @brief A basic edge for routing applications
      66              :  *
      67              :  * The edge contains two time lines, one for the travel time and one for a second
      68              :  *  measure which may be used for computing the costs of a route. After loading
      69              :  *  the weights, it is needed to call "buildTimeLines" in order to initialise
      70              :  *  these time lines.
      71              :  */
      72              : class ROEdge : public Named, public Parameterised {
      73              : public:
      74              :     /** @brief Constructor
      75              :      *
      76              :      * @param[in] id The id of the edge
      77              :      * @param[in] from The node the edge begins at
      78              :      * @param[in] to The node the edge ends at
      79              :      * @param[in] index The numeric id of the edge
      80              :      */
      81              :     ROEdge(const std::string& id, RONode* from, RONode* to, int index, const int priority);
      82              : 
      83              :     /** @brief Constructor for dummy edge, only used when building the connectivity graph **/
      84              :     ROEdge(const std::string& id, const RONode* from, const RONode* to, SVCPermissions p);
      85              : 
      86              : 
      87              :     /// Destructor
      88              :     virtual ~ROEdge();
      89              : 
      90              : 
      91              :     /// @name Set-up methods
      92              :     //@{
      93              : 
      94              :     /** @brief Adds a lane to the edge while loading
      95              :      *
      96              :      * The lane's length is adapted. Additionally, the information about allowed/disallowed
      97              :      *  vehicle classes is patched using the information stored in the lane.
      98              :      *
      99              :      * @param[in] lane The lane to add
     100              :      * @todo What about vehicle-type aware connections?
     101              :      */
     102              :     virtual void addLane(ROLane* lane);
     103              : 
     104              : 
     105              :     /** @brief Adds information about a connected edge
     106              :      *
     107              :      * The edge s is added to "myFollowingEdges" and this edge is added as predecessor to s.
     108              :      * @param[in] s The edge to add
     109              :      * @todo What about vehicle-type aware connections?
     110              :      */
     111              :     virtual void addSuccessor(ROEdge* s, ROEdge* via = nullptr, std::string dir = "");
     112              : 
     113              : 
     114              :     /** @brief Sets the function of the edge
     115              :     * @param[in] func The new function for the edge
     116              :     */
     117              :     inline void setFunction(SumoXMLEdgeFunc func) {
     118       478868 :         myFunction = func;
     119              :     }
     120              : 
     121              : 
     122              :     /** @brief Sets whether the edge is a source
     123              :     * @param[in] func The new source functionality for the edge
     124              :     */
     125              :     inline void setSource(const bool isSource = true) {
     126            0 :         myAmSource = isSource;
     127              :     }
     128              : 
     129              : 
     130              :     /** @brief Sets whether the edge is a sink
     131              :     * @param[in] func The new sink functionality for the edge
     132              :     */
     133              :     inline void setSink(const bool isSink = true) {
     134           64 :         myAmSink = isSink;
     135          266 :     }
     136              : 
     137              : 
     138              :     /** @brief Sets the vehicle class specific speed limits of the edge
     139              :      * @param[in] restrictions The restrictions for the edge
     140              :      */
     141              :     inline void setRestrictions(const std::map<SUMOVehicleClass, double>* restrictions) {
     142       451154 :         myRestrictions = restrictions;
     143              :     }
     144              : 
     145              :     inline void setTimePenalty(double value) {
     146       245143 :         myTimePenalty = value;
     147       245143 :     }
     148              : 
     149              :     inline double getTimePenalty() const {
     150       143123 :         return myTimePenalty;
     151              :     }
     152              : 
     153              :     /// @brief return whether this edge is a normal edge
     154              :     inline bool isNormal() const {
     155        31936 :         return myFunction == SumoXMLEdgeFunc::NORMAL;
     156              :     }
     157              : 
     158              :     /// @brief return whether this edge is an internal edge
     159              :     inline bool isInternal() const {
     160     12317901 :         return myFunction == SumoXMLEdgeFunc::INTERNAL;
     161              :     }
     162              : 
     163              :     /// @brief return whether this edge is a pedestrian crossing
     164              :     inline bool isCrossing() const {
     165      1971160 :         return myFunction == SumoXMLEdgeFunc::CROSSING;
     166              :     }
     167              : 
     168              :     /// @brief return whether this edge is walking area
     169              :     inline bool isWalkingArea() const {
     170      1468068 :         return myFunction == SumoXMLEdgeFunc::WALKINGAREA;
     171              :     }
     172              : 
     173              :     inline bool isTazConnector() const {
     174      3761775 :         return myFunction == SumoXMLEdgeFunc::CONNECTOR;
     175              :     }
     176              : 
     177              :     void setOtherTazConnector(const ROEdge* edge) {
     178        15083 :         myOtherTazConnector = edge;
     179              :     }
     180              : 
     181              :     const ROEdge* getOtherTazConnector() const {
     182        19024 :         return myOtherTazConnector;
     183              :     }
     184              : 
     185              :     /** @brief Builds the internal representation of the travel time/effort
     186              :      *
     187              :      * Should be called after weights / travel times have been loaded.
     188              :      *
     189              :      * In the case "weight-attribute" is one of "CO", "CO2", "HC", "NOx", "PMx", "fuel", or "electricity"
     190              :      *  the proper value (departs/s) is computed and multiplied with the travel time.
     191              :      *
     192              :      * @param[in] measure The name of the measure to use.
     193              :      */
     194              :     void buildTimeLines(const std::string& measure, const bool boundariesOverride);
     195              : 
     196              :     void cacheParamRestrictions(const std::vector<std::string>& restrictionKeys);
     197              :     //@}
     198              : 
     199              : 
     200              : 
     201              :     /// @name Getter methods
     202              :     //@{
     203              : 
     204              :     /** @brief Returns the function of the edge
     205              :     * @return This edge's basic function
     206              :     * @see SumoXMLEdgeFunc
     207              :     */
     208              :     inline SumoXMLEdgeFunc getFunction() const {
     209       377345 :         return myFunction;
     210              :     }
     211              : 
     212              : 
     213              :     /** @brief Returns whether the edge acts as a sink
     214              :     * @return whether the edge is a sink
     215              :     */
     216              :     inline bool isSink() const {
     217       330432 :         return myAmSink;
     218              :     }
     219              : 
     220              : 
     221              :     /** @brief Returns the length of the edge
     222              :      * @return This edge's length
     223              :      */
     224              :     double getLength() const {
     225      5943540 :         return myLength;
     226              :     }
     227              : 
     228              :     /** @brief Returns the index (numeric id) of the edge
     229              :      * @return This edge's numerical id
     230              :      */
     231              :     int getNumericalID() const {
     232     10868585 :         return myIndex;
     233              :     }
     234              : 
     235              : 
     236              :     /** @brief Returns the speed allowed on this edge
     237              :      * @return The speed allowed on this edge
     238              :      */
     239              :     double getSpeedLimit() const {
     240       317684 :         return mySpeed;
     241              :     }
     242              : 
     243              :     /// @brief return a lower bound on shape.length() / myLength that is
     244              :     // sufficient for the astar air-distance heuristic
     245              :     double getLengthGeometryFactor() const;
     246              : 
     247              :     /** @brief Returns the lane's maximum speed, given a vehicle's speed limit adaptation
     248              :      * @param[in] The vehicle to return the adapted speed limit for
     249              :      * @return This lane's resulting max. speed
     250              :      */
     251         1804 :     inline double getVClassMaxSpeed(SUMOVehicleClass vclass) const {
     252         1804 :         if (myRestrictions != 0) {
     253              :             std::map<SUMOVehicleClass, double>::const_iterator r = myRestrictions->find(vclass);
     254           18 :             if (r != myRestrictions->end()) {
     255            9 :                 return r->second;
     256              :             }
     257              :         }
     258         1795 :         return mySpeed;
     259              :     }
     260              : 
     261              : 
     262              :     /** @brief Returns the number of lanes this edge has
     263              :      * @return This edge's number of lanes
     264              :      */
     265              :     int getNumLanes() const {
     266       325354 :         return (int) myLanes.size();
     267              :     }
     268              : 
     269              : 
     270              :     /** @brief returns the information whether this edge is directly connected to the given
     271              :      *
     272              :      * @param[in] e The edge which may be connected
     273              :      * @param[in] vClass The vehicle class for which the connectivity is checked
     274              :      * @return Whether the given edge is a direct successor to this one
     275              :      */
     276              :     bool isConnectedTo(const ROEdge& e, const SUMOVehicleClass vClass) const;
     277              : 
     278              : 
     279              :     /** @brief Returns whether this edge prohibits the given vehicle to pass it
     280              :      * @param[in] vehicle The vehicle for which the information has to be returned
     281              :      * @return Whether the vehicle must not enter this edge
     282              :      */
     283              :     inline bool prohibits(const ROVehicle* const vehicle) const {
     284              :         const SUMOVehicleClass vclass = vehicle->getVClass();
     285      3903799 :         return (myCombinedPermissions & vclass) != vclass;
     286              :     }
     287              : 
     288              :     inline SVCPermissions getPermissions() const {
     289       135458 :         return myCombinedPermissions;
     290              :     }
     291              : 
     292              :     /** @brief Returns whether this edge has restriction parameters forbidding the given vehicle to pass it
     293              :      * @param[in] vehicle The vehicle for which the information has to be returned
     294              :      * @return Whether the vehicle must not enter this edge
     295              :      */
     296              :     inline bool restricts(const ROVehicle* const vehicle) const {
     297              :         const std::vector<double>& vTypeRestrictions = vehicle->getType()->paramRestrictions;
     298              :         assert(vTypeRestrictions.size() == myParamRestrictions.size());
     299          156 :         for (int i = 0; i < (int)vTypeRestrictions.size(); i++) {
     300           80 :             if (vTypeRestrictions[i] > myParamRestrictions[i]) {
     301              :                 return true;
     302              :             }
     303              :         }
     304              :         return false;
     305              :     }
     306              : 
     307              : 
     308              :     /** @brief Returns whether this edge succeeding edges prohibit the given vehicle to pass them
     309              :      * @param[in] vehicle The vehicle for which the information has to be returned
     310              :      * @return Whether the vehicle may continue its route on any of the following edges
     311              :      */
     312              :     bool allFollowersProhibit(const ROVehicle* const vehicle) const;
     313              :     //@}
     314              : 
     315              : 
     316              : 
     317              :     /// @name Methods for getting/setting travel time and cost information
     318              :     //@{
     319              : 
     320              :     /** @brief Adds a weight value
     321              :      *
     322              :      * @param[in] value The value to add
     323              :      * @param[in] timeBegin The begin time of the interval the given value is valid for [s]
     324              :      * @param[in] timeEnd The end time of the interval the given value is valid for [s]
     325              :      */
     326              :     void addEffort(double value, double timeBegin, double timeEnd);
     327              : 
     328              : 
     329              :     /** @brief Adds a travel time value
     330              :      *
     331              :      * @param[in] value The value to add
     332              :      * @param[in] timeBegin The begin time of the interval the given value is valid for [s]
     333              :      * @param[in] timeEnd The end time of the interval the given value is valid for [s]
     334              :      */
     335              :     void addTravelTime(double value, double timeBegin, double timeEnd);
     336              : 
     337              : 
     338              :     /** @brief Returns the number of edges this edge is connected to
     339              :      *
     340              :      * If this edge's type is set to "sink", 0 is returned, otherwise
     341              :      *  the number of edges stored in "myFollowingEdges".
     342              :      *
     343              :      * @return The number of edges following this edge
     344              :      */
     345              :     int getNumSuccessors() const;
     346              : 
     347              : 
     348              :     /** @brief Returns the following edges, restricted by vClass
     349              :     * @param[in] vClass The vClass for which to restrict the successors
     350              :     * @return The eligible following edges
     351              :     */
     352              :     const ROEdgeVector& getSuccessors(SUMOVehicleClass vClass = SVC_IGNORING) const;
     353              : 
     354              :     /** @brief Returns the following edges including vias, restricted by vClass
     355              :     * @param[in] vClass The vClass for which to restrict the successors
     356              :     * @return The eligible following edges
     357              :     */
     358              :     const ROConstEdgePairVector& getViaSuccessors(SUMOVehicleClass vClass = SVC_IGNORING, bool ignoreTransientPermissions = false) const;
     359              : 
     360              : 
     361              :     /** @brief Returns the number of edges connected to this edge
     362              :      *
     363              :      * If this edge's type is set to "source", 0 is returned, otherwise
     364              :      *  the number of edges stored in "myApproachingEdges".
     365              :      *
     366              :      * @return The number of edges reaching into this edge
     367              :      */
     368              :     int getNumPredecessors() const;
     369              : 
     370              : 
     371              :     /** @brief Returns the edge at the given position from the list of incoming edges
     372              :      * @param[in] pos The position of the list within the list of incoming
     373              :      * @return The incoming edge, stored at position pos
     374              :      */
     375              :     const ROEdgeVector& getPredecessors() const {
     376              :         return myApproachingEdges;
     377              :     }
     378              : 
     379              :     /// @brief if this edge is an internal edge, return its first normal predecessor, otherwise the edge itself
     380              :     const ROEdge* getNormalBefore() const;
     381              : 
     382              :     /// @brief if this edge is an internal edge, return its first normal successor, otherwise the edge itself
     383              :     const ROEdge* getNormalAfter() const;
     384              : 
     385              :     /** @brief Returns the effort for this edge
     386              :      *
     387              :      * @param[in] veh The vehicle for which the effort on this edge shall be retrieved
     388              :      * @param[in] time The tim for which the effort shall be returned [s]
     389              :      * @return The effort needed by the given vehicle to pass the edge at the given time
     390              :      * @todo Recheck whether the vehicle's maximum speed is considered
     391              :      */
     392              :     double getEffort(const ROVehicle* const veh, double time) const;
     393              : 
     394              : 
     395              :     /** @brief Returns whether a travel time for this edge was loaded
     396              :      *
     397              :      * @param[in] time The time for which the travel time shall be returned [s]
     398              :      * @return whether a value was loaded
     399              :      */
     400              :     bool hasLoadedTravelTime(double time) const;
     401              : 
     402              : 
     403              :     /** @brief Returns the travel time for this edge
     404              :      *
     405              :      * @param[in] veh The vehicle for which the travel time on this edge shall be retrieved
     406              :      * @param[in] time The time for which the travel time shall be returned [s]
     407              :      * @return The travel time needed by the given vehicle to pass the edge at the given time
     408              :      */
     409              :     double getTravelTime(const ROVehicle* const veh, double time) const;
     410              : 
     411              : 
     412              :     /** @brief Returns the effort for the given edge
     413              :      *
     414              :      * @param[in] edge The edge for which the effort shall be retrieved
     415              :      * @param[in] veh The vehicle for which the effort on this edge shall be retrieved
     416              :      * @param[in] time The time for which the effort shall be returned [s]
     417              :      * @return The effort needed by the given vehicle to pass the edge at the given time
     418              :      * @todo Recheck whether the vehicle's maximum speed is considered
     419              :      */
     420              :     static inline double getEffortStatic(const ROEdge* const edge, const ROVehicle* const veh, double time) {
     421              :         return edge->getEffort(veh, time);
     422              :     }
     423              : 
     424              : 
     425              :     /** @brief Returns the travel time for the given edge
     426              :      *
     427              :      * @param[in] edge The edge for which the travel time shall be retrieved
     428              :      * @param[in] veh The vehicle for which the travel time on this edge shall be retrieved
     429              :      * @param[in] time The time for which the travel time shall be returned [s]
     430              :      * @return The traveltime needed by the given vehicle to pass the edge at the given time
     431              :      */
     432      8780992 :     static inline double getTravelTimeStatic(const ROEdge* const edge, const ROVehicle* const veh, double time) {
     433      8783666 :         return edge->getTravelTime(veh, time);
     434              :     }
     435              : 
     436         5758 :     static inline double getTravelTimeStaticRandomized(const ROEdge* const edge, const ROVehicle* const veh, double time) {
     437         5758 :         return edge->getTravelTime(veh, time) * RandHelper::rand(1., gWeightsRandomFactor);
     438              :     }
     439              : 
     440              :     /// @brief Alias for getTravelTimeStatic (there is no routing device to provide aggregated travel times)
     441              :     static inline double getTravelTimeAggregated(const ROEdge* const edge, const ROVehicle* const veh, double time) {
     442            0 :         return edge->getTravelTime(veh, time);
     443              :     }
     444              : 
     445              :     /// @brief Return traveltime weighted by edge priority (scaled penalty for low-priority edges)
     446           25 :     static inline double getTravelTimeStaticPriorityFactor(const ROEdge* const edge, const ROVehicle* const veh, double time) {
     447           25 :         double result = edge->getTravelTime(veh, time);
     448              :         // lower priority should result in higher effort (and the edge with
     449              :         // minimum priority receives a factor of myPriorityFactor
     450           25 :         const double relativeInversePrio = 1 - ((edge->getPriority() - myMinEdgePriority) / myEdgePriorityRange);
     451           25 :         result *= 1 + relativeInversePrio * myPriorityFactor;
     452           25 :         return result;
     453              :     }
     454              : 
     455              :     /** @brief Returns a lower bound for the travel time on this edge without using any stored timeLine
     456              :      *
     457              :      * @param[in] veh The vehicle for which the effort on this edge shall be retrieved
     458              :      * @param[in] time The time for which the effort shall be returned [s]
     459              :      */
     460      4302071 :     inline double getMinimumTravelTime(const ROVehicle* const veh) const {
     461      4303835 :         if (isTazConnector()) {
     462              :             return 0;
     463      4225940 :         } else if (veh != 0) {
     464      8433567 :             return myLength / MIN2(veh->getType()->maxSpeed, veh->getChosenSpeedFactor() * mySpeed);
     465              :         } else {
     466         1760 :             return myLength / mySpeed;
     467              :         }
     468              :     }
     469              : 
     470              : 
     471              :     template<PollutantsInterface::EmissionType ET>
     472          252 :     static double getEmissionEffort(const ROEdge* const edge, const ROVehicle* const veh, double time) {
     473          252 :         double ret = 0;
     474          252 :         if (!edge->getStoredEffort(time, ret)) {
     475              :             const SUMOVTypeParameter* const type = veh->getType();
     476           80 :             const double vMax = MIN2(type->maxSpeed, edge->mySpeed);
     477           80 :             const double accel = type->getCFParam(SUMO_ATTR_ACCEL, SUMOVTypeParameter::getDefaultAccel(type->vehicleClass)) * type->getCFParam(SUMO_ATTR_SIGMA, SUMOVTypeParameter::getDefaultImperfection(type->vehicleClass)) / 2.;
     478           80 :             ret = PollutantsInterface::computeDefault(type->emissionClass, ET, vMax, accel, 0, edge->getTravelTime(veh, time), nullptr); // @todo: give correct slope
     479              :         }
     480          252 :         return ret;
     481              :     }
     482              : 
     483              : 
     484              :     static double getNoiseEffort(const ROEdge* const edge, const ROVehicle* const veh, double time);
     485              : 
     486         1404 :     static double getStoredEffort(const ROEdge* const edge, const ROVehicle* const /*veh*/, double time) {
     487         1404 :         double ret = 0;
     488         1404 :         edge->getStoredEffort(time, ret);
     489         1404 :         return ret;
     490              :     }
     491              :     //@}
     492              : 
     493              : 
     494              :     /// @brief optimistic distance heuristic for use in routing
     495              :     double getDistanceTo(const ROEdge* other, const bool doBoundaryEstimate = false) const;
     496              : 
     497              : 
     498              :     /** @brief Returns all ROEdges */
     499              :     static const ROEdgeVector& getAllEdges();
     500              : 
     501              :     static void setGlobalOptions(const bool interpolate) {
     502         9230 :         myInterpolate = interpolate;
     503              :     }
     504              : 
     505              :     static void disableTimelineWarning() {
     506          152 :         myHaveTTWarned = true;
     507          152 :     }
     508              : 
     509              :     /// @brief return the coordinates of the center of the given stop
     510              :     static const Position getStopPosition(const SUMOVehicleParameter::Stop& stop);
     511              : 
     512              :     /// @brief get edge priority (road class)
     513              :     int getPriority() const {
     514       321786 :         return myPriority;
     515              :     }
     516              : 
     517              :     const RONode* getFromJunction() const {
     518       504743 :         return myFromJunction;
     519              :     }
     520              : 
     521              :     const RONode* getToJunction() const {
     522       507801 :         return myToJunction;
     523              :     }
     524              : 
     525              :     /** @brief Returns this edge's lanes
     526              :      *
     527              :      * @return This edge's lanes
     528              :      */
     529              :     const std::vector<ROLane*>& getLanes() const {
     530              :         return myLanes;
     531              :     }
     532              : 
     533              :     /// @brief return opposite superposable/congruent edge, if it exist and 0 else
     534              :     inline const ROEdge* getBidiEdge() const {
     535         2940 :         return myBidiEdge;
     536              :     }
     537              : 
     538              :     /// @brief set opposite superposable/congruent edge
     539              :     inline void setBidiEdge(const ROEdge* bidiEdge) {
     540         6444 :         myBidiEdge = bidiEdge;
     541              :     }
     542              : 
     543        74312 :     ReversedEdge<ROEdge, ROVehicle>* getReversedRoutingEdge() const {
     544        74312 :         if (myReversedRoutingEdge == nullptr) {
     545        21248 :             myReversedRoutingEdge = new ReversedEdge<ROEdge, ROVehicle>(this);
     546              :         }
     547        74312 :         return myReversedRoutingEdge;
     548              :     }
     549              : 
     550              :     /// @brief Returns the flipped routing edge
     551              :     // @note If not called before, the flipped routing edge is created
     552            0 :     FlippedEdge<ROEdge, RONode, ROVehicle>* getFlippedRoutingEdge() const {
     553            0 :         if (myFlippedRoutingEdge == nullptr) {
     554            0 :             myFlippedRoutingEdge = new FlippedEdge<ROEdge, RONode, ROVehicle>(this);
     555              :         }
     556            0 :         return myFlippedRoutingEdge;
     557              :     }
     558              : 
     559        99242 :     RailEdge<ROEdge, ROVehicle>* getRailwayRoutingEdge() const {
     560        99242 :         if (myRailwayRoutingEdge == nullptr) {
     561        95972 :             myRailwayRoutingEdge = new RailEdge<ROEdge, ROVehicle>(this);
     562              :         }
     563        99242 :         return myRailwayRoutingEdge;
     564              :     }
     565              : 
     566              :     /// @brief whether effort data was loaded for this edge
     567              :     bool hasStoredEffort() const {
     568           35 :         return myUsingETimeLine;
     569              :     }
     570              : 
     571              :     /// @brief initialize priority factor range
     572              :     static bool initPriorityFactor(double priorityFactor);
     573              : 
     574              : protected:
     575              :     /** @brief Retrieves the stored effort
     576              :      *
     577              :      * @param[in] veh The vehicle for which the effort on this edge shall be retrieved
     578              :      * @param[in] time The tim for which the effort shall be returned
     579              :      * @return Whether the effort is given
     580              :      */
     581              :     bool getStoredEffort(double time, double& ret) const;
     582              : 
     583              : 
     584              : 
     585              : protected:
     586              :     /// @brief the junctions for this edge
     587              :     RONode* myFromJunction;
     588              :     RONode* myToJunction;
     589              : 
     590              :     /// @brief The index (numeric id) of the edge
     591              :     const int myIndex;
     592              : 
     593              :     /// @brief The edge priority (road class)
     594              :     const int myPriority;
     595              : 
     596              :     /// @brief The maximum speed allowed on this edge
     597              :     double mySpeed;
     598              : 
     599              :     /// @brief The length of the edge
     600              :     double myLength;
     601              : 
     602              :     /// @brief whether the edge is a source or a sink
     603              :     bool myAmSink, myAmSource;
     604              :     /// @brief Container storing passing time varying over time for the edge
     605              :     mutable ValueTimeLine<double> myTravelTimes;
     606              :     /// @brief Information whether the time line shall be used instead of the length value
     607              :     bool myUsingTTTimeLine;
     608              : 
     609              :     /// @brief Container storing passing time varying over time for the edge
     610              :     mutable ValueTimeLine<double> myEfforts;
     611              :     /// @brief Information whether the time line shall be used instead of the length value
     612              :     bool myUsingETimeLine;
     613              : 
     614              :     /// @brief Information whether to interpolate at interval boundaries
     615              :     static bool myInterpolate;
     616              : 
     617              :     /// @brief Information whether the edge has reported missing weights
     618              :     static bool myHaveEWarned;
     619              :     /// @brief Information whether the edge has reported missing weights
     620              :     static bool myHaveTTWarned;
     621              : 
     622              :     /// @brief List of edges that may be approached from this edge
     623              :     ROEdgeVector myFollowingEdges;
     624              : 
     625              :     ROConstEdgePairVector myFollowingViaEdges;
     626              : 
     627              :     /// @brief List of edges that approached this edge
     628              :     ROEdgeVector myApproachingEdges;
     629              : 
     630              :     /// @brief The function of the edge
     631              :     SumoXMLEdgeFunc myFunction;
     632              : 
     633              :     /// The vClass speed restrictions for this edge
     634              :     const std::map<SUMOVehicleClass, double>* myRestrictions;
     635              : 
     636              :     /// @brief This edge's lanes
     637              :     std::vector<ROLane*> myLanes;
     638              : 
     639              :     /// @brief The list of allowed vehicle classes combined across lanes
     640              :     SVCPermissions myCombinedPermissions;
     641              : 
     642              :     /// @brief the other taz-connector if this edge isTazConnector, otherwise nullptr
     643              :     const ROEdge* myOtherTazConnector;
     644              : 
     645              :     /// @brief the bidirectional rail edge or nullpr
     646              :     const ROEdge* myBidiEdge;
     647              : 
     648              :     /// @brief The bounding rectangle of end nodes incoming or outgoing edges for taz connectors or of my own start and end node for normal edges
     649              :     Boundary myBoundary;
     650              : 
     651              :     /// @brief flat penalty when computing traveltime
     652              :     double myTimePenalty;
     653              : 
     654              :     /// @brief cached value of parameters which may restrict access
     655              :     std::vector<double> myParamRestrictions;
     656              : 
     657              :     static ROEdgeVector myEdges;
     658              : 
     659              :     /// @brief Coefficient for factoring edge priority into routing weight
     660              :     static double myPriorityFactor;
     661              :     /// @brief Minimum priority for all edges
     662              :     static double myMinEdgePriority;
     663              :     /// @brief the difference between maximum and minimum priority for all edges
     664              :     static double myEdgePriorityRange;
     665              : 
     666              :     /// @brief The successors available for a given vClass
     667              :     mutable std::map<SUMOVehicleClass, ROEdgeVector> myClassesSuccessorMap;
     668              : 
     669              :     /// @brief The successors with vias available for a given vClass
     670              :     mutable std::map<SUMOVehicleClass, ROConstEdgePairVector> myClassesViaSuccessorMap;
     671              : 
     672              :     /// @brief a reversed version for backward routing
     673              :     mutable ReversedEdge<ROEdge, ROVehicle>* myReversedRoutingEdge = nullptr;
     674              :     /// @brief An extended version of the reversed edge for backward routing (used for the arc flag router)
     675              :     mutable FlippedEdge<ROEdge, RONode, ROVehicle>* myFlippedRoutingEdge = nullptr;
     676              :     mutable RailEdge<ROEdge, ROVehicle>* myRailwayRoutingEdge = nullptr;
     677              : 
     678              : #ifdef HAVE_FOX
     679              :     /// The mutex used to avoid concurrent updates of myClassesSuccessorMap
     680              :     mutable FXMutex myLock;
     681              : #endif
     682              : 
     683              : private:
     684              :     /// @brief Invalidated copy constructor
     685              :     ROEdge(const ROEdge& src);
     686              : 
     687              :     /// @brief Invalidated assignment operator
     688              :     ROEdge& operator=(const ROEdge& src);
     689              : 
     690              : };
        

Generated by: LCOV version 2.0-1