SUMO - Simulation of Urban MObility
|
00001 /****************************************************************************/ 00010 // Instance responsible for building networks 00011 /****************************************************************************/ 00012 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ 00013 // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors 00014 /****************************************************************************/ 00015 // 00016 // This file is part of SUMO. 00017 // SUMO is free software: you can redistribute it and/or modify 00018 // it under the terms of the GNU General Public License as published by 00019 // the Free Software Foundation, either version 3 of the License, or 00020 // (at your option) any later version. 00021 // 00022 /****************************************************************************/ 00023 #ifndef NBNetBuilder_h 00024 #define NBNetBuilder_h 00025 00026 00027 // =========================================================================== 00028 // included modules 00029 // =========================================================================== 00030 #ifdef _MSC_VER 00031 #include <windows_config.h> 00032 #else 00033 #include <config.h> 00034 #endif 00035 00036 #include <string> 00037 #include <iostream> 00038 #include <vector> 00039 #include <set> 00040 #include "NBEdgeCont.h" 00041 #include "NBTypeCont.h" 00042 #include "NBNodeCont.h" 00043 #include "NBNode.h" 00044 #include "NBTrafficLightLogicCont.h" 00045 #include "NBDistrictCont.h" 00046 #include "NBJoinedEdgesMap.h" 00047 #include <utils/common/UtilExceptions.h> 00048 00049 00050 // =========================================================================== 00051 // class declarations 00052 // =========================================================================== 00053 class OptionsCont; 00054 class OutputDevice; 00055 00056 00057 // =========================================================================== 00058 // class definitions 00059 // =========================================================================== 00112 class NBNetBuilder { 00113 friend class GNENet; // for triggering intermediate build steps 00114 00115 public: 00117 NBNetBuilder() ; 00118 00120 ~NBNetBuilder() ; 00121 00122 00131 void applyOptions(OptionsCont& oc) ; 00132 00133 00141 void compute(OptionsCont& oc, 00142 const std::set<std::string> &explicitTurnarounds = std::set<std::string>(), 00143 bool removeUnwishedNodes = true); 00144 00145 00146 00149 00153 NBEdgeCont& getEdgeCont() { 00154 return myEdgeCont; 00155 } 00156 00157 00161 NBNodeCont& getNodeCont() { 00162 return myNodeCont; 00163 } 00164 00165 00169 NBTypeCont& getTypeCont() { 00170 return myTypeCont; 00171 } 00172 00173 00177 NBTrafficLightLogicCont& getTLLogicCont() { 00178 return myTLLCont; 00179 } 00180 00181 00185 NBDistrictCont& getDistrictCont() { 00186 return myDistrictCont; 00187 } 00188 00189 00193 const std::vector<std::set<NBEdge*> > &getRoundabouts() const { 00194 return myRoundabouts; 00195 } 00196 00197 00201 const NBJoinedEdgesMap& getJoinedEdgesMap() const { 00202 return myJoinedEdges; 00203 } 00205 00206 00207 protected: 00212 class by_id_sorter { 00213 public: 00215 explicit by_id_sorter() { } 00216 00217 int operator()(const NBNode* n1, const NBNode* n2) const { 00218 return n1->getID() < n2->getID(); 00219 } 00220 00221 }; 00222 00223 protected: 00225 NBNodeCont myNodeCont; 00226 00228 NBTypeCont myTypeCont; 00229 00231 NBEdgeCont myEdgeCont; 00232 00234 NBTrafficLightLogicCont myTLLCont; 00235 00237 NBDistrictCont myDistrictCont; 00238 00240 std::vector<std::set<NBEdge*> > myRoundabouts; 00241 00243 NBJoinedEdgesMap myJoinedEdges; 00244 00245 00246 private: 00248 NBNetBuilder(const NBNetBuilder& s); 00249 00251 NBNetBuilder& operator=(const NBNetBuilder& s); 00252 00253 }; 00254 00255 00256 #endif 00257 00258 /****************************************************************************/ 00259