Eclipse 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-2019 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 /****************************************************************************/
15 // The main interface for loading a microsim
16 /****************************************************************************/
17 #ifndef NLBuilder_h
18 #define NLBuilder_h
19 
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #include <config.h>
25 
26 #include <string>
27 #include <map>
28 #include <vector>
30 
31 
32 // ===========================================================================
33 // class declarations
34 // ===========================================================================
35 class MSNet;
36 class NLContainer;
37 class MSJunctionLogic;
38 class MSDetectorControl;
39 class OptionsCont;
40 class NLHandler;
43 class NLDetectorBuilder;
44 class NLTriggerBuilder;
45 class SUMORouteLoader;
47 
48 
49 // ===========================================================================
50 // class definitions
51 // ===========================================================================
60 class NLBuilder {
61 public:
72  NLBuilder(OptionsCont& oc, MSNet& net,
75  NLHandler& xmlHandler);
76 
77 
79  virtual ~NLBuilder();
80 
81 
93  virtual bool build();
94 
98  static MSNet* init();
99 
101  static void initRandomness();
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  double val, double beg, double end) const;
163 
164  private:
167 
168  };
169 
170 
177  public:
180 
183 
192  void addEdgeWeight(const std::string& id,
193  double val, double beg, double 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 
NLBuilder::initRandomness
static void initRandomness()
initializes all RNGs
Definition: NLBuilder.cpp:271
SUMORouteLoader
Definition: SUMORouteLoader.h:42
NLBuilder
The main interface for loading a microsim.
Definition: NLBuilder.h:60
NLBuilder::EdgeFloatTimeLineRetriever_EdgeTravelTime::~EdgeFloatTimeLineRetriever_EdgeTravelTime
~EdgeFloatTimeLineRetriever_EdgeTravelTime()
Destructor.
Definition: NLBuilder.h:182
NLBuilder::load
bool load(const std::string &mmlWhat, const bool isNet=false)
Loads a described subpart form the given list of files.
Definition: NLBuilder.cpp:333
NLEdgeControlBuilder
Interface for building edges.
Definition: NLEdgeControlBuilder.h:57
MSDetectorControl
Detectors container; responsible for string and output generation.
Definition: MSDetectorControl.h:52
MSNet
The simulated network and simulation perfomer.
Definition: MSNet.h:91
NLBuilder::EdgeFloatTimeLineRetriever_EdgeTravelTime::myNet
MSNet & myNet
The network edges shall be obtained from.
Definition: NLBuilder.h:197
NLBuilder::EdgeFloatTimeLineRetriever_EdgeEffort
Definition: NLBuilder.h:145
NLBuilder::myOptions
OptionsCont & myOptions
The options to get the names of the files to load and further information from.
Definition: NLBuilder.h:204
SAXWeightsHandler.h
NLBuilder::EdgeFloatTimeLineRetriever_EdgeEffort::~EdgeFloatTimeLineRetriever_EdgeEffort
~EdgeFloatTimeLineRetriever_EdgeEffort()
Destructor.
Definition: NLBuilder.h:151
NLTriggerBuilder
Builds trigger objects for microsim.
Definition: NLTriggerBuilder.h:61
NLBuilder::~NLBuilder
virtual ~NLBuilder()
Destructor.
Definition: NLBuilder.cpp:116
NLBuilder::EdgeFloatTimeLineRetriever_EdgeTravelTime::addEdgeWeight
void addEdgeWeight(const std::string &id, double val, double beg, double end) const
Adds a travel time for a given edge and time period.
Definition: NLBuilder.cpp:91
NLBuilder::EdgeFloatTimeLineRetriever_EdgeTravelTime
Obtains edge efforts from a weights handler and stores them within the edges.
Definition: NLBuilder.h:176
NLBuilder::myJunctionBuilder
NLJunctionControlBuilder & myJunctionBuilder
The junction control builder to use.
Definition: NLBuilder.h:210
NLJunctionControlBuilder
Builder of microsim-junctions and tls.
Definition: NLJunctionControlBuilder.h:62
NLBuilder::buildNet
void buildNet()
Closes the net building process.
Definition: NLBuilder.cpp:280
NLBuilder::myXMLHandler
NLHandler & myXMLHandler
The handler used to parse the net.
Definition: NLBuilder.h:219
MSJunctionLogic
Definition: MSJunctionLogic.h:38
NLBuilder::EdgeFloatTimeLineRetriever_EdgeEffort::EdgeFloatTimeLineRetriever_EdgeEffort
EdgeFloatTimeLineRetriever_EdgeEffort(MSNet &net)
Constructor.
Definition: NLBuilder.h:148
NLBuilder::operator=
NLBuilder & operator=(const NLBuilder &s)
invalidated assignment operator
NLBuilder::EdgeFloatTimeLineRetriever_EdgeTravelTime::EdgeFloatTimeLineRetriever_EdgeTravelTime
EdgeFloatTimeLineRetriever_EdgeTravelTime(MSNet &net)
Constructor.
Definition: NLBuilder.h:179
NLBuilder::EdgeFloatTimeLineRetriever_EdgeEffort::addEdgeWeight
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:76
NLBuilder::init
static MSNet * init()
Definition: NLBuilder.cpp:219
OptionsCont
A storage for options typed value containers)
Definition: OptionsCont.h:89
NLBuilder::myEdgeBuilder
NLEdgeControlBuilder & myEdgeBuilder
The edge control builder to use.
Definition: NLBuilder.h:207
NLBuilder::build
virtual bool build()
Builds and initialises the simulation.
Definition: NLBuilder.cpp:120
NLBuilder::NLBuilder
NLBuilder(OptionsCont &oc, MSNet &net, NLEdgeControlBuilder &eb, NLJunctionControlBuilder &jb, NLDetectorBuilder &db, NLHandler &xmlHandler)
Constructor.
Definition: NLBuilder.cpp:105
NLBuilder::myDetectorBuilder
NLDetectorBuilder & myDetectorBuilder
The detector control builder to use.
Definition: NLBuilder.h:213
NLBuilder::buildRouteLoaderControl
SUMORouteLoaderControl * buildRouteLoaderControl(const OptionsCont &oc)
Builds the route loader control.
Definition: NLBuilder.cpp:351
NLHandler
The XML-Handler for network loading.
Definition: NLHandler.h:80
config.h
SUMORouteLoaderControl
Definition: SUMORouteLoaderControl.h:49
NLBuilder::myNet
MSNet & myNet
The net to fill.
Definition: NLBuilder.h:216
SAXWeightsHandler::EdgeFloatTimeLineRetriever
Interface for a class which obtains read weights for named edges.
Definition: SAXWeightsHandler.h:74
NLDetectorBuilder
Builds detectors for microsim.
Definition: NLDetectorBuilder.h:55
NLBuilder::EdgeFloatTimeLineRetriever_EdgeEffort::myNet
MSNet & myNet
The network edges shall be obtained from.
Definition: NLBuilder.h:166