SUMO - Simulation of Urban MObility
NLBuilder.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2018 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
16 // The main interface for loading a microsim
17 /****************************************************************************/
18 #ifndef NLBuilder_h
19 #define NLBuilder_h
20 
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #include <config.h>
26 
27 #include <string>
28 #include <map>
29 #include <vector>
31 
32 
33 // ===========================================================================
34 // class declarations
35 // ===========================================================================
36 class MSNet;
37 class NLContainer;
38 class MSJunctionLogic;
39 class MSDetectorControl;
40 class OptionsCont;
41 class NLHandler;
44 class NLDetectorBuilder;
45 class NLTriggerBuilder;
46 class SUMORouteLoader;
48 
49 
50 // ===========================================================================
51 // class definitions
52 // ===========================================================================
61 class NLBuilder {
62 public:
73  NLBuilder(OptionsCont& oc, MSNet& net,
76  NLHandler& xmlHandler);
77 
78 
80  virtual ~NLBuilder();
81 
82 
94  virtual bool build();
95 
99  static MSNet* init();
100 
101 
102 protected:
111  bool load(const std::string& mmlWhat, const bool isNet = false);
112 
113 
122  void buildNet();
123 
124 
134 
135 
136 
137 
144  public:
147 
150 
159  void addEdgeWeight(const std::string& id,
160  double val, double beg, double end) const;
161 
162  private:
165 
166  };
167 
168 
175  public:
178 
181 
190  void addEdgeWeight(const std::string& id,
191  double val, double beg, double end) const;
192 
193  private:
196 
197  };
198 
199 
200 protected:
203 
206 
209 
212 
215 
218 
219 
220 private:
222  NLBuilder(const NLBuilder& s);
223 
225  NLBuilder& operator=(const NLBuilder& s);
226 
227 };
228 
229 
230 #endif
231 
232 /****************************************************************************/
233 
Builds detectors for microsim.
EdgeFloatTimeLineRetriever & operator=(const EdgeFloatTimeLineRetriever &)
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:174
void buildNet()
Closes the net building process.
Definition: NLBuilder.cpp:269
void addEdgeWeight(const std::string &id, double val, double beg, double end) const
Adds an effort for a given edge and time period.
Definition: NLBuilder.cpp:73
The main interface for loading a microsim.
Definition: NLBuilder.h:61
EdgeFloatTimeLineRetriever_EdgeTravelTime(MSNet &net)
Constructor.
Definition: NLBuilder.h:177
MSNet & myNet
The network edges shall be obtained from.
Definition: NLBuilder.h:164
OptionsCont & myOptions
The options to get the names of the files to load and further information from.
Definition: NLBuilder.h:202
Detectors container; responsible for string and output generation.
The simulated network and simulation perfomer.
Definition: MSNet.h:84
NLJunctionControlBuilder & myJunctionBuilder
The junction control builder to use.
Definition: NLBuilder.h:208
EdgeFloatTimeLineRetriever_EdgeEffort(MSNet &net)
Constructor.
Definition: NLBuilder.h:146
Builder of microsim-junctions and tls.
MSNet & myNet
The net to fill.
Definition: NLBuilder.h:214
MSNet & myNet
The network edges shall be obtained from.
Definition: NLBuilder.h:195
NLBuilder(OptionsCont &oc, MSNet &net, NLEdgeControlBuilder &eb, NLJunctionControlBuilder &jb, NLDetectorBuilder &db, NLHandler &xmlHandler)
Constructor.
Definition: NLBuilder.cpp:102
The XML-Handler for network loading.
Definition: NLHandler.h:81
virtual bool build()
Builds and initialises the simulation.
Definition: NLBuilder.cpp:117
A storage for options typed value containers)
Definition: OptionsCont.h:92
SUMORouteLoaderControl * buildRouteLoaderControl(const OptionsCont &oc)
Builds the route loader control.
Definition: NLBuilder.cpp:340
bool load(const std::string &mmlWhat, const bool isNet=false)
Loads a described subpart form the given list of files.
Definition: NLBuilder.cpp:321
Builds trigger objects for microsim.
virtual ~NLBuilder()
Destructor.
Definition: NLBuilder.cpp:113
static MSNet * init()
Definition: NLBuilder.cpp:220
NLDetectorBuilder & myDetectorBuilder
The detector control builder to use.
Definition: NLBuilder.h:211
NLHandler & myXMLHandler
The handler used to parse the net.
Definition: NLBuilder.h:217
Interface for building edges.
NLEdgeControlBuilder & myEdgeBuilder
The edge control builder to use.
Definition: NLBuilder.h:205