Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
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-2026 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// ===========================================================================
33class MSNet;
34class NLContainer;
35class MSJunctionLogic;
37class OptionsCont;
38class NLHandler;
43class SUMORouteLoader;
45
46
47// ===========================================================================
48// class definitions
49// ===========================================================================
58class NLBuilder {
59public:
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
111protected:
120 bool load(const std::string& mmlWhat, const bool isNet = false);
121
123 bool loadMesoEdgeTypes(const std::string& mmlWhat);
124
125
134 void buildNet();
135
137 void buildDefaultMeanData(const std::string& optionName, const std::string& id, bool useLanes);
138
145 public:
148
151
160 void addEdgeWeight(const std::string& id,
161 double val, double beg, double end) const;
162
163 private:
166
167 };
168
169
176 public:
179
182
191 void addEdgeWeight(const std::string& id,
192 double val, double beg, double end) const;
193
194 private:
197
198 };
199
200
201protected:
204
207
210
213
216
219
220
221private:
224
227
228};
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:165
EdgeFloatTimeLineRetriever_EdgeEffort(MSNet &net)
Constructor.
Definition NLBuilder.h:147
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:81
Obtains edge efforts from a weights handler and stores them within the edges.
Definition NLBuilder.h:175
MSNet & myNet
The network edges shall be obtained from.
Definition NLBuilder.h:196
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:96
EdgeFloatTimeLineRetriever_EdgeTravelTime(MSNet &net)
Constructor.
Definition NLBuilder.h:178
The main interface for loading a microsim.
Definition NLBuilder.h:58
static MSNet * init(const bool isLibsumo=false)
MSNet & myNet
The net to fill.
Definition NLBuilder.h:215
bool load(const std::string &mmlWhat, const bool isNet=false)
Loads a described subpart form the given list of files.
NLBuilder(const NLBuilder &s)
invalidated copy operator
NLDetectorBuilder & myDetectorBuilder
The detector control builder to use.
Definition NLBuilder.h:212
bool loadMesoEdgeTypes(const std::string &mmlWhat)
loads meso edge types with a dedicated handler and return whether any were loaded
virtual bool build()
Builds and initialises the simulation.
virtual ~NLBuilder()
Destructor.
void buildNet()
Closes the net building process.
NLJunctionControlBuilder & myJunctionBuilder
The junction control builder to use.
Definition NLBuilder.h:209
static SUMORouteLoaderControl * buildRouteLoaderControl(const OptionsCont &oc)
Builds the route loader control.
NLBuilder & operator=(const NLBuilder &s)
invalidated assignment operator
void buildDefaultMeanData(const std::string &optionName, const std::string &id, bool useLanes)
build meanData definition based on option
NLEdgeControlBuilder & myEdgeBuilder
The edge control builder to use.
Definition NLBuilder.h:206
OptionsCont & myOptions
The options to get the names of the files to load and further information from.
Definition NLBuilder.h:203
static void initRandomness()
initializes all RNGs
NLHandler & myXMLHandler
The handler used to parse the net.
Definition NLBuilder.h:218
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.