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-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
20 // Loader for networks and route imports
21 /****************************************************************************/
22 #ifndef ROLoader_h
23 #define ROLoader_h
24 
25 
26 // ===========================================================================
27 // included modules
28 // ===========================================================================
29 #ifdef _MSC_VER
30 #include <windows_config.h>
31 #else
32 #include <config.h>
33 #endif
34 
35 #include <utils/common/SUMOTime.h>
39 #include "RORoutable.h"
40 
41 
42 // ===========================================================================
43 // class declarations
44 // ===========================================================================
45 class OptionsCont;
47 class RONet;
48 class ROVehicle;
49 
50 
51 // ===========================================================================
52 // class definitions
53 // ===========================================================================
62 class ROLoader {
63 public:
70  ROLoader(OptionsCont& oc, const bool emptyDestinationsAllowed, const bool logSteps);
71 
72 
74  virtual ~ROLoader();
75 
77  virtual void loadNet(RONet& toFill, ROAbstractEdgeBuilder& eb);
78 
80  bool loadWeights(RONet& net, const std::string& optionName,
81  const std::string& measure, const bool useLanes, const bool boundariesOverride);
82 
84  void openRoutes(RONet& net);
85 
87  void processRoutes(const SUMOTime start, const SUMOTime end, const SUMOTime increment,
88  RONet& net, const RORouterProvider& provider);
89 
90 protected:
112  bool openTypedRoutes(const std::string& optionName, RONet& net, const bool readAll = false);
113 
114 
121  public:
124 
127 
136  void addEdgeWeight(const std::string& id,
137  double val, double beg, double end) const;
138 
139  private:
142 
143  };
144 
145 
152  public:
155 
158 
167  void addEdgeWeight(const std::string& id,
168  double val, double beg, double end) const;
169 
170  private:
173 
174  };
175 
176 
177 
178 protected:
179  void writeStats(const SUMOTime time, const SUMOTime start, const SUMOTime absNo, bool endGiven);
180 
181 
182 private:
185 
188 
190  const bool myLogSteps;
191 
194 
195 
196 private:
198  ROLoader(const ROLoader& src);
199 
201  ROLoader& operator=(const ROLoader& src);
202 };
203 
204 
205 #endif
206 
207 /****************************************************************************/
208 
EdgeFloatTimeLineRetriever & operator=(const EdgeFloatTimeLineRetriever &)
Interface for a class which obtains read weights for named edges.
RONet & myNet
The network edges shall be obtained from.
Definition: ROLoader.h:172
void openRoutes(RONet &net)
Builds and opens all route loaders.
Definition: ROLoader.cpp:160
EdgeFloatTimeLineRetriever_EdgeWeight(RONet &net)
Constructor.
Definition: ROLoader.h:123
const bool myLogSteps
Information whether the routing steps should be logged.
Definition: ROLoader.h:190
void writeStats(const SUMOTime time, const SUMOTime start, const SUMOTime absNo, bool endGiven)
Definition: ROLoader.cpp:293
Interface for building instances of router-edges.
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:86
bool openTypedRoutes(const std::string &optionName, RONet &net, const bool readAll=false)
Opens route handler of the given type.
Definition: ROLoader.cpp:222
OptionsCont & myOptions
Options to use.
Definition: ROLoader.h:184
virtual ~ROLoader()
Destructor.
Definition: ROLoader.cpp:114
A vehicle as used by router.
Definition: ROVehicle.h:59
Obtains edge weights from a weights handler and stores them within the edges.
Definition: ROLoader.h:120
The data loader.
Definition: ROLoader.h:62
SUMORouteLoaderControl myLoaders
List of route loaders.
Definition: ROLoader.h:193
const bool myEmptyDestinationsAllowed
Information whether empty destinations are allowed.
Definition: ROLoader.h:187
EdgeFloatTimeLineRetriever_EdgeTravelTime(RONet &net)
Constructor.
Definition: ROLoader.h:154
virtual void loadNet(RONet &toFill, ROAbstractEdgeBuilder &eb)
Loads the network.
Definition: ROLoader.cpp:119
The router&#39;s network representation.
Definition: RONet.h:74
Obtains edge travel times from a weights handler and stores them within the edges.
Definition: ROLoader.h:151
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:190
A storage for options typed value containers)
Definition: OptionsCont.h:98
long long int SUMOTime
Definition: TraCIDefs.h:51
ROLoader(OptionsCont &oc, const bool emptyDestinationsAllowed, const bool logSteps)
Constructor.
Definition: ROLoader.cpp:106
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:251
RONet & myNet
The network edges shall be obtained from.
Definition: ROLoader.h:141