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 
103 
105 
106 protected:
128  bool openTypedRoutes(const std::string& optionName, RONet& net) ;
129 
130 
140  SUMOTime getMinTimeStep() const ;
141 
142 
143 
150  public:
153 
156 
165  void addEdgeWeight(const std::string& id,
166  SUMOReal val, SUMOReal beg, SUMOReal end) const ;
167 
168  private:
171 
172  };
173 
174 
181  public:
184 
187 
196  void addEdgeWeight(const std::string& id,
197  SUMOReal val, SUMOReal beg, SUMOReal end) const ;
198 
199  private:
202 
203  };
204 
205 
206 
207 protected:
208  ROTypedXMLRoutesLoader* buildNamedHandler(const std::string& optionName,
209  const std::string& file, RONet& net) ;
210 
211 
212  void writeStats(SUMOTime time, SUMOTime start, int absNo) ;
213 
214 
216  void destroyHandlers() ;
217 
218 
219 protected:
222 
224  typedef std::vector<ROTypedXMLRoutesLoader*> RouteLoaderCont;
225 
228 
231 
232 
233 private:
235  ROLoader(const ROLoader& src);
236 
238  ROLoader& operator=(const ROLoader& src);
239 
242 };
243 
244 
245 #endif
246 
247 /****************************************************************************/
248