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 /****************************************************************************/
17 // Loader for networks and route imports
18 /****************************************************************************/
19 #ifndef ROLoader_h
20 #define ROLoader_h
21 
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #include <config.h>
27 
28 #include <utils/common/SUMOTime.h>
32 #include "RORoutable.h"
33 
34 
35 // ===========================================================================
36 // class declarations
37 // ===========================================================================
38 class OptionsCont;
40 class RONet;
41 class ROVehicle;
42 
43 
44 // ===========================================================================
45 // class definitions
46 // ===========================================================================
55 class ROLoader {
56 public:
63  ROLoader(OptionsCont& oc, const bool emptyDestinationsAllowed, const bool logSteps);
64 
65 
67  virtual ~ROLoader();
68 
70  virtual void loadNet(RONet& toFill, ROAbstractEdgeBuilder& eb);
71 
73  bool loadWeights(RONet& net, const std::string& optionName,
74  const std::string& measure, const bool useLanes, const bool boundariesOverride);
75 
77  void openRoutes(RONet& net);
78 
80  void processRoutes(const SUMOTime start, const SUMOTime end, const SUMOTime increment,
81  RONet& net, const RORouterProvider& provider);
82 
83 protected:
105  bool openTypedRoutes(const std::string& optionName, RONet& net, const bool readAll = false);
106 
107 
114  public:
117 
120 
129  void addEdgeWeight(const std::string& id,
130  double val, double beg, double end) const;
131 
132  private:
135 
136  };
137 
138 
145  public:
148 
151 
160  void addEdgeWeight(const std::string& id,
161  double val, double beg, double end) const;
162 
163  private:
166 
167  };
168 
169 
170 
171 protected:
172  void writeStats(const SUMOTime time, const SUMOTime start, const SUMOTime absNo, bool endGiven);
173 
174 
175 private:
178 
181 
183  const bool myLogSteps;
184 
187 
188 
189 private:
191  ROLoader(const ROLoader& src);
192 
194  ROLoader& operator=(const ROLoader& src);
195 };
196 
197 
198 #endif
199 
200 /****************************************************************************/
201 
ROLoader
The data loader.
Definition: ROLoader.h:55
ROLoader::EdgeFloatTimeLineRetriever_EdgeTravelTime::myNet
RONet & myNet
The network edges shall be obtained from.
Definition: ROLoader.h:165
SUMOTime.h
ROLoader::openRoutes
void openRoutes(RONet &net)
Builds and opens all route loaders.
Definition: ROLoader.cpp:161
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:59
ROLoader::EdgeFloatTimeLineRetriever_EdgeWeight::~EdgeFloatTimeLineRetriever_EdgeWeight
~EdgeFloatTimeLineRetriever_EdgeWeight()
Destructor.
Definition: ROLoader.h:119
ROLoader::EdgeFloatTimeLineRetriever_EdgeWeight::myNet
RONet & myNet
The network edges shall be obtained from.
Definition: ROLoader.h:134
ROLoader::EdgeFloatTimeLineRetriever_EdgeTravelTime::~EdgeFloatTimeLineRetriever_EdgeTravelTime
~EdgeFloatTimeLineRetriever_EdgeTravelTime()
Destructor.
Definition: ROLoader.h:150
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:80
SUMOTime
long long int SUMOTime
Definition: SUMOTime.h:34
ROLoader::myLogSteps
const bool myLogSteps
Information whether the routing steps should be logged.
Definition: ROLoader.h:183
SAXWeightsHandler.h
RONet
The router's network representation.
Definition: RONet.h:63
ROVehicle
A vehicle as used by router.
Definition: ROVehicle.h:52
ROLoader::writeStats
void writeStats(const SUMOTime time, const SUMOTime start, const SUMOTime absNo, bool endGiven)
Definition: ROLoader.cpp:294
RORoutable.h
ROLoader::myOptions
OptionsCont & myOptions
Options to use.
Definition: ROLoader.h:177
ROLoader::~ROLoader
virtual ~ROLoader()
Destructor.
Definition: ROLoader.cpp:108
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:223
ROLoader::EdgeFloatTimeLineRetriever_EdgeTravelTime
Obtains edge travel times from a weights handler and stores them within the edges.
Definition: ROLoader.h:144
ROLoader::EdgeFloatTimeLineRetriever_EdgeWeight::EdgeFloatTimeLineRetriever_EdgeWeight
EdgeFloatTimeLineRetriever_EdgeWeight(RONet &net)
Constructor.
Definition: ROLoader.h:116
ROLoader::myLoaders
SUMORouteLoaderControl myLoaders
List of route loaders.
Definition: ROLoader.h:186
ROLoader::myEmptyDestinationsAllowed
const bool myEmptyDestinationsAllowed
Information whether empty destinations are allowed.
Definition: ROLoader.h:180
ROLoader::EdgeFloatTimeLineRetriever_EdgeWeight
Obtains edge weights from a weights handler and stores them within the edges.
Definition: ROLoader.h:113
OptionsCont
A storage for options typed value containers)
Definition: OptionsCont.h:89
ROLoader::loadNet
virtual void loadNet(RONet &toFill, ROAbstractEdgeBuilder &eb)
Loads the network.
Definition: ROLoader.cpp:113
RouterProvider
Definition: RouterProvider.h:37
ROLoader::EdgeFloatTimeLineRetriever_EdgeTravelTime::EdgeFloatTimeLineRetriever_EdgeTravelTime
EdgeFloatTimeLineRetriever_EdgeTravelTime(RONet &net)
Constructor.
Definition: ROLoader.h:147
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:191
SUMORouteLoaderControl
Definition: SUMORouteLoaderControl.h:49
SAXWeightsHandler::EdgeFloatTimeLineRetriever
Interface for a class which obtains read weights for named edges.
Definition: SAXWeightsHandler.h:74
ROAbstractEdgeBuilder
Interface for building instances of router-edges.
Definition: ROAbstractEdgeBuilder.h:53
ROLoader::ROLoader
ROLoader(OptionsCont &oc, const bool emptyDestinationsAllowed, const bool logSteps)
Constructor.
Definition: ROLoader.cpp:100
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:252