SUMO - Simulation of Urban MObility
NLBuilder.h
Go to the documentation of this file.
1 /****************************************************************************/
8 // The main interface for loading a microsim
9 /****************************************************************************/
10 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
11 // Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors
12 /****************************************************************************/
13 //
14 // This file is part of SUMO.
15 // SUMO is free software: you can redistribute it and/or modify
16 // it under the terms of the GNU General Public License as published by
17 // the Free Software Foundation, either version 3 of the License, or
18 // (at your option) any later version.
19 //
20 /****************************************************************************/
21 #ifndef NLBuilder_h
22 #define NLBuilder_h
23 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
34 #include <string>
35 #include <map>
36 #include <vector>
38 #include <microsim/MSNet.h>
39 
40 
41 // ===========================================================================
42 // class declarations
43 // ===========================================================================
44 class MSNet;
45 class NLContainer;
46 class MSJunctionLogic;
47 class MSDetectorControl;
48 class OptionsCont;
49 class NLHandler;
52 class NLDetectorBuilder;
53 class NLTriggerBuilder;
54 class SUMORouteLoader;
55 
56 
57 // ===========================================================================
58 // class definitions
59 // ===========================================================================
68 class NLBuilder {
69 public:
80  NLBuilder(OptionsCont& oc, MSNet& net,
83  NLHandler& xmlHandler);
84 
85 
87  virtual ~NLBuilder();
88 
89 
101  virtual bool build();
102 
103 
104 protected:
113  bool load(const std::string& mmlWhat, const bool isNet = false);
114 
115 
124  void buildNet();
125 
126 
136 
137 
138 
139 
146  public:
149 
152 
161  void addEdgeWeight(const std::string& id,
162  SUMOReal val, SUMOReal beg, SUMOReal end) const;
163 
164  private:
167 
168  };
169 
170 
177  public:
180 
183 
192  void addEdgeWeight(const std::string& id,
193  SUMOReal val, SUMOReal beg, SUMOReal end) const;
194 
195  private:
198 
199  };
200 
201 
202 protected:
205 
208 
211 
214 
217 
220 
221 
222 private:
224  NLBuilder(const NLBuilder& s);
225 
227  NLBuilder& operator=(const NLBuilder& s);
228 
229 };
230 
231 
232 #endif
233 
234 /****************************************************************************/
235 
Builds detectors for microsim.
Interface for a class which obtains read weights for named edges.
Obtains edge efforts from a weights handler and stores them within the edges.
Definition: NLBuilder.h:176
void buildNet()
Closes the net building process.
Definition: NLBuilder.cpp:202
The main interface for loading a microsim.
Definition: NLBuilder.h:68
EdgeFloatTimeLineRetriever_EdgeTravelTime(MSNet &net)
Constructor.
Definition: NLBuilder.h:179
void addEdgeWeight(const std::string &id, SUMOReal val, SUMOReal beg, SUMOReal end) const
Adds an effort for a given edge and time period.
Definition: NLBuilder.cpp:78
NLBuilder & operator=(const NLBuilder &s)
invalidated assignment operator
MSNet & myNet
The network edges shall be obtained from.
Definition: NLBuilder.h:166
OptionsCont & myOptions
The options to get the names of the files to load and further information from.
Definition: NLBuilder.h:204
void addEdgeWeight(const std::string &id, SUMOReal val, SUMOReal beg, SUMOReal end) const
Adds a travel time for a given edge and time period.
Definition: NLBuilder.cpp:93
Detectors container; responsible for string and output generation.
The simulated network and simulation perfomer.
Definition: MSNet.h:91
NLJunctionControlBuilder & myJunctionBuilder
The junction control builder to use.
Definition: NLBuilder.h:210
EdgeFloatTimeLineRetriever_EdgeEffort(MSNet &net)
Constructor.
Definition: NLBuilder.h:148
Builder of microsim-junctions and tls.
MSNet & myNet
The net to fill.
Definition: NLBuilder.h:216
MSNet & myNet
The network edges shall be obtained from.
Definition: NLBuilder.h:197
NLBuilder(OptionsCont &oc, MSNet &net, NLEdgeControlBuilder &eb, NLJunctionControlBuilder &jb, NLDetectorBuilder &db, NLHandler &xmlHandler)
Constructor.
Definition: NLBuilder.cpp:107
The XML-Handler for network loading.
Definition: NLHandler.h:72
virtual bool build()
Builds and initialises the simulation.
Definition: NLBuilder.cpp:122
A storage for options typed value containers)
Definition: OptionsCont.h:108
SUMORouteLoaderControl * buildRouteLoaderControl(const OptionsCont &oc)
Builds the route loader control.
Definition: NLBuilder.cpp:267
bool load(const std::string &mmlWhat, const bool isNet=false)
Loads a described subpart form the given list of files.
Definition: NLBuilder.cpp:248
#define SUMOReal
Definition: config.h:215
Builds trigger objects for microsim.
virtual ~NLBuilder()
Destructor.
Definition: NLBuilder.cpp:118
NLDetectorBuilder & myDetectorBuilder
The detector control builder to use.
Definition: NLBuilder.h:213
NLHandler & myXMLHandler
The handler used to parse the net.
Definition: NLBuilder.h:219
Interface for building edges.
NLEdgeControlBuilder & myEdgeBuilder
The edge control builder to use.
Definition: NLBuilder.h:207