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-2020 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 
101 
102 protected:
111  bool load(const std::string& mmlWhat, const bool isNet = false);
112 
113 
122  void buildNet();
123 
124 
134 
135 
136 
137 
144  public:
147 
150 
159  void addEdgeWeight(const std::string& id,
160  double val, double beg, double end) const;
161 
162  private:
165 
166  };
167 
168 
175  public:
178 
181 
190  void addEdgeWeight(const std::string& id,
191  double val, double beg, double end) const;
192 
193  private:
196 
197  };
198 
199 
200 protected:
203 
206 
209 
212 
215 
218 
219 
220 private:
222  NLBuilder(const NLBuilder& s);
223 
226 
227 };
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:164
EdgeFloatTimeLineRetriever_EdgeEffort(MSNet &net)
Constructor.
Definition: NLBuilder.h:146
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:75
Obtains edge efforts from a weights handler and stores them within the edges.
Definition: NLBuilder.h:174
MSNet & myNet
The network edges shall be obtained from.
Definition: NLBuilder.h:195
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:90
EdgeFloatTimeLineRetriever_EdgeTravelTime(MSNet &net)
Constructor.
Definition: NLBuilder.h:177
The main interface for loading a microsim.
Definition: NLBuilder.h:58
static MSNet * init(const bool isLibsumo=false)
Definition: NLBuilder.cpp:256
MSNet & myNet
The net to fill.
Definition: NLBuilder.h:214
bool load(const std::string &mmlWhat, const bool isNet=false)
Loads a described subpart form the given list of files.
Definition: NLBuilder.cpp:375
NLBuilder(const NLBuilder &s)
invalidated copy operator
NLDetectorBuilder & myDetectorBuilder
The detector control builder to use.
Definition: NLBuilder.h:211
virtual bool build()
Builds and initialises the simulation.
Definition: NLBuilder.cpp:119
virtual ~NLBuilder()
Destructor.
Definition: NLBuilder.cpp:115
void buildNet()
Closes the net building process.
Definition: NLBuilder.cpp:322
NLBuilder(OptionsCont &oc, MSNet &net, NLEdgeControlBuilder &eb, NLJunctionControlBuilder &jb, NLDetectorBuilder &db, NLHandler &xmlHandler)
Constructor.
Definition: NLBuilder.cpp:104
NLJunctionControlBuilder & myJunctionBuilder
The junction control builder to use.
Definition: NLBuilder.h:208
SUMORouteLoaderControl * buildRouteLoaderControl(const OptionsCont &oc)
Builds the route loader control.
Definition: NLBuilder.cpp:393
NLEdgeControlBuilder & myEdgeBuilder
The edge control builder to use.
Definition: NLBuilder.h:205
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:202
static void initRandomness()
initializes all RNGs
Definition: NLBuilder.cpp:312
NLHandler & myXMLHandler
The handler used to parse the net.
Definition: NLBuilder.h:217
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.