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.dlr.de/
11 // Copyright (C) 2001-2017 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 
39 
40 // ===========================================================================
41 // class declarations
42 // ===========================================================================
43 class MSNet;
44 class NLContainer;
45 class MSJunctionLogic;
46 class MSDetectorControl;
47 class OptionsCont;
48 class NLHandler;
51 class NLDetectorBuilder;
52 class NLTriggerBuilder;
53 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 
106  static int loadAndRun();
107 
108 
109 protected:
118  bool load(const std::string& mmlWhat, const bool isNet = false);
119 
120 
129  void buildNet();
130 
131 
141 
142 
143 
144 
151  public:
154 
157 
166  void addEdgeWeight(const std::string& id,
167  double val, double beg, double end) const;
168 
169  private:
172 
173  };
174 
175 
182  public:
185 
188 
197  void addEdgeWeight(const std::string& id,
198  double val, double beg, double end) const;
199 
200  private:
203 
204  };
205 
206 
207 protected:
210 
213 
216 
219 
222 
225 
226 
227 private:
229  NLBuilder(const NLBuilder& s);
230 
232  NLBuilder& operator=(const NLBuilder& s);
233 
234 };
235 
236 
237 #endif
238 
239 /****************************************************************************/
240 
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:181
void buildNet()
Closes the net building process.
Definition: NLBuilder.cpp:276
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:68
EdgeFloatTimeLineRetriever_EdgeTravelTime(MSNet &net)
Constructor.
Definition: NLBuilder.h:184
MSNet & myNet
The network edges shall be obtained from.
Definition: NLBuilder.h:171
OptionsCont & myOptions
The options to get the names of the files to load and further information from.
Definition: NLBuilder.h:209
Detectors container; responsible for string and output generation.
The simulated network and simulation perfomer.
Definition: MSNet.h:94
NLJunctionControlBuilder & myJunctionBuilder
The junction control builder to use.
Definition: NLBuilder.h:215
static int loadAndRun()
Definition: NLBuilder.cpp:223
EdgeFloatTimeLineRetriever_EdgeEffort(MSNet &net)
Constructor.
Definition: NLBuilder.h:153
Builder of microsim-junctions and tls.
MSNet & myNet
The net to fill.
Definition: NLBuilder.h:221
MSNet & myNet
The network edges shall be obtained from.
Definition: NLBuilder.h:202
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:84
virtual bool build()
Builds and initialises the simulation.
Definition: NLBuilder.cpp:126
A storage for options typed value containers)
Definition: OptionsCont.h:99
SUMORouteLoaderControl * buildRouteLoaderControl(const OptionsCont &oc)
Builds the route loader control.
Definition: NLBuilder.cpp:346
bool load(const std::string &mmlWhat, const bool isNet=false)
Loads a described subpart form the given list of files.
Definition: NLBuilder.cpp:327
Builds trigger objects for microsim.
virtual ~NLBuilder()
Destructor.
Definition: NLBuilder.cpp:122
NLDetectorBuilder & myDetectorBuilder
The detector control builder to use.
Definition: NLBuilder.h:218
NLHandler & myXMLHandler
The handler used to parse the net.
Definition: NLBuilder.h:224
Interface for building edges.
NLEdgeControlBuilder & myEdgeBuilder
The edge control builder to use.
Definition: NLBuilder.h:212