SUMO - Simulation of Urban MObility
ROLoader.h
Go to the documentation of this file.
1 /****************************************************************************/
10 // Loader for networks and route imports
11 /****************************************************************************/
12 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
13 // Copyright (C) 2002-2015 DLR (http://www.dlr.de/) and contributors
14 /****************************************************************************/
15 //
16 // This file is part of SUMO.
17 // SUMO is free software: you can redistribute it and/or modify
18 // it under the terms of the GNU General Public License as published by
19 // the Free Software Foundation, either version 3 of the License, or
20 // (at your option) any later version.
21 //
22 /****************************************************************************/
23 #ifndef ROLoader_h
24 #define ROLoader_h
25 
26 
27 // ===========================================================================
28 // included modules
29 // ===========================================================================
30 #ifdef _MSC_VER
31 #include <windows_config.h>
32 #else
33 #include <config.h>
34 #endif
35 
36 #include <utils/common/SUMOTime.h>
41 
42 
43 // ===========================================================================
44 // class declarations
45 // ===========================================================================
46 class OptionsCont;
48 class RONet;
49 class ROVehicle;
50 
51 
52 // ===========================================================================
53 // class definitions
54 // ===========================================================================
63 class ROLoader {
64 public:
71  ROLoader(OptionsCont& oc, const bool emptyDestinationsAllowed, const bool logSteps);
72 
73 
75  virtual ~ROLoader();
76 
78  virtual void loadNet(RONet& toFill, ROAbstractEdgeBuilder& eb);
79 
81  bool loadWeights(RONet& net, const std::string& optionName,
82  const std::string& measure, bool useLanes);
83 
85  void openRoutes(RONet& net);
86 
88  void processRoutes(const SUMOTime start, const SUMOTime end, const SUMOTime increment,
90 
94 
95 protected:
117  bool openTypedRoutes(const std::string& optionName, RONet& net);
118 
119 
126  public:
129 
132 
141  void addEdgeWeight(const std::string& id,
142  SUMOReal val, SUMOReal beg, SUMOReal end) const;
143 
144  private:
147 
148  };
149 
150 
157  public:
160 
163 
172  void addEdgeWeight(const std::string& id,
173  SUMOReal val, SUMOReal beg, SUMOReal end) const;
174 
175  private:
178 
179  };
180 
181 
182 
183 protected:
184  void writeStats(SUMOTime time, SUMOTime start, int absNo, bool endGiven);
185 
186 
187 private:
190 
193 
195  const bool myLogSteps;
196 
199 
200 
201 private:
203  ROLoader(const ROLoader& src);
204 
206  ROLoader& operator=(const ROLoader& src);
207 };
208 
209 
210 #endif
211 
212 /****************************************************************************/
213 
Interface for a class which obtains read weights for named edges.
RONet & myNet
The network edges shall be obtained from.
Definition: ROLoader.h:177
void writeStats(SUMOTime time, SUMOTime start, int absNo, bool endGiven)
Definition: ROLoader.cpp:316
void openRoutes(RONet &net)
Builds and opens all route loaders.
Definition: ROLoader.cpp:166
bool loadWeights(RONet &net, const std::string &optionName, const std::string &measure, bool useLanes)
Loads the net weights.
Definition: ROLoader.cpp:273
EdgeFloatTimeLineRetriever_EdgeWeight(RONet &net)
Constructor.
Definition: ROLoader.h:128
const bool myLogSteps
Information whether the routing steps should be logged.
Definition: ROLoader.h:195
Interface for building instances of router-edges.
OptionsCont & myOptions
Options to use.
Definition: ROLoader.h:189
void addEdgeWeight(const std::string &id, SUMOReal val, SUMOReal beg, SUMOReal end) const
Adds an effort for a given edge and time period.
Definition: ROLoader.cpp:92
virtual ~ROLoader()
Destructor.
Definition: ROLoader.cpp:120
A vehicle as used by router.
Definition: ROVehicle.h:60
ROLoader & operator=(const ROLoader &src)
Invalidated assignment operator.
Obtains edge weights from a weights handler and stores them within the edges.
Definition: ROLoader.h:125
The data loader.
Definition: ROLoader.h:63
SUMORouteLoaderControl myLoaders
List of route loaders.
Definition: ROLoader.h:198
const bool myEmptyDestinationsAllowed
Information whether empty destinations are allowed.
Definition: ROLoader.h:192
void addEdgeWeight(const std::string &id, SUMOReal val, SUMOReal beg, SUMOReal end) const
Adds a travel time for a given edge and time period.
Definition: ROLoader.cpp:71
bool openTypedRoutes(const std::string &optionName, RONet &net)
Opens route handler of the given type.
Definition: ROLoader.cpp:238
EdgeFloatTimeLineRetriever_EdgeTravelTime(RONet &net)
Constructor.
Definition: ROLoader.h:159
virtual void loadNet(RONet &toFill, ROAbstractEdgeBuilder &eb)
Loads the network.
Definition: ROLoader.cpp:125
The router's network representation.
Definition: RONet.h:72
Obtains edge travel times from a weights handler and stores them within the edges.
Definition: ROLoader.h:156
A storage for options typed value containers)
Definition: OptionsCont.h:108
int SUMOTime
Definition: SUMOTime.h:43
#define SUMOReal
Definition: config.h:218
void processAllRoutesWithBulkRouter(SUMOTime start, SUMOTime end, RONet &net, SUMOAbstractRouter< ROEdge, ROVehicle > &router)
Loads all routes and processes them with BulkStarRouter.
Definition: ROLoader.cpp:229
void processRoutes(const SUMOTime start, const SUMOTime end, const SUMOTime increment, RONet &net, SUMOAbstractRouter< ROEdge, ROVehicle > &router)
Loads routes from all previously build route loaders.
Definition: ROLoader.cpp:197
ROLoader(OptionsCont &oc, const bool emptyDestinationsAllowed, const bool logSteps)
Constructor.
Definition: ROLoader.cpp:112
RONet & myNet
The network edges shall be obtained from.
Definition: ROLoader.h:146