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.dev/sumo
3 // Copyright (C) 2001-2024 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials are made available under the
5 // terms of the Eclipse Public License 2.0 which is available at
6 // https://www.eclipse.org/legal/epl-2.0/
7 // This Source Code may also be made available under the following Secondary
8 // Licenses when the conditions for such availability set forth in the Eclipse
9 // Public License 2.0 are satisfied: GNU General Public License, version 2
10 // or later which is available at
11 // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12 // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13 /****************************************************************************/
19 // The main interface for loading a microsim
20 /****************************************************************************/
21 #pragma once
22 #include <config.h>
23 
24 #include <string>
25 #include <map>
26 #include <vector>
28 
29 
30 // ===========================================================================
31 // class declarations
32 // ===========================================================================
33 class MSNet;
34 class NLContainer;
35 class MSJunctionLogic;
36 class MSDetectorControl;
37 class OptionsCont;
38 class NLHandler;
41 class NLDetectorBuilder;
42 class NLTriggerBuilder;
43 class SUMORouteLoader;
45 
46 
47 // ===========================================================================
48 // class definitions
49 // ===========================================================================
58 class NLBuilder {
59 public:
70  NLBuilder(OptionsCont& oc, MSNet& net,
73  NLHandler& xmlHandler);
74 
75 
77  virtual ~NLBuilder();
78 
79 
91  virtual bool build();
92 
96  static MSNet* init(const bool isLibsumo = false);
97 
99  static void initRandomness();
100 
110 
111 protected:
120  bool load(const std::string& mmlWhat, const bool isNet = false);
121 
122 
131  void buildNet();
132 
134  void buildDefaultMeanData(const std::string& optionName, const std::string& id, bool useLanes);
135 
142  public:
145 
148 
157  void addEdgeWeight(const std::string& id,
158  double val, double beg, double end) const;
159 
160  private:
163 
164  };
165 
166 
173  public:
176 
179 
188  void addEdgeWeight(const std::string& id,
189  double val, double beg, double end) const;
190 
191  private:
194 
195  };
196 
197 
198 protected:
201 
204 
207 
210 
213 
216 
217 
218 private:
220  NLBuilder(const NLBuilder& s);
221 
224 
225 };
Detectors container; responsible for string and output generation.
The simulated network and simulation perfomer.
Definition: MSNet.h:89
MSNet & myNet
The network edges shall be obtained from.
Definition: NLBuilder.h:162
EdgeFloatTimeLineRetriever_EdgeEffort(MSNet &net)
Constructor.
Definition: NLBuilder.h:144
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:80
Obtains edge efforts from a weights handler and stores them within the edges.
Definition: NLBuilder.h:172
MSNet & myNet
The network edges shall be obtained from.
Definition: NLBuilder.h:193
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:95
EdgeFloatTimeLineRetriever_EdgeTravelTime(MSNet &net)
Constructor.
Definition: NLBuilder.h:175
The main interface for loading a microsim.
Definition: NLBuilder.h:58
static MSNet * init(const bool isLibsumo=false)
Definition: NLBuilder.cpp:296
MSNet & myNet
The net to fill.
Definition: NLBuilder.h:212
bool load(const std::string &mmlWhat, const bool isNet=false)
Loads a described subpart form the given list of files.
Definition: NLBuilder.cpp:424
NLBuilder(const NLBuilder &s)
invalidated copy operator
NLDetectorBuilder & myDetectorBuilder
The detector control builder to use.
Definition: NLBuilder.h:209
virtual bool build()
Builds and initialises the simulation.
Definition: NLBuilder.cpp:124
virtual ~NLBuilder()
Destructor.
Definition: NLBuilder.cpp:120
void buildNet()
Closes the net building process.
Definition: NLBuilder.cpp:375
NLBuilder(OptionsCont &oc, MSNet &net, NLEdgeControlBuilder &eb, NLJunctionControlBuilder &jb, NLDetectorBuilder &db, NLHandler &xmlHandler)
Constructor.
Definition: NLBuilder.cpp:109
NLJunctionControlBuilder & myJunctionBuilder
The junction control builder to use.
Definition: NLBuilder.h:206
static SUMORouteLoaderControl * buildRouteLoaderControl(const OptionsCont &oc)
Builds the route loader control.
Definition: NLBuilder.cpp:442
void buildDefaultMeanData(const std::string &optionName, const std::string &id, bool useLanes)
build meanData definition based on option
Definition: NLBuilder.cpp:463
NLEdgeControlBuilder & myEdgeBuilder
The edge control builder to use.
Definition: NLBuilder.h:203
NLBuilder & operator=(const NLBuilder &s)
invalidated assignment operator
OptionsCont & myOptions
The options to get the names of the files to load and further information from.
Definition: NLBuilder.h:200
static void initRandomness()
initializes all RNGs
Definition: NLBuilder.cpp:363
NLHandler & myXMLHandler
The handler used to parse the net.
Definition: NLBuilder.h:215
Builds detectors for microsim.
Interface for building edges.
The XML-Handler for network loading.
Definition: NLHandler.h:79
Builder of microsim-junctions and tls.
Builds trigger objects for microsim.
A storage for options typed value containers)
Definition: OptionsCont.h:89
Interface for a class which obtains read weights for named edges.