SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
NBNetBuilder.h
Go to the documentation of this file.
1 /****************************************************************************/
10 // Instance responsible for building networks
11 /****************************************************************************/
12 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
13 // Copyright (C) 2001-2012 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 NBNetBuilder_h
24 #define NBNetBuilder_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 <string>
37 #include <iostream>
38 #include <vector>
39 #include <set>
40 #include "NBEdgeCont.h"
41 #include "NBTypeCont.h"
42 #include "NBNodeCont.h"
43 #include "NBNode.h"
45 #include "NBDistrictCont.h"
46 #include "NBJoinedEdgesMap.h"
48 
49 
50 // ===========================================================================
51 // class declarations
52 // ===========================================================================
53 class OptionsCont;
54 class OutputDevice;
55 
56 
57 // ===========================================================================
58 // class definitions
59 // ===========================================================================
113  friend class GNENet; // for triggering intermediate build steps
114 
115 public:
117  NBNetBuilder();
118 
120  ~NBNetBuilder();
121 
122 
131  void applyOptions(OptionsCont& oc);
132 
133 
141  void compute(OptionsCont& oc,
142  const std::set<std::string>& explicitTurnarounds = std::set<std::string>(),
143  bool removeUnwishedNodes = true);
144 
145 
146 
149 
154  return myEdgeCont;
155  }
156 
157 
162  return myNodeCont;
163  }
164 
165 
170  return myTypeCont;
171  }
172 
173 
178  return myTLLCont;
179  }
180 
181 
186  return myDistrictCont;
187  }
188 
189 
193  const std::vector<std::set<NBEdge*> >& getRoundabouts() const {
194  return myRoundabouts;
195  }
196 
197 
202  return myJoinedEdges;
203  }
205 
206 
207 protected:
212  class by_id_sorter {
213  public:
215  explicit by_id_sorter() { }
216 
217  int operator()(const NBNode* n1, const NBNode* n2) const {
218  return n1->getID() < n2->getID();
219  }
220 
221  };
222 
223 protected:
226 
229 
232 
235 
238 
240  std::vector<std::set<NBEdge*> > myRoundabouts;
241 
244 
245 
246 private:
248  NBNetBuilder(const NBNetBuilder& s);
249 
252 
253 };
254 
255 
256 #endif
257 
258 /****************************************************************************/
259