LCOV - code coverage report
Current view: top level - src/router - ROEdge.h (source / functions) Hit Total Coverage
Test: lcov.info Lines: 71 73 97.3 %
Date: 2024-05-08 15:29:52 Functions: 14 15 93.3 %

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

Generated by: LCOV version 1.14