SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ROLoader.h
Go to the documentation of this file.
1 /****************************************************************************/
9 // Loader for networks and route imports
10 /****************************************************************************/
11 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
12 // Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors
13 /****************************************************************************/
14 //
15 // This file is part of SUMO.
16 // SUMO is free software: you can redistribute it and/or modify
17 // it under the terms of the GNU General Public License as published by
18 // the Free Software Foundation, either version 3 of the License, or
19 // (at your option) any later version.
20 //
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>
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, bool useLanes);
82 
84  void openRoutes(RONet& net);
85 
87  void processRoutes(SUMOTime start, SUMOTime end,
89 
90 #ifdef HAVE_INTERNAL // catchall for internal stuff
91 
92  void processAllRoutesWithBulkRouter(SUMOTime start, SUMOTime end,
94 #endif
95 
96 protected:
118  bool openTypedRoutes(const std::string& optionName, RONet& net);
119 
120 
127  public:
130 
133 
142  void addEdgeWeight(const std::string& id,
143  SUMOReal val, SUMOReal beg, SUMOReal end) const;
144 
145  private:
148 
149  };
150 
151 
158  public:
161 
164 
173  void addEdgeWeight(const std::string& id,
174  SUMOReal val, SUMOReal beg, SUMOReal end) const;
175 
176  private:
179 
180  };
181 
182 
183 
184 protected:
185  void writeStats(SUMOTime time, SUMOTime start, int absNo);
186 
187 
188 private:
191 
194 
196  const bool myLogSteps;
197 
200 
201 
202 private:
204  ROLoader(const ROLoader& src);
205 
207  ROLoader& operator=(const ROLoader& src);
208 };
209 
210 
211 #endif
212 
213 /****************************************************************************/
214 
void processRoutes(SUMOTime start, SUMOTime end, RONet &net, SUMOAbstractRouter< ROEdge, ROVehicle > &router)
Loads routes from all previously build route loaders.
Definition: ROLoader.cpp:190
Interface for a class which obtains read weights for named edges.
RONet & myNet
The network edges shall be obtained from.
Definition: ROLoader.h:178
void openRoutes(RONet &net)
Builds and opens all route loaders.
Definition: ROLoader.cpp:165
bool loadWeights(RONet &net, const std::string &optionName, const std::string &measure, bool useLanes)
Loads the net weights.
Definition: ROLoader.cpp:260
EdgeFloatTimeLineRetriever_EdgeWeight(RONet &net)
Constructor.
Definition: ROLoader.h:129
const bool myLogSteps
Information whether the routing steps should be logged.
Definition: ROLoader.h:196
Interface for building instances of router-edges.
OptionsCont & myOptions
Options to use.
Definition: ROLoader.h:190
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:95
virtual ~ROLoader()
Destructor.
Definition: ROLoader.cpp:123
A vehicle as used by router.
Definition: ROVehicle.h:58
ROLoader & operator=(const ROLoader &src)
Invalidated assignment operator.
Obtains edge weights from a weights handler and stores them within the edges.
Definition: ROLoader.h:126
The data loader.
Definition: ROLoader.h:62
SUMORouteLoaderControl myLoaders
List of route loaders.
Definition: ROLoader.h:199
const bool myEmptyDestinationsAllowed
Information whether empty destinations are allowed.
Definition: ROLoader.h:193
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:74
bool openTypedRoutes(const std::string &optionName, RONet &net)
Opens route handler of the given type.
Definition: ROLoader.cpp:225
EdgeFloatTimeLineRetriever_EdgeTravelTime(RONet &net)
Constructor.
Definition: ROLoader.h:160
virtual void loadNet(RONet &toFill, ROAbstractEdgeBuilder &eb)
Loads the network.
Definition: ROLoader.cpp:128
The router's network representation.
Definition: RONet.h:65
Obtains edge travel times from a weights handler and stores them within the edges.
Definition: ROLoader.h:157
A storage for options typed value containers)
Definition: OptionsCont.h:108
#define SUMOReal
Definition: config.h:215
ROLoader(OptionsCont &oc, const bool emptyDestinationsAllowed, const bool logSteps)
Constructor.
Definition: ROLoader.cpp:115
RONet & myNet
The network edges shall be obtained from.
Definition: ROLoader.h:147
void writeStats(SUMOTime time, SUMOTime start, int absNo)
Definition: ROLoader.cpp:303