LCOV - code coverage report
Current view: top level - src/router - RONet.h (source / functions) Coverage Total Hit
Test: lcov.info Lines: 100.0 % 21 21
Test Date: 2026-03-26 16:31:35 Functions: 100.0 % 5 5

            Line data    Source code
       1              : /****************************************************************************/
       2              : // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
       3              : // Copyright (C) 2002-2026 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    RONet.h
      15              : /// @author  Daniel Krajzewicz
      16              : /// @author  Michael Behrisch
      17              : /// @author  Jakob Erdmann
      18              : /// @author  Yun-Pang Floetteroed
      19              : /// @date    Sept 2002
      20              : ///
      21              : // The router's network representation
      22              : /****************************************************************************/
      23              : #pragma once
      24              : #include <config.h>
      25              : 
      26              : #include <vector>
      27              : #include <utils/common/MsgHandler.h>
      28              : #include <utils/common/NamedObjectCont.h>
      29              : #include <utils/distribution/RandomDistributor.h>
      30              : #include <utils/vehicle/SUMOVehicleParameter.h>
      31              : #include <utils/vehicle/SUMOVTypeParameter.h>
      32              : #include "ROLane.h"
      33              : #include "RORoutable.h"
      34              : #include "RORouteDef.h"
      35              : 
      36              : #ifdef HAVE_FOX
      37              : #include <utils/foxtools/MFXWorkerThread.h>
      38              : #endif
      39              : 
      40              : 
      41              : // ===========================================================================
      42              : // class declarations
      43              : // ===========================================================================
      44              : class ROEdge;
      45              : class RONode;
      46              : class ROPerson;
      47              : class ROVehicle;
      48              : class ROAbstractEdgeBuilder;
      49              : class OptionsCont;
      50              : class OutputDevice;
      51              : 
      52              : typedef MapMatcher<ROEdge, ROLane, RONode> ROMapMatcher;
      53              : 
      54              : // ===========================================================================
      55              : // class definitions
      56              : // ===========================================================================
      57              : /**
      58              :  * @class RONet
      59              :  * @brief The router's network representation.
      60              :  *
      61              :  * A router network is responsible for watching loaded edges, nodes,!!!
      62              :  */
      63              : class RONet {
      64              : public:
      65              : 
      66              :     typedef std::map<const SUMOTime, std::vector<RORoutable*> > RoutablesMap;
      67              :     typedef std::map<const ROEdge*, RouterProhibition> Prohibitions;
      68              :     typedef std::map<const ROLane*, RouterProhibition> LaneProhibitions;
      69              : 
      70              :     /// @brief Constructor
      71              :     RONet();
      72              : 
      73              : 
      74              :     /** @brief Returns the pointer to the unique instance of RONet (singleton).
      75              :      * @return Pointer to the unique RONet-instance
      76              :      */
      77              :     static RONet* getInstance();
      78              : 
      79              : 
      80              :     /// @brief Destructor
      81              :     virtual ~RONet();
      82              : 
      83              : 
      84              :     /** @brief Adds a restriction for an edge type
      85              :      * @param[in] id The id of the type
      86              :      * @param[in] svc The vehicle class the restriction refers to
      87              :      * @param[in] speed The restricted speed
      88              :      */
      89              :     void addSpeedRestriction(const std::string& id, const SUMOVehicleClass svc, const double speed);
      90              : 
      91              : 
      92              :     /** @brief Returns the restrictions for an edge type
      93              :      * If no restrictions are present, 0 is returned.
      94              :      * @param[in] id The id of the type
      95              :      * @return The mapping of vehicle classes to maximum speeds
      96              :      */
      97              :     const std::map<SUMOVehicleClass, double>* getRestrictions(const std::string& id) const;
      98              : 
      99              :     bool hasSpeedRestrictions() const {
     100              :         return !mySpeedRestrictions.empty();
     101              :     }
     102              : 
     103              :     bool hasParamRestrictions() const {
     104       830288 :         return myHaveParamRestrictions;
     105              :     }
     106              : 
     107              :     void setParamRestrictions() {
     108           34 :         myHaveParamRestrictions = true;
     109              :     }
     110              : 
     111              :     /// @brief retriefe edge type specific routing preference
     112              :     double getPreference(const std::string& routingType, const SUMOVTypeParameter& pars) const;
     113              : 
     114              :     /// @brief add edge type specific routing preference
     115              :     void addPreference(const std::string& routingType, SUMOVehicleClass svc, double prio);
     116              :     /// @brief add edge type specific routing preference
     117              :     void addPreference(const std::string& routingType, std::string vType, double prio);
     118              : 
     119              :     /// @name Insertion and retrieval of graph parts
     120              :     //@{
     121              : 
     122              :     /* @brief Adds a read edge to the network
     123              :      *
     124              :      * If the edge is already known (another one with the same id exists),
     125              :      *  an error is generated and given to msg-error-handler. The edge
     126              :      *  is deleted in this case and false is returned.
     127              :      *
     128              :      * @param[in] edge The edge to add
     129              :      * @return Whether the edge was added (if not, it was deleted, too)
     130              :      */
     131              :     virtual bool addEdge(ROEdge* edge);
     132              : 
     133              : 
     134              :     /* @brief Adds a district and connecting edges to the network
     135              :      *
     136              :      * If the district is already known (another one with the same id exists),
     137              :      *  an error is generated and given to msg-error-handler. The edges
     138              :      *  are deleted in this case and false is returned.
     139              :      *
     140              :      * @param[in] id The district to add
     141              :      * @return Whether the district was added
     142              :      */
     143              :     bool addDistrict(const std::string id, ROEdge* source, ROEdge* sink);
     144              : 
     145              : 
     146              :     /* @brief Adds a district and connecting edges to the network
     147              :      *
     148              :      * If the district is already known (another one with the same id exists),
     149              :      *  an error is generated and given to msg-error-handler. The edges
     150              :      *  are deleted in this case and false is returned.
     151              :      *
     152              :      * @param[in] id The district to add
     153              :      * @return Whether the district was added
     154              :      */
     155              :     bool addDistrictEdge(const std::string tazID, const std::string edgeID, const bool isSource);
     156              : 
     157              :     /// @brief add a taz for every junction unless a taz with the same id already exists
     158              :     void addJunctionTaz(ROAbstractEdgeBuilder& eb);
     159              : 
     160              :     /// @brief add a taz for every junction unless a taz with the same id already exists
     161              :     void setBidiEdges(const std::map<ROEdge*, std::string>& bidiMap);
     162              : 
     163              :     /** @brief Retrieves all TAZ (districts) from the network
     164              :      *
     165              :      * @return The map of all districts
     166              :      */
     167              :     const std::map<std::string, std::pair<std::vector<std::string>, std::vector<std::string> > >& getDistricts() const {
     168          104 :         return myDistricts;
     169              :     }
     170              : 
     171              :     /** @brief Retrieves an edge from the network
     172              :      *
     173              :      * This is not very pretty, but necessary, though, as routes run
     174              :      *  over instances, not over ids.
     175              :      *
     176              :      * @param[in] name The name of the edge to retrieve
     177              :      * @return The named edge if known, otherwise 0
     178              :      */
     179              :     ROEdge* getEdge(const std::string& name) const {
     180              :         return myEdges.get(name);
     181              :     }
     182              : 
     183              : 
     184              :     /** @brief Retrieves an edge from the network when the lane id is given
     185              :      *
     186              :      * @param[in] laneID The name of the lane to retrieve the edge for
     187              :      * @return The edge of the named lane if known, otherwise 0
     188              :      */
     189              :     ROEdge* getEdgeForLaneID(const std::string& laneID) const;
     190              : 
     191              :     /** @brief Retrieves a lane rom the network given its id
     192              :      *
     193              :      * @param[in] laneID The name of the lane to retrieve the edge for
     194              :      * @return The lane object
     195              :      */
     196              :     ROLane* getLane(const std::string& laneID) const;
     197              : 
     198              :     /* @brief Adds a read node to the network
     199              :      *
     200              :      * If the node is already known (another one with the same id exists),
     201              :      *  an error is generated and given to msg-error-handler. The node
     202              :      *  is deleted in this case
     203              :      *
     204              :      * @param[in] node The node to add
     205              :      */
     206              :     void addNode(RONode* node);
     207              : 
     208              : 
     209              :     /** @brief Retrieves an node from the network
     210              :      *
     211              :      * @param[in] name The name of the node to retrieve
     212              :      * @return The named node if known, otherwise 0
     213              :      * @todo Check whether a const pointer may be returned
     214              :      */
     215              :     RONode* getNode(const std::string& id) const {
     216              :         return myNodes.get(id);
     217              :     }
     218              : 
     219              : 
     220              :     /* @brief Adds a read stopping place (bus, train, container, parking)  to the network
     221              :      *
     222              :      * If the place is already known (another one with the same id and category exists),
     223              :      *  an error is generated and given to msg-error-handler. The stop
     224              :      *  is deleted in this case
     225              :      *
     226              :      * @param[in] id The name of the stop to add
     227              :      * @param[in] category The type of stop
     228              :      * @param[in] stop The detailed stop description
     229              :      */
     230              :     void addStoppingPlace(const std::string& id, const SumoXMLTag category, SUMOVehicleParameter::Stop* stop);
     231              : 
     232              :     /** @brief Retrieves a stopping place from the network
     233              :      *
     234              :      * @param[in] id The name of the stop to retrieve
     235              :      * @param[in] category The type of stop
     236              :      * @return The named stop if known, otherwise 0
     237              :      */
     238         2873 :     const SUMOVehicleParameter::Stop* getStoppingPlace(const std::string& id, const SumoXMLTag category) const {
     239              :         if (myStoppingPlaces.count(category) > 0) {
     240              :             return myStoppingPlaces.find(category)->second.get(id);
     241              :         }
     242              :         return 0;
     243              :     }
     244              : 
     245              :     /// @brief return the name for the given stopping place id
     246              :     const std::string getStoppingPlaceName(const std::string& id) const;
     247              : 
     248              :     /// @brief return the element name for the given stopping place id
     249              :     const std::string getStoppingPlaceElement(const std::string& id) const;
     250              :     //@}
     251              : 
     252              : 
     253              : 
     254              :     /// @name Insertion and retrieval of vehicle types, vehicles, routes, and route definitions
     255              :     //@{
     256              : 
     257              :     /** @brief Checks whether the vehicle type (distribution) may be added
     258              :      *
     259              :      * This method checks also whether the default type may still be replaced
     260              :      * @param[in] id The id of the vehicle type (distribution) to add
     261              :      * @return Whether the type (distribution) may be added
     262              :      */
     263              :     bool checkVType(const std::string& id);
     264              : 
     265              : 
     266              :     /** @brief Adds a read vehicle type definition to the network
     267              :      *
     268              :      * If the vehicle type definition is already known (another one with
     269              :      *  the same id exists), false is returned, and the vehicle type
     270              :      *  is deleted.
     271              :      *
     272              :      * @param[in] def The vehicle type to add
     273              :      * @return Whether the vehicle type could be added
     274              :      */
     275              :     virtual bool addVehicleType(SUMOVTypeParameter* type);
     276              : 
     277              : 
     278              :     /** @brief Adds a vehicle type distribution
     279              :      *
     280              :      * If another vehicle type (or distribution) with the same id exists, false is returned.
     281              :      *  Otherwise, the vehicle type distribution is added to the internal vehicle type distribution
     282              :      *  container "myVTypeDistDict".
     283              :      *
     284              :      * This control get responsible for deletion of the added vehicle
     285              :      *  type distribution.
     286              :      *
     287              :      * @param[in] id The id of the distribution to add
     288              :      * @param[in] vehTypeDistribution The vehicle type distribution to add
     289              :      * @return Whether the vehicle type could be added
     290              :      */
     291              :     bool addVTypeDistribution(const std::string& id, RandomDistributor<SUMOVTypeParameter*>* vehTypeDistribution);
     292              : 
     293              : 
     294              :     /** @brief Retrieves the named vehicle type distribution
     295              :      *
     296              :      * If the named vehicle type distribution was not added to the net before
     297              :      * nullptr is returned
     298              :      *
     299              :      * @param[in] id The id of the vehicle type distribution to return
     300              :      * @return The named vehicle type distribution
     301              :      */
     302              :     const RandomDistributor<SUMOVTypeParameter*>* getVTypeDistribution(const std::string& id) {
     303              :         const auto it = myVTypeDistDict.find(id);
     304       192359 :         return it != myVTypeDistDict.end() ? it ->second : nullptr;
     305              :     }
     306              : 
     307              : 
     308              :     /** @brief Retrieves the named vehicle type
     309              :      *
     310              :      * If the name is "" the default type is returned.
     311              :      * If the named vehicle type (or typeDistribution) was not added to the net before
     312              :      * nullptr is returned
     313              :      *
     314              :      * @param[in] id The id of the vehicle type to return
     315              :      * @return The named vehicle type
     316              :      */
     317              :     SUMOVTypeParameter* getVehicleTypeSecure(const std::string& id);
     318              : 
     319              : 
     320              :     /* @brief Adds a route definition to the network
     321              :      *
     322              :      * If the route definition is already known (another one with
     323              :      *  the same id exists), false is returned, but the route definition
     324              :      *  is not deleted.
     325              :      *
     326              :      * @param[in] def The route definition to add
     327              :      * @return Whether the route definition could be added
     328              :      * @todo Rename myRoutes to myRouteDefinitions
     329              :      */
     330              :     bool addRouteDef(RORouteDef* def);
     331              : 
     332              : 
     333              :     /** @brief Returns the named route definition
     334              :      *
     335              :      * @param[in] name The name of the route definition to retrieve
     336              :      * @return The named route definition if known, otherwise 0
     337              :      * @todo Check whether a const pointer may be returned
     338              :      * @todo Rename myRoutes to myRouteDefinitions
     339              :      */
     340              :     RORouteDef* getRouteDef(const std::string& name) const {
     341              :         return myRoutes.get(name);
     342              :     }
     343              : 
     344              : 
     345              :     /* @brief Adds a vehicle to the network
     346              :      *
     347              :      * If the vehicle is already known (another one with the same id
     348              :      *  exists), false is returned, but the vehicle is not deleted.
     349              :      *
     350              :      * Otherwise, the number of loaded routes ("myReadRouteNo") is increased.
     351              :      *
     352              :      * @param[in] id The id of the vehicle to add
     353              :      * @param[in] veh The vehicle to add
     354              :      * @return Whether the vehicle could be added
     355              :      */
     356              :     virtual bool addVehicle(const std::string& id, ROVehicle* veh);
     357              : 
     358              :     /// @brief returns whether a vehicle with the given id was already loaded
     359              :     bool knowsVehicle(const std::string& id) const;
     360              : 
     361              :     /// @brief returns departure time for the given vehicle id
     362              :     SUMOTime getDeparture(const std::string& vehID) const;
     363              : 
     364              :     /* @brief Adds a flow of vehicles to the network
     365              :      *
     366              :      * If the flow is already known (another one with the same id
     367              :      *  exists), false is returned, but the vehicle parameter are not deleted.
     368              :      *
     369              :      * Otherwise, the number of loaded routes ("myReadRouteNo") is increased.
     370              :      *
     371              :      * @param[in] flow The parameter of the flow to add
     372              :      * @return Whether the flow could be added
     373              :      */
     374              :     bool addFlow(SUMOVehicleParameter* flow, const bool randomize);
     375              : 
     376              : 
     377              :     /* @brief Adds a person to the network
     378              :      *
     379              :      * @param[in] person   The person to add
     380              :      */
     381              :     bool addPerson(ROPerson* person);
     382              : 
     383              : 
     384              :     /* @brief Adds a container to the network
     385              :      *
     386              :      * @param[in] depart The departure time of the container
     387              :      * @param[in] desc   The xml description of the container
     388              :      */
     389              :     void addContainer(const SUMOTime depart, const std::string desc);
     390              :     // @}
     391              : 
     392              : 
     393              :     /// @name Processing stored vehicle definitions
     394              :     //@{
     395              : 
     396              :     /** @brief Computes routes described by their definitions and saves them
     397              :      *
     398              :      * As long as a vehicle with a departure time smaller than the given
     399              :      *  exists, its route is computed and it is written and removed from
     400              :      *  the internal container.
     401              :      *
     402              :      * @param[in] options The options used during this process
     403              :      * @param[in] provider The router provider for routes computation
     404              :      * @param[in] time The time until which route definitions shall be processed
     405              :      * @return The last seen departure time>=time
     406              :      */
     407              :     SUMOTime saveAndRemoveRoutesUntil(OptionsCont& options,
     408              :                                       const RORouterProvider& provider, SUMOTime time);
     409              : 
     410              : 
     411              :     /// Returns the information whether further vehicles, persons or containers are stored
     412              :     bool furtherStored();
     413              :     //@}
     414              : 
     415              : 
     416              :     /** @brief Opens the output for computed routes
     417              :      *
     418              :      * If one of the file outputs can not be build, an IOError is thrown.
     419              :      *
     420              :      * @param[in] options The options to be asked for "output-file", "alternatives-output" and "vtype-output"
     421              :      */
     422              :     void openOutput(const OptionsCont& options);
     423              : 
     424              : 
     425              :     /** @brief Writes the intermodal network and weights if requested
     426              :      *
     427              :      * If one of the file outputs can not be build, an IOError is thrown.
     428              :      *
     429              :      * @param[in] options The options to be asked for "intermodal-network-output" and "intermodal-weight-output"
     430              :      */
     431              :     void writeIntermodal(const OptionsCont& options, ROIntermodalRouter& router) const;
     432              : 
     433              : 
     434              :     /** @brief closes the file output for computed routes and deletes associated threads if necessary */
     435              :     void cleanup();
     436              : 
     437              : 
     438              :     /// Returns the total number of edges the network contains including internal edges
     439              :     int getEdgeNumber() const;
     440              : 
     441              :     /// Returns the number of internal edges the network contains
     442              :     int getInternalEdgeNumber() const;
     443              : 
     444              :     const NamedObjectCont<ROEdge*>& getEdgeMap() const {
     445              :         return myEdges;
     446              :     }
     447              : 
     448              :     static void adaptIntermodalRouter(ROIntermodalRouter& router);
     449              : 
     450              :     bool hasPermissions() const;
     451              : 
     452              :     void setPermissionsFound();
     453              : 
     454              :     /// @brief return whether the network contains bidirectional rail edges
     455              :     bool hasBidiEdges() const {
     456         2713 :         return myHasBidiEdges;
     457              :     }
     458              : 
     459              :     /// @brief whether efforts were loaded from file
     460              :     bool hasLoadedEffort() const;
     461              : 
     462              :     double getMaxTraveltime() const {
     463       281030 :         return myMaxTraveltime;
     464              :     }
     465              : 
     466              :     bool hasProhibitions() const {
     467       295798 :         return !myProhibitions.empty() || !myLaneProhibitions.empty();
     468              :     }
     469              : 
     470              :     const Prohibitions& getProhibitions() const {
     471            2 :         return myProhibitions;
     472              :     }
     473              : 
     474              :     void updateLaneProhibitions(SUMOTime begin);
     475              : 
     476              :     void addProhibition(const ROEdge* edge, const RouterProhibition& prohibition);
     477              :     void addLaneProhibition(const ROLane* lane, const RouterProhibition& prohibition);
     478              : 
     479              :     OutputDevice* getRouteOutput(const bool alternative = false) {
     480              :         if (alternative) {
     481              :             return myRouteAlternativesOutput;
     482              :         }
     483           73 :         return myRoutesOutput;
     484              :     }
     485              : 
     486              : #ifdef HAVE_FOX
     487              :     MFXWorkerThread::Pool& getThreadPool() {
     488          163 :         return myThreadPool;
     489              :     }
     490              : 
     491              :     class WorkerThread : public MFXWorkerThread, public RORouterProvider {
     492              :     public:
     493           53 :         WorkerThread(MFXWorkerThread::Pool& pool,
     494              :                      const RORouterProvider& original)
     495           53 :             : MFXWorkerThread(pool), RORouterProvider(original) {}
     496          106 :         virtual ~WorkerThread() {
     497           53 :             stop();
     498          106 :         }
     499              :     };
     500              : 
     501              :     class BulkmodeTask : public MFXWorkerThread::Task {
     502              :     public:
     503           84 :         BulkmodeTask(const bool value) : myValue(value) {}
     504           84 :         void run(MFXWorkerThread* context) {
     505           84 :             static_cast<WorkerThread*>(context)->setBulkMode(myValue);
     506           84 :         }
     507              :     private:
     508              :         const bool myValue;
     509              :     private:
     510              :         /// @brief Invalidated assignment operator.
     511              :         BulkmodeTask& operator=(const BulkmodeTask&);
     512              :     };
     513              : #endif
     514              : 
     515              : 
     516              : private:
     517              :     void checkFlows(SUMOTime time, MsgHandler* errorHandler);
     518              : 
     519              :     void createBulkRouteRequests(const RORouterProvider& provider, const SUMOTime time, const bool removeLoops);
     520              : 
     521              : private:
     522              :     /// @brief Unique instance of RONet
     523              :     static RONet* myInstance;
     524              : 
     525              :     /// @brief Known vehicle ids and their departure
     526              :     std::map<std::string, SUMOTime> myVehIDs;
     527              : 
     528              :     /// @brief Known person ids
     529              :     std::set<std::string> myPersonIDs;
     530              : 
     531              :     /// @brief Known nodes
     532              :     NamedObjectCont<RONode*> myNodes;
     533              : 
     534              :     /// @brief Known edges
     535              :     NamedObjectCont<ROEdge*> myEdges;
     536              : 
     537              :     /// @brief Known bus / train / container stops and parking areas
     538              :     std::map<SumoXMLTag, NamedObjectCont<SUMOVehicleParameter::Stop*> > myStoppingPlaces;
     539              : 
     540              :     /// @brief Known vehicle types
     541              :     NamedObjectCont<SUMOVTypeParameter*> myVehicleTypes;
     542              : 
     543              :     /// @brief Vehicle type distribution dictionary type
     544              :     typedef std::map< std::string, RandomDistributor<SUMOVTypeParameter*>* > VTypeDistDictType;
     545              :     /// @brief A distribution of vehicle types (probability->vehicle type)
     546              :     VTypeDistDictType myVTypeDistDict;
     547              : 
     548              :     /// @brief Whether the default vehicle type was already used or can still be replaced
     549              :     bool myDefaultVTypeMayBeDeleted;
     550              : 
     551              :     /// @brief Whether the default pedestrian type was already used or can still be replaced
     552              :     bool myDefaultPedTypeMayBeDeleted;
     553              : 
     554              :     /// @brief Whether the default bicycle type was already used or can still be replaced
     555              :     bool myDefaultBikeTypeMayBeDeleted;
     556              : 
     557              :     /// @brief Whether the default taxi type was already used or can still be replaced
     558              :     bool myDefaultTaxiTypeMayBeDeleted;
     559              : 
     560              :     /// @brief Whether the default rail type was already used or can still be replaced
     561              :     bool myDefaultRailTypeMayBeDeleted;
     562              : 
     563              :     /// @brief Known routes
     564              :     NamedObjectCont<RORouteDef*> myRoutes;
     565              : 
     566              :     /// @brief Known routables
     567              :     RoutablesMap myRoutables;
     568              : 
     569              :     /// @brief Known flows
     570              :     NamedObjectCont<SUMOVehicleParameter*> myFlows;
     571              : 
     572              :     /// @brief whether any flows are still active
     573              :     bool myHaveActiveFlows;
     574              : 
     575              :     /// @brief Known containers
     576              :     typedef std::multimap<const SUMOTime, const std::string> ContainerMap;
     577              :     ContainerMap myContainers;
     578              : 
     579              :     /// @brief vehicles to keep for public transport routing
     580              :     std::vector<const RORoutable*> myPTVehicles;
     581              : 
     582              :     /// @brief Departure times for randomized flows
     583              :     std::map<std::string, std::vector<SUMOTime> > myDepartures;
     584              : 
     585              :     /// @brief traffic assignment zones with sources and sinks
     586              :     std::map<std::string, std::pair<std::vector<std::string>, std::vector<std::string> > > myDistricts;
     587              : 
     588              :     /// @brief The file to write the computed routes into
     589              :     OutputDevice* myRoutesOutput;
     590              : 
     591              :     /// @brief The file to write the computed route alternatives into
     592              :     OutputDevice* myRouteAlternativesOutput;
     593              : 
     594              :     /// @brief The file to write the vehicle types into
     595              :     OutputDevice* myTypesOutput;
     596              : 
     597              :     /// @brief The number of read routes
     598              :     int myReadRouteNo;
     599              : 
     600              :     /// @brief The number of discarded routes
     601              :     int myDiscardedRouteNo;
     602              : 
     603              :     /// @brief The number of written routes
     604              :     int myWrittenRouteNo;
     605              : 
     606              :     /// @brief Whether the network contains edges which not all vehicles may pass
     607              :     bool myHavePermissions;
     608              : 
     609              :     /// @brief The vehicle class specific speed restrictions
     610              :     std::map<std::string, std::map<SUMOVehicleClass, double> > mySpeedRestrictions;
     611              : 
     612              :     /// @brief whether parameter-based access restrictions are configured
     613              :     bool myHaveParamRestrictions;
     614              : 
     615              :     /// @brief Preferences for routing
     616              :     std::map<SUMOVehicleClass, std::map<std::string, double> > myVClassPreferences;
     617              :     std::map<std::string, std::map<std::string, double> > myVTypePreferences;
     618              : 
     619              :     /// @brief The number of internal edges in the dictionary
     620              :     int myNumInternalEdges;
     621              : 
     622              :     /// @brief handler for ignorable error messages
     623              :     MsgHandler* myErrorHandler;
     624              : 
     625              :     /// @brief whether to keep the vtype distribution in output
     626              :     const bool myKeepVTypeDist;
     627              : 
     628              :     /// @brief whether to calculate routes for public transport
     629              :     const bool myDoPTRouting;
     630              : 
     631              :     /// @brief whether to preserve flows
     632              :     const bool myKeepFlows;
     633              : 
     634              :     /// @brief whether the network contains bidirectional railway edges
     635              :     bool myHasBidiEdges;
     636              : 
     637              :     /// @brief the maximum traveltime beyond which routing is considered a failure
     638              :     const double myMaxTraveltime;
     639              : 
     640              :     /// @brief temporary edge closing (rerouters)
     641              :     Prohibitions myProhibitions;
     642              :     /// @brief temporary lane closing (rerouters)
     643              :     LaneProhibitions myLaneProhibitions;
     644              :     std::map<double, std::set<const ROLane*> > myLaneProhibitionTimes;
     645              : 
     646              : #ifdef HAVE_FOX
     647              : private:
     648              :     class RoutingTask : public MFXWorkerThread::Task {
     649              :     public:
     650              :         RoutingTask(RORoutable* v, const bool removeLoops, MsgHandler* errorHandler)
     651          923 :             : myRoutable(v), myRemoveLoops(removeLoops), myErrorHandler(errorHandler) {}
     652              :         void run(MFXWorkerThread* context);
     653              :     private:
     654              :         RORoutable* const myRoutable;
     655              :         const bool myRemoveLoops;
     656              :         MsgHandler* const myErrorHandler;
     657              :     private:
     658              :         /// @brief Invalidated assignment operator.
     659              :         RoutingTask& operator=(const RoutingTask&);
     660              :     };
     661              : 
     662              : 
     663              : private:
     664              :     /// @brief for multi threaded routing
     665              :     MFXWorkerThread::Pool myThreadPool;
     666              : #endif
     667              : 
     668              : private:
     669              :     /// @brief Invalidated copy constructor
     670              :     RONet(const RONet& src);
     671              : 
     672              :     /// @brief Invalidated assignment operator
     673              :     RONet& operator=(const RONet& src);
     674              : 
     675              : };
        

Generated by: LCOV version 2.0-1