SUMO - Simulation of Urban MObility
NLBuilder.h
Go to the documentation of this file.
00001 /****************************************************************************/
00008 // The main interface for loading a microsim
00009 /****************************************************************************/
00010 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
00011 // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors
00012 /****************************************************************************/
00013 //
00014 //   This file is part of SUMO.
00015 //   SUMO is free software: you can redistribute it and/or modify
00016 //   it under the terms of the GNU General Public License as published by
00017 //   the Free Software Foundation, either version 3 of the License, or
00018 //   (at your option) any later version.
00019 //
00020 /****************************************************************************/
00021 #ifndef NLBuilder_h
00022 #define NLBuilder_h
00023 
00024 
00025 // ===========================================================================
00026 // included modules
00027 // ===========================================================================
00028 #ifdef _MSC_VER
00029 #include <windows_config.h>
00030 #else
00031 #include <config.h>
00032 #endif
00033 
00034 #include <string>
00035 #include <map>
00036 #include <vector>
00037 #include <utils/xml/SAXWeightsHandler.h>
00038 #include <microsim/MSNet.h>
00039 
00040 
00041 // ===========================================================================
00042 // class declarations
00043 // ===========================================================================
00044 class MSNet;
00045 class NLContainer;
00046 class MSJunctionLogic;
00047 class MSDetectorControl;
00048 class OptionsCont;
00049 class NLHandler;
00050 class NLEdgeControlBuilder;
00051 class NLJunctionControlBuilder;
00052 class NLDetectorBuilder;
00053 class NLTriggerBuilder;
00054 class MSRouteLoader;
00055 
00056 
00057 // ===========================================================================
00058 // class definitions
00059 // ===========================================================================
00068 class NLBuilder {
00069 public:
00080     NLBuilder(OptionsCont& oc, MSNet& net,
00081               NLEdgeControlBuilder& eb, NLJunctionControlBuilder& jb,
00082               NLDetectorBuilder& db,
00083               NLHandler& xmlHandler) ;
00084 
00085 
00087     virtual ~NLBuilder() ;
00088 
00089 
00101     virtual bool build() ;
00102 
00103 
00104 protected:
00112     bool load(const std::string& mmlWhat);
00113 
00114 
00123     void buildNet() ;
00124 
00125 
00134     MSRouteLoaderControl* buildRouteLoaderControl(const OptionsCont& oc) ;
00135 
00136 
00137 
00138 
00144     class EdgeFloatTimeLineRetriever_EdgeEffort : public SAXWeightsHandler::EdgeFloatTimeLineRetriever {
00145     public:
00147         EdgeFloatTimeLineRetriever_EdgeEffort(MSNet& net) : myNet(net) {}
00148 
00150         ~EdgeFloatTimeLineRetriever_EdgeEffort() { }
00151 
00160         void addEdgeWeight(const std::string& id,
00161                            SUMOReal val, SUMOReal beg, SUMOReal end) const ;
00162 
00163     private:
00165         MSNet& myNet;
00166 
00167     };
00168 
00169 
00175     class EdgeFloatTimeLineRetriever_EdgeTravelTime : public SAXWeightsHandler::EdgeFloatTimeLineRetriever {
00176     public:
00178         EdgeFloatTimeLineRetriever_EdgeTravelTime(MSNet& net) : myNet(net) {}
00179 
00181         ~EdgeFloatTimeLineRetriever_EdgeTravelTime() { }
00182 
00191         void addEdgeWeight(const std::string& id,
00192                            SUMOReal val, SUMOReal beg, SUMOReal end) const ;
00193 
00194     private:
00196         MSNet& myNet;
00197 
00198     };
00199 
00200 
00201 protected:
00203     OptionsCont& myOptions;
00204 
00206     NLEdgeControlBuilder& myEdgeBuilder;
00207 
00209     NLJunctionControlBuilder& myJunctionBuilder;
00210 
00212     NLDetectorBuilder& myDetectorBuilder;
00213 
00215     MSNet& myNet;
00216 
00218     NLHandler& myXMLHandler;
00219 
00220 
00221 private:
00223     NLBuilder(const NLBuilder& s);
00224 
00226     NLBuilder& operator=(const NLBuilder& s);
00227 
00228 };
00229 
00230 
00231 #endif
00232 
00233 /****************************************************************************/
00234 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines