NLBuilder.h

Go to the documentation of this file.
00001 /****************************************************************************/
00007 // The main interface for loading a microsim
00008 /****************************************************************************/
00009 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
00010 // Copyright 2001-2010 DLR (http://www.dlr.de/) and contributors
00011 /****************************************************************************/
00012 //
00013 //   This program is free software; you can redistribute it and/or modify
00014 //   it under the terms of the GNU General Public License as published by
00015 //   the Free Software Foundation; either version 2 of the License, or
00016 //   (at your option) any later version.
00017 //
00018 /****************************************************************************/
00019 #ifndef NLBuilder_h
00020 #define NLBuilder_h
00021 
00022 
00023 // ===========================================================================
00024 // included modules
00025 // ===========================================================================
00026 #ifdef _MSC_VER
00027 #include <windows_config.h>
00028 #else
00029 #include <config.h>
00030 #endif
00031 
00032 #include <string>
00033 #include <map>
00034 #include <vector>
00035 #include <utils/xml/SAXWeightsHandler.h>
00036 #include <microsim/MSNet.h>
00037 #include "NLGeomShapeBuilder.h"
00038 
00039 
00040 // ===========================================================================
00041 // class declarations
00042 // ===========================================================================
00043 class MSNet;
00044 class NLContainer;
00045 class MSEmitControl;
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) throw();
00084 
00085 
00087     virtual ~NLBuilder() throw();
00088 
00089 
00101     virtual bool build() throw(ProcessError);
00102 
00103 
00104 protected:
00112     bool load(const std::string &mmlWhat);
00113 
00114 
00123     void buildNet() throw(ProcessError);
00124 
00125 
00134     MSRouteLoaderControl *buildRouteLoaderControl(const OptionsCont &oc) throw(ProcessError);
00135 
00136 
00137 
00138 
00144     class EdgeFloatTimeLineRetriever_EdgeEffort : public SAXWeightsHandler::EdgeFloatTimeLineRetriever {
00145     public:
00147         EdgeFloatTimeLineRetriever_EdgeEffort(MSNet &net) throw() : myNet(net) {}
00148 
00150         ~EdgeFloatTimeLineRetriever_EdgeEffort() throw() { }
00151 
00160         void addEdgeWeight(const std::string &id,
00161                            SUMOReal val, SUMOReal beg, SUMOReal end) const throw();
00162 
00163     private:
00165         MSNet &myNet;
00166 
00167     };
00168 
00169 
00175     class EdgeFloatTimeLineRetriever_EdgeTravelTime : public SAXWeightsHandler::EdgeFloatTimeLineRetriever {
00176     public:
00178         EdgeFloatTimeLineRetriever_EdgeTravelTime(MSNet &net) throw() : myNet(net) {}
00179 
00181         ~EdgeFloatTimeLineRetriever_EdgeTravelTime() throw() { }
00182 
00191         void addEdgeWeight(const std::string &id,
00192                            SUMOReal val, SUMOReal beg, SUMOReal end) const throw();
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 

Generated on Wed May 5 00:06:35 2010 for Sumo - Simulation of Urban MObility by  doxygen 1.5.6