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-2018 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 
EdgeFloatTimeLineRetriever & operator=(const EdgeFloatTimeLineRetriever &)
Interface for a class which obtains read weights for named edges.
long long int SUMOTime
Definition: SUMOTime.h:36
RONet & myNet
The network edges shall be obtained from.
Definition: ROLoader.h:166
void openRoutes(RONet &net)
Builds and opens all route loaders.
Definition: ROLoader.cpp:154
EdgeFloatTimeLineRetriever_EdgeWeight(RONet &net)
Constructor.
Definition: ROLoader.h:117
const bool myLogSteps
Information whether the routing steps should be logged.
Definition: ROLoader.h:184
void writeStats(const SUMOTime time, const SUMOTime start, const SUMOTime absNo, bool endGiven)
Definition: ROLoader.cpp:287
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:80
bool openTypedRoutes(const std::string &optionName, RONet &net, const bool readAll=false)
Opens route handler of the given type.
Definition: ROLoader.cpp:216
OptionsCont & myOptions
Options to use.
Definition: ROLoader.h:178
virtual ~ROLoader()
Destructor.
Definition: ROLoader.cpp:108
A vehicle as used by router.
Definition: ROVehicle.h:53
Obtains edge weights from a weights handler and stores them within the edges.
Definition: ROLoader.h:114
The data loader.
Definition: ROLoader.h:56
SUMORouteLoaderControl myLoaders
List of route loaders.
Definition: ROLoader.h:187
const bool myEmptyDestinationsAllowed
Information whether empty destinations are allowed.
Definition: ROLoader.h:181
EdgeFloatTimeLineRetriever_EdgeTravelTime(RONet &net)
Constructor.
Definition: ROLoader.h:148
virtual void loadNet(RONet &toFill, ROAbstractEdgeBuilder &eb)
Loads the network.
Definition: ROLoader.cpp:113
The router&#39;s network representation.
Definition: RONet.h:68
Obtains edge travel times from a weights handler and stores them within the edges.
Definition: ROLoader.h:145
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:184
A storage for options typed value containers)
Definition: OptionsCont.h:92
ROLoader(OptionsCont &oc, const bool emptyDestinationsAllowed, const bool logSteps)
Constructor.
Definition: ROLoader.cpp:100
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:245
RONet & myNet
The network edges shall be obtained from.
Definition: ROLoader.h:135