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 /****************************************************************************/
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 
102  static void initRandomness();
103 
104 
105 protected:
114  bool load(const std::string& mmlWhat, const bool isNet = false);
115 
116 
125  void buildNet();
126 
127 
137 
138 
139 
140 
147  public:
150 
153 
162  void addEdgeWeight(const std::string& id,
163  double val, double beg, double end) const;
164 
165  private:
168 
169  };
170 
171 
178  public:
181 
184 
193  void addEdgeWeight(const std::string& id,
194  double val, double beg, double end) const;
195 
196  private:
199 
200  };
201 
202 
203 protected:
206 
209 
212 
215 
218 
221 
222 
223 private:
225  NLBuilder(const NLBuilder& s);
226 
228  NLBuilder& operator=(const NLBuilder& s);
229 
230 };
231 
232 
233 #endif
234 
235 /****************************************************************************/
236 
NLBuilder::initRandomness
static void initRandomness()
initializes all RNGs
Definition: NLBuilder.cpp:266
SUMORouteLoader
Definition: SUMORouteLoader.h:43
NLBuilder
The main interface for loading a microsim.
Definition: NLBuilder.h:61
NLBuilder::EdgeFloatTimeLineRetriever_EdgeTravelTime::~EdgeFloatTimeLineRetriever_EdgeTravelTime
~EdgeFloatTimeLineRetriever_EdgeTravelTime()
Destructor.
Definition: NLBuilder.h:183
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:327
NLEdgeControlBuilder
Interface for building edges.
Definition: NLEdgeControlBuilder.h:58
MSDetectorControl
Detectors container; responsible for string and output generation.
Definition: MSDetectorControl.h:53
MSNet
The simulated network and simulation perfomer.
Definition: MSNet.h:92
NLBuilder::EdgeFloatTimeLineRetriever_EdgeTravelTime::myNet
MSNet & myNet
The network edges shall be obtained from.
Definition: NLBuilder.h:198
NLBuilder::EdgeFloatTimeLineRetriever_EdgeEffort
Definition: NLBuilder.h:146
NLBuilder::myOptions
OptionsCont & myOptions
The options to get the names of the files to load and further information from.
Definition: NLBuilder.h:205
SAXWeightsHandler.h
NLBuilder::EdgeFloatTimeLineRetriever_EdgeEffort::~EdgeFloatTimeLineRetriever_EdgeEffort
~EdgeFloatTimeLineRetriever_EdgeEffort()
Destructor.
Definition: NLBuilder.h:152
NLTriggerBuilder
Builds trigger objects for microsim.
Definition: NLTriggerBuilder.h:62
NLBuilder::~NLBuilder
virtual ~NLBuilder()
Destructor.
Definition: NLBuilder.cpp:113
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:88
NLBuilder::EdgeFloatTimeLineRetriever_EdgeTravelTime
Obtains edge efforts from a weights handler and stores them within the edges.
Definition: NLBuilder.h:177
NLBuilder::myJunctionBuilder
NLJunctionControlBuilder & myJunctionBuilder
The junction control builder to use.
Definition: NLBuilder.h:211
NLJunctionControlBuilder
Builder of microsim-junctions and tls.
Definition: NLJunctionControlBuilder.h:63
NLBuilder::buildNet
void buildNet()
Closes the net building process.
Definition: NLBuilder.cpp:274
NLBuilder::myXMLHandler
NLHandler & myXMLHandler
The handler used to parse the net.
Definition: NLBuilder.h:220
MSJunctionLogic
Definition: MSJunctionLogic.h:39
NLBuilder::EdgeFloatTimeLineRetriever_EdgeEffort::EdgeFloatTimeLineRetriever_EdgeEffort
EdgeFloatTimeLineRetriever_EdgeEffort(MSNet &net)
Constructor.
Definition: NLBuilder.h:149
NLBuilder::operator=
NLBuilder & operator=(const NLBuilder &s)
invalidated assignment operator
NLBuilder::EdgeFloatTimeLineRetriever_EdgeTravelTime::EdgeFloatTimeLineRetriever_EdgeTravelTime
EdgeFloatTimeLineRetriever_EdgeTravelTime(MSNet &net)
Constructor.
Definition: NLBuilder.h:180
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:73
NLBuilder::init
static MSNet * init()
Definition: NLBuilder.cpp:220
OptionsCont
A storage for options typed value containers)
Definition: OptionsCont.h:90
NLBuilder::myEdgeBuilder
NLEdgeControlBuilder & myEdgeBuilder
The edge control builder to use.
Definition: NLBuilder.h:208
NLBuilder::build
virtual bool build()
Builds and initialises the simulation.
Definition: NLBuilder.cpp:117
NLBuilder::NLBuilder
NLBuilder(OptionsCont &oc, MSNet &net, NLEdgeControlBuilder &eb, NLJunctionControlBuilder &jb, NLDetectorBuilder &db, NLHandler &xmlHandler)
Constructor.
Definition: NLBuilder.cpp:102
NLBuilder::myDetectorBuilder
NLDetectorBuilder & myDetectorBuilder
The detector control builder to use.
Definition: NLBuilder.h:214
NLBuilder::buildRouteLoaderControl
SUMORouteLoaderControl * buildRouteLoaderControl(const OptionsCont &oc)
Builds the route loader control.
Definition: NLBuilder.cpp:346
NLHandler
The XML-Handler for network loading.
Definition: NLHandler.h:81
config.h
SUMORouteLoaderControl
Definition: SUMORouteLoaderControl.h:50
NLBuilder::myNet
MSNet & myNet
The net to fill.
Definition: NLBuilder.h:217
SAXWeightsHandler::EdgeFloatTimeLineRetriever
Interface for a class which obtains read weights for named edges.
Definition: SAXWeightsHandler.h:75
NLDetectorBuilder
Builds detectors for microsim.
Definition: NLDetectorBuilder.h:56
NLBuilder::EdgeFloatTimeLineRetriever_EdgeEffort::myNet
MSNet & myNet
The network edges shall be obtained from.
Definition: NLBuilder.h:167