Eclipse SUMO - Simulation of Urban MObility
ROLoader.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2002-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
18 // Loader for networks and route imports
19 /****************************************************************************/
20 #ifndef ROLoader_h
21 #define ROLoader_h
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #include <config.h>
28 
29 #include <utils/common/SUMOTime.h>
33 #include "RORoutable.h"
34 
35 
36 // ===========================================================================
37 // class declarations
38 // ===========================================================================
39 class OptionsCont;
41 class RONet;
42 class ROVehicle;
43 
44 
45 // ===========================================================================
46 // class definitions
47 // ===========================================================================
56 class ROLoader {
57 public:
64  ROLoader(OptionsCont& oc, const bool emptyDestinationsAllowed, const bool logSteps);
65 
66 
68  virtual ~ROLoader();
69 
71  virtual void loadNet(RONet& toFill, ROAbstractEdgeBuilder& eb);
72 
74  bool loadWeights(RONet& net, const std::string& optionName,
75  const std::string& measure, const bool useLanes, const bool boundariesOverride);
76 
78  void openRoutes(RONet& net);
79 
81  void processRoutes(const SUMOTime start, const SUMOTime end, const SUMOTime increment,
82  RONet& net, const RORouterProvider& provider);
83 
84 protected:
106  bool openTypedRoutes(const std::string& optionName, RONet& net, const bool readAll = false);
107 
108 
115  public:
118 
121 
130  void addEdgeWeight(const std::string& id,
131  double val, double beg, double end) const;
132 
133  private:
136 
137  };
138 
139 
146  public:
149 
152 
161  void addEdgeWeight(const std::string& id,
162  double val, double beg, double end) const;
163 
164  private:
167 
168  };
169 
170 
171 
172 protected:
173  void writeStats(const SUMOTime time, const SUMOTime start, const SUMOTime absNo, bool endGiven);
174 
175 
176 private:
179 
182 
184  const bool myLogSteps;
185 
188 
189 
190 private:
192  ROLoader(const ROLoader& src);
193 
195  ROLoader& operator=(const ROLoader& src);
196 };
197 
198 
199 #endif
200 
201 /****************************************************************************/
202 
ROLoader
The data loader.
Definition: ROLoader.h:56
ROLoader::EdgeFloatTimeLineRetriever_EdgeTravelTime::myNet
RONet & myNet
The network edges shall be obtained from.
Definition: ROLoader.h:166
SUMOTime.h
ROLoader::openRoutes
void openRoutes(RONet &net)
Builds and opens all route loaders.
Definition: ROLoader.cpp:156
ROLoader::EdgeFloatTimeLineRetriever_EdgeTravelTime::addEdgeWeight
void addEdgeWeight(const std::string &id, double val, double beg, double end) const
Adds a travel time for a given edge and time period.
Definition: ROLoader.cpp:60
ROLoader::EdgeFloatTimeLineRetriever_EdgeWeight::~EdgeFloatTimeLineRetriever_EdgeWeight
~EdgeFloatTimeLineRetriever_EdgeWeight()
Destructor.
Definition: ROLoader.h:120
ROLoader::EdgeFloatTimeLineRetriever_EdgeWeight::myNet
RONet & myNet
The network edges shall be obtained from.
Definition: ROLoader.h:135
ROLoader::EdgeFloatTimeLineRetriever_EdgeTravelTime::~EdgeFloatTimeLineRetriever_EdgeTravelTime
~EdgeFloatTimeLineRetriever_EdgeTravelTime()
Destructor.
Definition: ROLoader.h:151
ValueTimeLine.h
ROLoader::EdgeFloatTimeLineRetriever_EdgeWeight::addEdgeWeight
void addEdgeWeight(const std::string &id, double val, double beg, double end) const
Adds an effort for a given edge and time period.
Definition: ROLoader.cpp:81
SUMOTime
long long int SUMOTime
Definition: SUMOTime.h:35
ROLoader::myLogSteps
const bool myLogSteps
Information whether the routing steps should be logged.
Definition: ROLoader.h:184
SAXWeightsHandler.h
RONet
The router's network representation.
Definition: RONet.h:64
ROVehicle
A vehicle as used by router.
Definition: ROVehicle.h:53
ROLoader::writeStats
void writeStats(const SUMOTime time, const SUMOTime start, const SUMOTime absNo, bool endGiven)
Definition: ROLoader.cpp:289
RORoutable.h
ROLoader::myOptions
OptionsCont & myOptions
Options to use.
Definition: ROLoader.h:178
ROLoader::~ROLoader
virtual ~ROLoader()
Destructor.
Definition: ROLoader.cpp:109
ROLoader::operator=
ROLoader & operator=(const ROLoader &src)
Invalidated assignment operator.
ROLoader::openTypedRoutes
bool openTypedRoutes(const std::string &optionName, RONet &net, const bool readAll=false)
Opens route handler of the given type.
Definition: ROLoader.cpp:218
ROLoader::EdgeFloatTimeLineRetriever_EdgeTravelTime
Obtains edge travel times from a weights handler and stores them within the edges.
Definition: ROLoader.h:145
ROLoader::EdgeFloatTimeLineRetriever_EdgeWeight::EdgeFloatTimeLineRetriever_EdgeWeight
EdgeFloatTimeLineRetriever_EdgeWeight(RONet &net)
Constructor.
Definition: ROLoader.h:117
ROLoader::myLoaders
SUMORouteLoaderControl myLoaders
List of route loaders.
Definition: ROLoader.h:187
ROLoader::myEmptyDestinationsAllowed
const bool myEmptyDestinationsAllowed
Information whether empty destinations are allowed.
Definition: ROLoader.h:181
ROLoader::EdgeFloatTimeLineRetriever_EdgeWeight
Obtains edge weights from a weights handler and stores them within the edges.
Definition: ROLoader.h:114
OptionsCont
A storage for options typed value containers)
Definition: OptionsCont.h:90
ROLoader::loadNet
virtual void loadNet(RONet &toFill, ROAbstractEdgeBuilder &eb)
Loads the network.
Definition: ROLoader.cpp:114
RouterProvider
Definition: RouterProvider.h:38
ROLoader::EdgeFloatTimeLineRetriever_EdgeTravelTime::EdgeFloatTimeLineRetriever_EdgeTravelTime
EdgeFloatTimeLineRetriever_EdgeTravelTime(RONet &net)
Constructor.
Definition: ROLoader.h:148
SUMORouteLoaderControl.h
config.h
ROLoader::processRoutes
void processRoutes(const SUMOTime start, const SUMOTime end, const SUMOTime increment, RONet &net, const RORouterProvider &provider)
Loads routes from all previously build route loaders.
Definition: ROLoader.cpp:186
SUMORouteLoaderControl
Definition: SUMORouteLoaderControl.h:50
SAXWeightsHandler::EdgeFloatTimeLineRetriever
Interface for a class which obtains read weights for named edges.
Definition: SAXWeightsHandler.h:75
ROAbstractEdgeBuilder
Interface for building instances of router-edges.
Definition: ROAbstractEdgeBuilder.h:54
ROLoader::ROLoader
ROLoader(OptionsCont &oc, const bool emptyDestinationsAllowed, const bool logSteps)
Constructor.
Definition: ROLoader.cpp:101
ROLoader::loadWeights
bool loadWeights(RONet &net, const std::string &optionName, const std::string &measure, const bool useLanes, const bool boundariesOverride)
Loads the net weights.
Definition: ROLoader.cpp:247