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-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
18 // The main interface for loading a microsim
19 /****************************************************************************/
20 #ifndef NLBuilder_h
21 #define NLBuilder_h
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #ifdef _MSC_VER
28 #include <windows_config.h>
29 #else
30 #include <config.h>
31 #endif
32 
33 #include <string>
34 #include <map>
35 #include <vector>
37 
38 
39 // ===========================================================================
40 // class declarations
41 // ===========================================================================
42 class MSNet;
43 class NLContainer;
44 class MSJunctionLogic;
45 class MSDetectorControl;
46 class OptionsCont;
47 class NLHandler;
50 class NLDetectorBuilder;
51 class NLTriggerBuilder;
52 class SUMORouteLoader;
54 
55 
56 // ===========================================================================
57 // class definitions
58 // ===========================================================================
67 class NLBuilder {
68 public:
79  NLBuilder(OptionsCont& oc, MSNet& net,
82  NLHandler& xmlHandler);
83 
84 
86  virtual ~NLBuilder();
87 
88 
100  virtual bool build();
101 
105  static MSNet* init();
106 
107 
108 protected:
117  bool load(const std::string& mmlWhat, const bool isNet = false);
118 
119 
128  void buildNet();
129 
130 
140 
141 
142 
143 
150  public:
153 
156 
165  void addEdgeWeight(const std::string& id,
166  double val, double beg, double end) const;
167 
168  private:
171 
172  };
173 
174 
181  public:
184 
187 
196  void addEdgeWeight(const std::string& id,
197  double val, double beg, double end) const;
198 
199  private:
202 
203  };
204 
205 
206 protected:
209 
212 
215 
218 
221 
224 
225 
226 private:
228  NLBuilder(const NLBuilder& s);
229 
231  NLBuilder& operator=(const NLBuilder& s);
232 
233 };
234 
235 
236 #endif
237 
238 /****************************************************************************/
239 
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:180
void buildNet()
Closes the net building process.
Definition: NLBuilder.cpp:277
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:82
The main interface for loading a microsim.
Definition: NLBuilder.h:67
EdgeFloatTimeLineRetriever_EdgeTravelTime(MSNet &net)
Constructor.
Definition: NLBuilder.h:183
MSNet & myNet
The network edges shall be obtained from.
Definition: NLBuilder.h:170
OptionsCont & myOptions
The options to get the names of the files to load and further information from.
Definition: NLBuilder.h:208
Detectors container; responsible for string and output generation.
The simulated network and simulation perfomer.
Definition: MSNet.h:90
NLJunctionControlBuilder & myJunctionBuilder
The junction control builder to use.
Definition: NLBuilder.h:214
EdgeFloatTimeLineRetriever_EdgeEffort(MSNet &net)
Constructor.
Definition: NLBuilder.h:152
Builder of microsim-junctions and tls.
MSNet & myNet
The net to fill.
Definition: NLBuilder.h:220
MSNet & myNet
The network edges shall be obtained from.
Definition: NLBuilder.h:201
NLBuilder(OptionsCont &oc, MSNet &net, NLEdgeControlBuilder &eb, NLJunctionControlBuilder &jb, NLDetectorBuilder &db, NLHandler &xmlHandler)
Constructor.
Definition: NLBuilder.cpp:111
The XML-Handler for network loading.
Definition: NLHandler.h:87
virtual bool build()
Builds and initialises the simulation.
Definition: NLBuilder.cpp:126
A storage for options typed value containers)
Definition: OptionsCont.h:98
SUMORouteLoaderControl * buildRouteLoaderControl(const OptionsCont &oc)
Builds the route loader control.
Definition: NLBuilder.cpp:348
bool load(const std::string &mmlWhat, const bool isNet=false)
Loads a described subpart form the given list of files.
Definition: NLBuilder.cpp:329
Builds trigger objects for microsim.
virtual ~NLBuilder()
Destructor.
Definition: NLBuilder.cpp:122
static MSNet * init()
Definition: NLBuilder.cpp:226
NLDetectorBuilder & myDetectorBuilder
The detector control builder to use.
Definition: NLBuilder.h:217
NLHandler & myXMLHandler
The handler used to parse the net.
Definition: NLBuilder.h:223
Interface for building edges.
NLEdgeControlBuilder & myEdgeBuilder
The edge control builder to use.
Definition: NLBuilder.h:211