Eclipse SUMO - Simulation of Urban MObility
NLBuilder.cpp
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3// Copyright (C) 2001-2022 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/****************************************************************************/
20// The main interface for loading a microsim
21/****************************************************************************/
22#include <config.h>
23
24#include <iostream>
25#include <vector>
26#include <string>
27#include <map>
28
41#include <utils/xml/XMLSubSys.h>
42#ifdef HAVE_FOX
44#endif
45#include <libsumo/Helper.h>
49#include <microsim/MSNet.h>
54#include <microsim/MSGlobals.h>
56#include <microsim/MSFrame.h>
62
63#include "NLHandler.h"
66#include "NLDetectorBuilder.h"
67#include "NLTriggerBuilder.h"
68#include "NLBuilder.h"
69
70
71// ===========================================================================
72// method definitions
73// ===========================================================================
74// ---------------------------------------------------------------------------
75// NLBuilder::EdgeFloatTimeLineRetriever_EdgeWeight - methods
76// ---------------------------------------------------------------------------
77void
79 double value, double begTime, double endTime) const {
80 MSEdge* edge = MSEdge::dictionary(id);
81 if (edge != nullptr) {
82 myNet.getWeightsStorage().addEffort(edge, begTime, endTime, value);
83 } else {
84 WRITE_ERROR("Trying to set the effort for the unknown edge '" + id + "'.");
85 }
86}
87
88
89// ---------------------------------------------------------------------------
90// NLBuilder::EdgeFloatTimeLineRetriever_EdgeTravelTime - methods
91// ---------------------------------------------------------------------------
92void
94 double value, double begTime, double endTime) const {
95 MSEdge* edge = MSEdge::dictionary(id);
96 if (edge != nullptr) {
97 myNet.getWeightsStorage().addTravelTime(edge, begTime, endTime, value);
98 } else {
99 WRITE_ERROR("Trying to set the travel time for the unknown edge '" + id + "'.");
100 }
101}
102
103
104// ---------------------------------------------------------------------------
105// NLBuilder - methods
106// ---------------------------------------------------------------------------
108 MSNet& net,
112 NLHandler& xmlHandler)
115 myNet(net), myXMLHandler(xmlHandler) {}
116
117
119
120
121bool
123 // try to build the net
124 if (!load("net-file", true)) {
125 return false;
126 }
127 if (myXMLHandler.networkVersion() == 0.) {
128 throw ProcessError("Invalid network, no network version declared.");
129 }
130 // check whether the loaded net agrees with the simulation options
131 if ((myOptions.getBool("no-internal-links") || myOptions.getBool("mesosim")) && myXMLHandler.haveSeenInternalEdge() && myXMLHandler.haveSeenDefaultLength()) {
132 WRITE_WARNING(TL("Network contains internal links which are ignored. Vehicles will 'jump' across junctions and thus underestimate route lengths and travel times."));
133 }
134 buildNet();
135 // @note on loading order constraints:
136 // - additional-files before route-files and state-files due to referencing
137 // - additional-files before weight-files since the latter might contain intermodal edge data and the intermodal net depends on the stops and public transport from the additionals
138
139 bool stateBeginMismatch = false;
140 if (myOptions.isSet("load-state")) {
141 // first, load only the time
143 if (myOptions.isDefault("begin")) {
144 myOptions.set("begin", time2string(stateTime));
145 if (TraCIServer::getInstance() != nullptr) {
147 }
148 } else {
149 if (stateTime != string2time(myOptions.getString("begin"))) {
150 WRITE_WARNING("State was written at a different time=" + time2string(stateTime) + " than the begin time " + myOptions.getString("begin") + "!");
151 stateBeginMismatch = true;
152 }
153 }
154 }
155
156 if (myOptions.getBool("junction-taz")) {
157 // create a TAZ for every junction
158 const MSJunctionControl& junctions = myNet.getJunctionControl();
159 for (auto it = junctions.begin(); it != junctions.end(); it++) {
160 const std::string sinkID = it->first + "-sink";
161 const std::string sourceID = it->first + "-source";
162 if (MSEdge::dictionary(sinkID) == nullptr && MSEdge::dictionary(sourceID) == nullptr) {
163 // sink must be built and added before source
164 MSEdge* sink = myEdgeBuilder.buildEdge(sinkID, SumoXMLEdgeFunc::CONNECTOR, "", "", -1, 0);
165 MSEdge* source = myEdgeBuilder.buildEdge(sourceID, SumoXMLEdgeFunc::CONNECTOR, "", "", -1, 0);
166 sink->setOtherTazConnector(source);
167 source->setOtherTazConnector(sink);
168 MSEdge::dictionary(sinkID, sink);
169 MSEdge::dictionary(sourceID, source);
170 sink->initialize(new std::vector<MSLane*>());
171 source->initialize(new std::vector<MSLane*>());
172 const MSJunction* junction = it->second;
173 for (const MSEdge* edge : junction->getIncoming()) {
174 if (!edge->isInternal()) {
175 const_cast<MSEdge*>(edge)->addSuccessor(sink);
176 }
177 }
178 for (const MSEdge* edge : junction->getOutgoing()) {
179 if (!edge->isInternal()) {
180 source->addSuccessor(const_cast<MSEdge*>(edge));
181 }
182 }
183 } else {
184 WRITE_WARNINGF(TL("A TAZ with id '%' already exists. Not building junction TAZ."), it->first)
185 }
186 }
187 }
188
189 // load additional net elements (sources, detectors, ...)
190 if (myOptions.isSet("additional-files")) {
191 if (!load("additional-files")) {
192 return false;
193 }
194 // load shapes with separate handler
196 if (!ShapeHandler::loadFiles(myOptions.getStringVector("additional-files"), sh)) {
197 return false;
198 }
201 }
205 tll->initMesoTLSPenalties();
206 }
207 }
209 }
210 // declare meandata set by options
211 buildDefaultMeanData("edgedata-output", "DEFAULT_EDGEDATA", false);
212 buildDefaultMeanData("lanedata-output", "DEFAULT_LANEDATA", true);
213
214 if (stateBeginMismatch && myNet.getVehicleControl().getLoadedVehicleNo() > 0) {
215 throw ProcessError("Loading vehicles ahead of a state file is not supported. Correct --begin option or load vehicles with option --route-files");
216 }
217
218 // load weights if wished
219 if (myOptions.isSet("weight-files")) {
220 if (!myOptions.isUsableFileList("weight-files")) {
221 return false;
222 }
223 // build and prepare the weights handler
224 std::vector<SAXWeightsHandler::ToRetrieveDefinition*> retrieverDefs;
225 // travel time, first (always used)
227 retrieverDefs.push_back(new SAXWeightsHandler::ToRetrieveDefinition("traveltime", true, ttRetriever));
228 // the measure to use, then
230 std::string measure = myOptions.getString("weight-attribute");
231 if (!myOptions.isDefault("weight-attribute")) {
232 if (measure == "CO" || measure == "CO2" || measure == "HC" || measure == "PMx" || measure == "NOx" || measure == "fuel" || measure == "electricity") {
233 measure += "_perVeh";
234 }
235 retrieverDefs.push_back(new SAXWeightsHandler::ToRetrieveDefinition(measure, true, eRetriever));
236 }
237 // set up handler
238 SAXWeightsHandler handler(retrieverDefs, "");
239 // start parsing; for each file in the list
240 std::vector<std::string> files = myOptions.getStringVector("weight-files");
241 for (std::vector<std::string>::iterator i = files.begin(); i != files.end(); ++i) {
242 // report about loading when wished
243 WRITE_MESSAGE("Loading weights from '" + *i + "'...");
244 // parse the file
245 if (!XMLSubSys::runParser(handler, *i)) {
246 return false;
247 }
248 }
249 }
250 // load the previous state if wished
251 if (myOptions.isSet("load-state")) {
253 const std::string& f = myOptions.getString("load-state");
254 long before = PROGRESS_BEGIN_TIME_MESSAGE("Loading state from '" + f + "'");
255 MSStateHandler h(f, string2time(myOptions.getString("load-state.offset")));
257 if (MsgHandler::getErrorInstance()->wasInformed()) {
258 return false;
259 }
260 PROGRESS_TIME_MESSAGE(before);
261 }
262 // load routes
263 if (myOptions.isSet("route-files") && string2time(myOptions.getString("route-steps")) <= 0) {
264 if (!load("route-files")) {
265 return false;
266 }
267 }
268 // optionally switch off traffic lights
269 if (myOptions.getBool("tls.all-off")) {
271 }
272 WRITE_MESSAGE(TL("Loading done."));
273 return true;
274}
275
276
277MSNet*
278NLBuilder::init(const bool isLibsumo) {
280 oc.clear();
285 return nullptr;
286 }
288 std::string validation = oc.getString("xml-validation");
289 std::string routeValidation = oc.getString("xml-validation.routes");
290 if (isLibsumo) {
291 if (oc.isDefault("xml-validation")) {
292 validation = "never";
293 }
294 if (oc.isDefault("xml-validation.routes")) {
295 routeValidation = "never";
296 }
297 }
298 XMLSubSys::setValidation(validation, oc.getString("xml-validation.net"), routeValidation);
299 if (!MSFrame::checkOptions()) {
300 throw ProcessError();
301 }
302#ifdef HAVE_FOX
303 if (oc.getInt("threads") > 1) {
304 // make the output aware of threading
306 }
307#endif
311 MSVehicleControl* vc = nullptr;
313 vc = new MEVehicleControl();
314 } else {
315 vc = new MSVehicleControl();
316 }
317 MSNet* net = new MSNet(vc, new MSEventControl(), new MSEventControl(), new MSEventControl());
318 // need to init TraCI-Server before loading routes to catch VehicleState::BUILT
319 TraCIServer::openSocket(std::map<int, TraCIServer::CmdExecutor>());
320 if (isLibsumo) {
322 }
323
325 NLDetectorBuilder db(*net);
326 NLJunctionControlBuilder jb(*net, db);
328 NLHandler handler("", *net, db, tb, eb, jb);
329 tb.setHandler(&handler);
330 NLBuilder builder(oc, *net, eb, jb, db, handler);
334 if (builder.build()) {
335 // preload the routes especially for TraCI
336 net->loadRoutes();
337 return net;
338 }
339 delete net;
340 throw ProcessError();
341}
342
343
344void
353}
354
355
356void
358 MSEdgeControl* edges = nullptr;
359 MSJunctionControl* junctions = nullptr;
360 SUMORouteLoaderControl* routeLoaders = nullptr;
361 MSTLLogicControl* tlc = nullptr;
362 std::vector<SUMOTime> stateDumpTimes;
363 std::vector<std::string> stateDumpFiles;
364 try {
365 MSFrame::buildStreams(); // ensure streams are ready for output during building
367 junctions = myJunctionBuilder.build();
368 junctions->postloadInitContainer();
369 routeLoaders = buildRouteLoaderControl(myOptions);
371 for (std::string timeStr : myOptions.getStringVector("save-state.times")) {
372 stateDumpTimes.push_back(string2time(timeStr));
373 }
374 if (myOptions.isSet("save-state.files")) {
375 stateDumpFiles = myOptions.getStringVector("save-state.files");
376 if (stateDumpFiles.size() != stateDumpTimes.size()) {
377 throw ProcessError("Wrong number of state file names!");
378 }
379 } else {
380 const std::string prefix = myOptions.getString("save-state.prefix");
381 const std::string suffix = myOptions.getString("save-state.suffix");
382 for (std::vector<SUMOTime>::iterator i = stateDumpTimes.begin(); i != stateDumpTimes.end(); ++i) {
383 std::string timeStamp = time2string(*i);
384 std::replace(timeStamp.begin(), timeStamp.end(), ':', '-');
385 stateDumpFiles.push_back(prefix + "_" + timeStamp + suffix);
386 }
387 }
388 } catch (ProcessError&) {
391 delete edges;
392 delete junctions;
393 delete routeLoaders;
394 delete tlc;
395 throw;
396 }
397 // if anthing goes wrong after this point, the net is responsible for cleaning up
398 myNet.closeBuilding(myOptions, edges, junctions, routeLoaders, tlc, stateDumpTimes, stateDumpFiles,
402}
403
404
405bool
406NLBuilder::load(const std::string& mmlWhat, const bool isNet) {
407 if (!myOptions.isUsableFileList(mmlWhat)) {
408 return false;
409 }
410 std::vector<std::string> files = myOptions.getStringVector(mmlWhat);
411 for (std::vector<std::string>::const_iterator fileIt = files.begin(); fileIt != files.end(); ++fileIt) {
412 const long before = PROGRESS_BEGIN_TIME_MESSAGE("Loading " + mmlWhat + " from '" + *fileIt + "'");
413 if (!XMLSubSys::runParser(myXMLHandler, *fileIt, isNet)) {
414 WRITE_MESSAGE("Loading of " + mmlWhat + " failed.");
415 return false;
416 }
417 PROGRESS_TIME_MESSAGE(before);
418 }
419 return true;
420}
421
422
425 // build the loaders
426 SUMORouteLoaderControl* loaders = new SUMORouteLoaderControl(string2time(oc.getString("route-steps")));
427 // check whether a list is existing
428 if (oc.isSet("route-files") && string2time(oc.getString("route-steps")) > 0) {
429 std::vector<std::string> files = oc.getStringVector("route-files");
430 for (std::vector<std::string>::const_iterator fileIt = files.begin(); fileIt != files.end(); ++fileIt) {
431 if (!FileHelpers::isReadable(*fileIt)) {
432 throw ProcessError("The route file '" + *fileIt + "' is not accessible.");
433 }
434 }
435 // open files for reading
436 for (std::vector<std::string>::const_iterator fileIt = files.begin(); fileIt != files.end(); ++fileIt) {
437 loaders->add(new SUMORouteLoader(new MSRouteHandler(*fileIt, false)));
438 }
439 }
440 return loaders;
441}
442
443
444void
445NLBuilder::buildDefaultMeanData(const std::string& optionName, const std::string& id, bool useLanes) {
446 if (OptionsCont::getOptions().isSet(optionName)) {
447 try {
448 myDetectorBuilder.createEdgeLaneMeanData(id, -1, 0, -1, "traffic", useLanes, false, false,
449 false, false, false, 100000, 0, SUMO_const_haltingSpeed, "", "", std::vector<MSEdge*>(), false,
450 OptionsCont::getOptions().getString(optionName));
451 } catch (InvalidArgument& e) {
452 WRITE_ERROR(e.what());
453 } catch (IOError& e) {
454 WRITE_ERROR(e.what());
455 }
456 }
457}
458
459/****************************************************************************/
long long int SUMOTime
Definition: GUI.h:36
#define WRITE_WARNINGF(...)
Definition: MsgHandler.h:266
#define WRITE_MESSAGE(msg)
Definition: MsgHandler.h:267
#define WRITE_ERROR(msg)
Definition: MsgHandler.h:274
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:265
#define PROGRESS_BEGIN_TIME_MESSAGE(msg)
Definition: MsgHandler.h:271
#define TL(string)
Definition: MsgHandler.h:282
#define PROGRESS_TIME_MESSAGE(before)
Definition: MsgHandler.h:272
std::string time2string(SUMOTime t)
convert SUMOTime to string
Definition: SUMOTime.cpp:68
SUMOTime string2time(const std::string &r)
convert string to SUMOTime
Definition: SUMOTime.cpp:45
const double SUMO_const_haltingSpeed
the speed threshold at which vehicles are considered as halting
Definition: StdDefs.h:58
static bool isReadable(std::string path)
Checks whether the given file is readable.
Definition: FileHelpers.cpp:51
The class responsible for building and deletion of vehicles (gui-version)
static SumoRNG * getRecognitionRNG()
static SumoRNG * getResponseTimeRNG()
Definition: MSDevice_ToC.h:176
static SumoRNG * getEquipmentRNG()
Definition: MSDevice.h:88
Stores edges and lanes, performs moving of vehicle.
Definition: MSEdgeControl.h:81
void setMesoTypes()
update meso edge type parameters
void setAdditionalRestrictions()
apply additional restrictions
A road/street connecting two junctions.
Definition: MSEdge.h:77
void setOtherTazConnector(const MSEdge *edge)
Definition: MSEdge.h:292
static void clear()
Clears the dictionary.
Definition: MSEdge.cpp:990
void addSuccessor(MSEdge *edge, const MSEdge *via=nullptr)
Adds an edge to the list of edges which may be reached from this edge and to the incoming of the othe...
Definition: MSEdge.cpp:1140
void initialize(const std::vector< MSLane * > *lanes)
Initialize the edge.
Definition: MSEdge.cpp:101
static bool dictionary(const std::string &id, MSEdge *edge)
Inserts edge into the static dictionary Returns true if the key id isn't already in the dictionary....
Definition: MSEdge.cpp:945
void addTravelTime(const MSEdge *const e, double begin, double end, double value)
Adds a travel time information for an edge and a time span.
void addEffort(const MSEdge *const e, double begin, double end, double value)
Adds an effort information for an edge and a time span.
Stores time-dependant events and executes them at the proper time.
static void buildStreams()
Builds the streams used possibly by the simulation.
Definition: MSFrame.cpp:750
static void setMSGlobals(OptionsCont &oc)
Sets the global microsim-options.
Definition: MSFrame.cpp:993
static void fillOptions()
Inserts options used by the simulation into the OptionsCont-singleton.
Definition: MSFrame.cpp:60
static bool checkOptions()
Checks the set options.
Definition: MSFrame.cpp:792
static bool gUseMesoSim
Definition: MSGlobals.h:103
Container for junctions; performs operations on all stored junctions.
void postloadInitContainer()
Closes building of junctions.
The base class for an intersection.
Definition: MSJunction.h:58
const ConstMSEdgeVector & getOutgoing() const
Definition: MSJunction.h:111
const ConstMSEdgeVector & getIncoming() const
Definition: MSJunction.h:105
static void clear()
Clears the dictionary.
Definition: MSLane.cpp:2222
static void initRNGs(const OptionsCont &oc)
initialize rngs
Definition: MSLane.cpp:4220
The simulated network and simulation perfomer.
Definition: MSNet.h:88
MSTLLogicControl & getTLSControl()
Returns the tls logics control.
Definition: MSNet.h:452
void closeBuilding(const OptionsCont &oc, MSEdgeControl *edges, MSJunctionControl *junctions, SUMORouteLoaderControl *routeLoaders, MSTLLogicControl *tlc, std::vector< SUMOTime > stateDumpTimes, std::vector< std::string > stateDumpFiles, bool hasInternalLinks, bool junctionHigherSpeeds, double version)
Closes the network's building process.
Definition: MSNet.cpp:256
MSJunctionControl & getJunctionControl()
Returns the junctions control.
Definition: MSNet.h:462
void setCurrentTimeStep(const SUMOTime step)
Sets the current simulation step (used by state loading)
Definition: MSNet.h:329
MSEdgeWeightsStorage & getWeightsStorage()
Returns the net's internal edge travel times/efforts container.
Definition: MSNet.cpp:1119
ShapeContainer & getShapeContainer()
Returns the shapes container.
Definition: MSNet.h:502
MSVehicleControl & getVehicleControl()
Returns the vehicle control.
Definition: MSNet.h:379
void loadRoutes()
loads routes for the next few steps
Definition: MSNet.cpp:426
MSEdgeControl & getEdgeControl()
Returns the edge control.
Definition: MSNet.h:422
Parser and container for routes during their loading.
static SumoRNG * getParsingRNG()
get parsing RNG
static SUMOTime getTime(const std::string &fileName)
parse time from state file
Parser and output filter for routes and vehicles state saving and loading.
A class that stores and controls tls and switching of their programs.
std::vector< MSTrafficLightLogic * > getAllLogics() const
Returns a vector which contains all logics.
void switchOffAll()
switch all logic variants to 'off'
The parent class for traffic light logics.
static void checkParkingRerouteConsistency()
issues warning for incomplete parkingReroute relationships
The class responsible for building and deletion of vehicles.
int getLoadedVehicleNo() const
Returns the number of build vehicles.
static MsgHandler * getErrorInstance()
Returns the instance to add errors to.
Definition: MsgHandler.cpp:79
static void initOutputOptions()
init output options
Definition: MsgHandler.cpp:255
static MsgHandler * getWarningInstance()
Returns the instance to add warnings to.
Definition: MsgHandler.cpp:66
static void setFactory(Factory func)
Sets the factory function to use for new MsgHandlers.
Definition: MsgHandler.h:65
virtual void clear(bool resetInformed=true)
Clears information whether an error occurred previously and print aggregated message summary.
Definition: MsgHandler.cpp:161
static MsgHandler * getMessageInstance()
Returns the instance to add normal messages to.
Definition: MsgHandler.cpp:53
static MsgHandler * create(MsgType type)
MSNet & myNet
The network edges shall be obtained from.
Definition: NLBuilder.h:162
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:78
Obtains edge efforts from a weights handler and stores them within the edges.
Definition: NLBuilder.h:172
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:93
The main interface for loading a microsim.
Definition: NLBuilder.h:58
static MSNet * init(const bool isLibsumo=false)
Definition: NLBuilder.cpp:278
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:406
NLDetectorBuilder & myDetectorBuilder
The detector control builder to use.
Definition: NLBuilder.h:209
virtual bool build()
Builds and initialises the simulation.
Definition: NLBuilder.cpp:122
virtual ~NLBuilder()
Destructor.
Definition: NLBuilder.cpp:118
void buildNet()
Closes the net building process.
Definition: NLBuilder.cpp:357
NLBuilder(OptionsCont &oc, MSNet &net, NLEdgeControlBuilder &eb, NLJunctionControlBuilder &jb, NLDetectorBuilder &db, NLHandler &xmlHandler)
Constructor.
Definition: NLBuilder.cpp:107
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:424
void buildDefaultMeanData(const std::string &optionName, const std::string &id, bool useLanes)
build meanData definition based on option
Definition: NLBuilder.cpp:445
NLEdgeControlBuilder & myEdgeBuilder
The edge control builder to use.
Definition: NLBuilder.h:203
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:345
NLHandler & myXMLHandler
The handler used to parse the net.
Definition: NLBuilder.h:215
Builds detectors for microsim.
void createEdgeLaneMeanData(const std::string &id, SUMOTime frequency, SUMOTime begin, SUMOTime end, const std::string &type, const bool useLanes, const bool withEmpty, const bool printDefaults, const bool withInternal, const bool trackVehicles, const int detectPersons, const double maxTravelTime, const double minSamples, const double haltSpeed, const std::string &vTypes, const std::string &writeAttributes, std::vector< MSEdge * > edges, bool aggregate, const std::string &device)
Creates edge based mean data collector using the given specification.
Interface for building edges.
MSEdgeControl * build(double networkVersion)
builds the MSEdgeControl-class which holds all edges
virtual MSEdge * buildEdge(const std::string &id, const SumoXMLEdgeFunc function, const std::string &streetName, const std::string &edgeType, const int priority, const double distance)
Builds an edge instance (MSEdge in this case)
The XML-Handler for network loading.
Definition: NLHandler.h:79
bool haveSeenAdditionalSpeedRestrictions() const
Definition: NLHandler.h:119
bool haveSeenInternalEdge() const
Definition: NLHandler.h:103
bool hasJunctionHigherSpeeds() const
Definition: NLHandler.h:107
double networkVersion() const
Definition: NLHandler.h:127
bool haveSeenDefaultLength() const
Definition: NLHandler.h:111
bool haveSeenMesoEdgeType() const
Definition: NLHandler.h:123
Builder of microsim-junctions and tls.
MSTLLogicControl * buildTLLogics()
Returns the built tls-logic control.
MSJunctionControl * build() const
Builds the MSJunctionControl which holds all of the simulations junctions.
The XML-Handler for shapes loading network loading.
Definition: NLHandler.h:55
Builds trigger objects for microsim.
void setHandler(NLHandler *handler)
Sets the parent handler to use for nested parsing.
IDMap::const_iterator begin() const
Returns a reference to the begin iterator for the internal map.
IDMap::const_iterator end() const
Returns a reference to the end iterator for the internal map.
static SumoRNG * getRNG()
Definition: MSDriverState.h:78
A storage for options typed value containers)
Definition: OptionsCont.h:89
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
int getInt(const std::string &name) const
Returns the int-value of the named option (only for Option_Integer)
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
bool isDefault(const std::string &name) const
Returns the information whether the named option has still the default value.
void clear()
Removes all information from the container.
bool set(const std::string &name, const std::string &value, const bool append=false)
Sets the given value for the named option.
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
const StringVector & getStringVector(const std::string &name) const
Returns the list of string-value of the named option (only for Option_StringVector)
static OptionsCont & getOptions()
Retrieves the options.
Definition: OptionsCont.cpp:59
bool processMetaOptions(bool missingOptions)
Checks for help and configuration output, returns whether we should exit.
bool isUsableFileList(const std::string &name) const
Checks whether the named option is usable as a file list (with at least a single file)
static int getArgC()
Return the number of command line arguments.
Definition: OptionsIO.h:63
static void getOptions(const bool commandLineOnly=false)
Parses the command line arguments and loads the configuration.
Definition: OptionsIO.cpp:74
static void initRandGlobal(SumoRNG *which=nullptr)
Reads the given random number options and initialises the random number generator in accordance.
Definition: RandHelper.cpp:87
Complete definition about what shall be retrieved and where to store it.
An XML-handler for network weights.
void add(SUMORouteLoader *loader)
add another loader
static bool loadFiles(const std::vector< std::string > &files, ShapeHandler &sh)
loads all of the given files
static void close()
Closes all of an applications subsystems.
static bool checkOptions()
checks shared options and sets StdDefs
void stateLoaded(SUMOTime targetTime)
updates myTargetTime and resets vehicle state changes after loading a simulation state
static TraCIServer * getInstance()
Definition: TraCIServer.h:68
static void openSocket(const std::map< int, CmdExecutor > &execs)
Initialises the server.
static void setValidation(const std::string &validationScheme, const std::string &netValidationScheme, const std::string &routeValidationScheme)
Enables or disables validation.
Definition: XMLSubSys.cpp:65
static bool runParser(GenericSAXHandler &handler, const std::string &file, const bool isNet=false, const bool isRoute=false)
Runs the given handler on the given file; returns if everything's ok.
Definition: XMLSubSys.cpp:137
static void registerStateListener()
Definition: Helper.cpp:689