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.sourceforge.net/
12 // Copyright (C) 2001-2012 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 <string>
36 #include <xercesc/sax2/SAX2XMLReader.hpp>
37 #include <utils/common/SUMOTime.h>
41 
42 
43 // ===========================================================================
44 // class declarations
45 // ===========================================================================
46 class OptionsCont;
47 class RONet;
50 class GUIRouterRunThread;
51 class ROVehicle;
52 
53 
54 // ===========================================================================
55 // class definitions
56 // ===========================================================================
65 class ROLoader {
66 public:
73  ROLoader(OptionsCont& oc, bool emptyDestinationsAllowed);
74 
75 
77  virtual ~ROLoader();
78 
80  virtual void loadNet(RONet& toFill, ROAbstractEdgeBuilder& eb);
81 
83  bool loadWeights(RONet& net, const std::string& optionName,
84  const std::string& measure, bool useLanes);
85 
88  unsigned int openRoutes(RONet& net);
89 
92  void processRoutesStepWise(SUMOTime start, SUMOTime end,
94 
97  void processAllRoutes(SUMOTime start, SUMOTime end,
99 
100 #ifdef HAVE_INTERNAL // catchall for internal stuff
101 
102  void processAllRoutesWithBulkRouter(SUMOTime start, SUMOTime end,
104 #endif
105 
107 
108 protected:
130  bool openTypedRoutes(const std::string& optionName, RONet& net);
131 
132 
142  SUMOTime getMinTimeStep() const;
143 
144 
145 
152  public:
155 
158 
167  void addEdgeWeight(const std::string& id,
168  SUMOReal val, SUMOReal beg, SUMOReal end) const;
169 
170  private:
173 
174  };
175 
176 
183  public:
186 
189 
198  void addEdgeWeight(const std::string& id,
199  SUMOReal val, SUMOReal beg, SUMOReal end) const;
200 
201  private:
204 
205  };
206 
207 
208 
209 protected:
210  ROTypedXMLRoutesLoader* buildNamedHandler(const std::string& optionName,
211  const std::string& file, RONet& net);
212 
213 
214  void writeStats(SUMOTime time, SUMOTime start, int absNo);
215 
216 
218  void destroyHandlers();
219 
220 
221 protected:
224 
226  typedef std::vector<ROTypedXMLRoutesLoader*> RouteLoaderCont;
227 
230 
233 
234 
235 private:
237  ROLoader(const ROLoader& src);
238 
240  ROLoader& operator=(const ROLoader& src);
241 
244 };
245 
246 
247 #endif
248 
249 /****************************************************************************/
250