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-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 /****************************************************************************/
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 
32 #include <utils/options/Option.h>
37 #include <utils/common/SysUtils.h>
38 #include <utils/common/ToString.h>
41 #include <utils/xml/XMLSubSys.h>
42 #ifdef HAVE_FOX
44 #endif
48 #include <microsim/MSNet.h>
51 #include <microsim/MSEdgeControl.h>
52 #include <microsim/MSGlobals.h>
54 #include <microsim/MSFrame.h>
57 #include <microsim/MSDriverState.h>
59 
60 #include "NLHandler.h"
61 #include "NLEdgeControlBuilder.h"
63 #include "NLDetectorBuilder.h"
64 #include "NLTriggerBuilder.h"
65 #include "NLBuilder.h"
66 
67 
68 // ===========================================================================
69 // method definitions
70 // ===========================================================================
71 // ---------------------------------------------------------------------------
72 // NLBuilder::EdgeFloatTimeLineRetriever_EdgeWeight - methods
73 // ---------------------------------------------------------------------------
74 void
76  double value, double begTime, double endTime) const {
77  MSEdge* edge = MSEdge::dictionary(id);
78  if (edge != nullptr) {
79  myNet.getWeightsStorage().addEffort(edge, begTime, endTime, value);
80  } else {
81  WRITE_ERROR("Trying to set the effort for the unknown edge '" + id + "'.");
82  }
83 }
84 
85 
86 // ---------------------------------------------------------------------------
87 // NLBuilder::EdgeFloatTimeLineRetriever_EdgeTravelTime - methods
88 // ---------------------------------------------------------------------------
89 void
91  double value, double begTime, double endTime) const {
92  MSEdge* edge = MSEdge::dictionary(id);
93  if (edge != nullptr) {
94  myNet.getWeightsStorage().addTravelTime(edge, begTime, endTime, value);
95  } else {
96  WRITE_ERROR("Trying to set the travel time for the unknown edge '" + id + "'.");
97  }
98 }
99 
100 
101 // ---------------------------------------------------------------------------
102 // NLBuilder - methods
103 // ---------------------------------------------------------------------------
105  MSNet& net,
108  NLDetectorBuilder& db,
109  NLHandler& xmlHandler)
110  : myOptions(oc), myEdgeBuilder(eb), myJunctionBuilder(jb),
111  myDetectorBuilder(db),
112  myNet(net), myXMLHandler(xmlHandler) {}
113 
114 
116 
117 
118 bool
120  // try to build the net
121  if (!load("net-file", true)) {
122  return false;
123  }
124  if (myXMLHandler.networkVersion() == 0.) {
125  throw ProcessError("Invalid network, no network version declared.");
126  }
127  // check whether the loaded net agrees with the simulation options
128  if ((myOptions.getBool("no-internal-links") || myOptions.getBool("mesosim")) && myXMLHandler.haveSeenInternalEdge() && myXMLHandler.haveSeenDefaultLength()) {
129  WRITE_WARNING("Network contains internal links which are ignored. Vehicles will 'jump' across junctions and thus underestimate route lengths and travel times.");
130  }
131  buildNet();
132  // @note on loading order constraints:
133  // - additional-files before route-files and state-files due to referencing
134  // - 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
135 
136  // load additional net elements (sources, detectors, ...)
137  if (myOptions.isSet("additional-files")) {
138  if (!load("additional-files")) {
139  return false;
140  }
141  // load shapes with separate handler
143  if (!ShapeHandler::loadFiles(myOptions.getStringVector("additional-files"), sh)) {
144  return false;
145  }
148  }
152  tll->initMesoTLSPenalties();
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 addd 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("A TAZ with id '%' already exists. Not building junction TAZ.", it->first)
185  }
186  }
187  }
188  // load weights if wished
189  if (myOptions.isSet("weight-files")) {
190  if (!myOptions.isUsableFileList("weight-files")) {
191  return false;
192  }
193  // build and prepare the weights handler
194  std::vector<SAXWeightsHandler::ToRetrieveDefinition*> retrieverDefs;
195  // travel time, first (always used)
197  retrieverDefs.push_back(new SAXWeightsHandler::ToRetrieveDefinition("traveltime", true, ttRetriever));
198  // the measure to use, then
200  std::string measure = myOptions.getString("weight-attribute");
201  if (!myOptions.isDefault("weight-attribute")) {
202  if (measure == "CO" || measure == "CO2" || measure == "HC" || measure == "PMx" || measure == "NOx" || measure == "fuel" || measure == "electricity") {
203  measure += "_perVeh";
204  }
205  retrieverDefs.push_back(new SAXWeightsHandler::ToRetrieveDefinition(measure, true, eRetriever));
206  }
207  // set up handler
208  SAXWeightsHandler handler(retrieverDefs, "");
209  // start parsing; for each file in the list
210  std::vector<std::string> files = myOptions.getStringVector("weight-files");
211  for (std::vector<std::string>::iterator i = files.begin(); i != files.end(); ++i) {
212  // report about loading when wished
213  WRITE_MESSAGE("Loading weights from '" + *i + "'...");
214  // parse the file
215  if (!XMLSubSys::runParser(handler, *i)) {
216  return false;
217  }
218  }
219  }
220  // load the previous state if wished
221  if (myOptions.isSet("load-state")) {
222  const std::string& f = myOptions.getString("load-state");
223  long before = PROGRESS_BEGIN_TIME_MESSAGE("Loading state from '" + f + "'");
224  MSStateHandler h(f, string2time(myOptions.getString("load-state.offset")));
225  XMLSubSys::runParser(h, f);
226  if (myOptions.isDefault("begin")) {
227  myOptions.set("begin", time2string(h.getTime()));
228  if (TraCIServer::getInstance() != nullptr) {
230  }
231  }
232  if (MsgHandler::getErrorInstance()->wasInformed()) {
233  return false;
234  }
235  if (h.getTime() != string2time(myOptions.getString("begin"))) {
236  WRITE_WARNING("State was written at a different time " + time2string(h.getTime()) + " than the begin time " + myOptions.getString("begin") + "!");
237  }
238  PROGRESS_TIME_MESSAGE(before);
239  }
240  // load routes
241  if (myOptions.isSet("route-files") && string2time(myOptions.getString("route-steps")) <= 0) {
242  if (!load("route-files")) {
243  return false;
244  }
245  }
246  // optionally switch off traffic lights
247  if (myOptions.getBool("tls.all-off")) {
249  }
250  WRITE_MESSAGE("Loading done.");
251  return true;
252 }
253 
254 
255 MSNet*
256 NLBuilder::init(const bool isLibsumo) {
258  oc.clear();
261  if (oc.processMetaOptions(OptionsIO::getArgC() < 2)) {
263  return nullptr;
264  }
266  XMLSubSys::setValidation(oc.getString("xml-validation"), oc.getString("xml-validation.net"), oc.getString("xml-validation.routes"));
267  if (!MSFrame::checkOptions()) {
268  throw ProcessError();
269  }
270 #ifdef HAVE_FOX
271  if (oc.getInt("threads") > 1) {
272  // make the output aware of threading
274  }
275 #endif
277  initRandomness();
279  MSVehicleControl* vc = nullptr;
281  vc = new MEVehicleControl();
282  } else {
283  vc = new MSVehicleControl();
284  }
285  MSNet* net = new MSNet(vc, new MSEventControl(), new MSEventControl(), new MSEventControl());
286  // need to init TraCI-Server before loading routes to catch VEHICLE_STATE_BUILT
287  TraCIServer::openSocket(std::map<int, TraCIServer::CmdExecutor>());
288  if (isLibsumo) {
290  }
291 
293  NLDetectorBuilder db(*net);
294  NLJunctionControlBuilder jb(*net, db);
295  NLTriggerBuilder tb;
296  NLHandler handler("", *net, db, tb, eb, jb);
297  tb.setHandler(&handler);
298  NLBuilder builder(oc, *net, eb, jb, db, handler);
302  if (builder.build()) {
303  // preload the routes especially for TraCI
304  net->loadRoutes();
305  return net;
306  }
307  delete net;
308  throw ProcessError();
309 }
310 
311 void
319 }
320 
321 void
323  MSEdgeControl* edges = nullptr;
324  MSJunctionControl* junctions = nullptr;
325  SUMORouteLoaderControl* routeLoaders = nullptr;
326  MSTLLogicControl* tlc = nullptr;
327  std::vector<SUMOTime> stateDumpTimes;
328  std::vector<std::string> stateDumpFiles;
329  try {
330  MSFrame::buildStreams(); // ensure streams are ready for output during building
332  junctions = myJunctionBuilder.build();
333  junctions->postloadInitContainer();
334  routeLoaders = buildRouteLoaderControl(myOptions);
336  for (std::string timeStr : myOptions.getStringVector("save-state.times")) {
337  stateDumpTimes.push_back(string2time(timeStr));
338  }
339  if (myOptions.isSet("save-state.files")) {
340  stateDumpFiles = myOptions.getStringVector("save-state.files");
341  if (stateDumpFiles.size() != stateDumpTimes.size()) {
342  throw ProcessError("Wrong number of state file names!");
343  }
344  } else {
345  const std::string prefix = myOptions.getString("save-state.prefix");
346  const std::string suffix = myOptions.getString("save-state.suffix");
347  for (std::vector<SUMOTime>::iterator i = stateDumpTimes.begin(); i != stateDumpTimes.end(); ++i) {
348  std::string timeStamp = time2string(*i);
349  std::replace(timeStamp.begin(), timeStamp.end(), ':', '-');
350  stateDumpFiles.push_back(prefix + "_" + timeStamp + suffix);
351  }
352  }
353  } catch (IOError& e) {
354  delete edges;
355  delete junctions;
356  delete routeLoaders;
357  delete tlc;
358  throw ProcessError(e.what());
359  } catch (ProcessError&) {
360  delete edges;
361  delete junctions;
362  delete routeLoaders;
363  delete tlc;
364  throw;
365  }
366  // if anthing goes wrong after this point, the net is responsible for cleaning up
367  myNet.closeBuilding(myOptions, edges, junctions, routeLoaders, tlc, stateDumpTimes, stateDumpFiles,
371 }
372 
373 
374 bool
375 NLBuilder::load(const std::string& mmlWhat, const bool isNet) {
376  if (!myOptions.isUsableFileList(mmlWhat)) {
377  return false;
378  }
379  std::vector<std::string> files = myOptions.getStringVector(mmlWhat);
380  for (std::vector<std::string>::const_iterator fileIt = files.begin(); fileIt != files.end(); ++fileIt) {
381  const long before = PROGRESS_BEGIN_TIME_MESSAGE("Loading " + mmlWhat + " from '" + *fileIt + "'");
382  if (!XMLSubSys::runParser(myXMLHandler, *fileIt, isNet)) {
383  WRITE_MESSAGE("Loading of " + mmlWhat + " failed.");
384  return false;
385  }
386  PROGRESS_TIME_MESSAGE(before);
387  }
388  return true;
389 }
390 
391 
394  // build the loaders
395  SUMORouteLoaderControl* loaders = new SUMORouteLoaderControl(string2time(oc.getString("route-steps")));
396  // check whether a list is existing
397  if (oc.isSet("route-files") && string2time(oc.getString("route-steps")) > 0) {
398  std::vector<std::string> files = oc.getStringVector("route-files");
399  for (std::vector<std::string>::const_iterator fileIt = files.begin(); fileIt != files.end(); ++fileIt) {
400  if (!FileHelpers::isReadable(*fileIt)) {
401  throw ProcessError("The route file '" + *fileIt + "' is not accessible.");
402  }
403  }
404  // open files for reading
405  for (std::vector<std::string>::const_iterator fileIt = files.begin(); fileIt != files.end(); ++fileIt) {
406  loaders->add(new SUMORouteLoader(new MSRouteHandler(*fileIt, false)));
407  }
408  }
409  return loaders;
410 }
411 
412 
413 /****************************************************************************/
#define WRITE_WARNINGF(...)
Definition: MsgHandler.h:277
#define WRITE_MESSAGE(msg)
Definition: MsgHandler.h:278
#define WRITE_ERROR(msg)
Definition: MsgHandler.h:284
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:276
#define PROGRESS_BEGIN_TIME_MESSAGE(msg)
Definition: MsgHandler.h:281
#define PROGRESS_TIME_MESSAGE(before)
Definition: MsgHandler.h:282
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
static bool isReadable(std::string path)
Checks whether the given file is readable.
Definition: FileHelpers.cpp:48
The class responsible for building and deletion of vehicles (gui-version)
static std::mt19937 * getResponseTimeRNG()
Definition: MSDevice_ToC.h:176
static std::mt19937 * 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:283
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:998
void initialize(const std::vector< MSLane * > *lanes)
Initialize the edge.
Definition: MSEdge.cpp:94
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:814
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:618
static void setMSGlobals(OptionsCont &oc)
Sets the global microsim-options.
Definition: MSFrame.cpp:841
static void fillOptions()
Inserts options used by the simulation into the OptionsCont-singleton.
Definition: MSFrame.cpp:59
static bool checkOptions()
Checks the set options.
Definition: MSFrame.cpp:658
static bool gUseMesoSim
Definition: MSGlobals.h:88
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 & getIncoming() const
Definition: MSJunction.h:105
const ConstMSEdgeVector & getOutgoing() const
Definition: MSJunction.h:111
static void initRNGs(const OptionsCont &oc)
initialize rngs
Definition: MSLane.cpp:3803
The simulated network and simulation perfomer.
Definition: MSNet.h:89
MSTLLogicControl & getTLSControl()
Returns the tls logics control.
Definition: MSNet.h:444
ShapeContainer & getShapeContainer()
Returns the shapes container.
Definition: MSNet.h:494
MSJunctionControl & getJunctionControl()
Returns the junctions control.
Definition: MSNet.h:454
MSEdgeControl & getEdgeControl()
Returns the edge control.
Definition: MSNet.h:414
MSEdgeWeightsStorage & getWeightsStorage()
Returns the net's internal edge travel times/efforts container.
Definition: MSNet.cpp:1009
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 hasNeighs, double version)
Closes the network's building process.
Definition: MSNet.cpp:243
void loadRoutes()
loads routes for the next few steps
Definition: MSNet.cpp:410
Parser and container for routes during their loading.
static std::mt19937 * getParsingRNG()
get parsing RNG
Parser and output filter for routes and vehicles state saving and loading.
SUMOTime getTime() const
get time
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.
The class responsible for building and deletion of vehicles.
static MsgHandler * getErrorInstance()
Returns the instance to add errors to.
Definition: MsgHandler.cpp:80
static void initOutputOptions()
init output options
Definition: MsgHandler.cpp:217
static MsgHandler * getWarningInstance()
Returns the instance to add warnings to.
Definition: MsgHandler.cpp:67
static void setFactory(Factory func)
Sets the factory function to use for new MsgHandlers.
Definition: MsgHandler.h:61
virtual void clear(bool resetInformed=true)
Clears information whether an error occurred previously and print aggregated message summary.
Definition: MsgHandler.cpp:159
static MsgHandler * getMessageInstance()
Returns the instance to add normal messages to.
Definition: MsgHandler.cpp:54
static MsgHandler * create(MsgType type)
MSNet & myNet
The network edges shall be obtained from.
Definition: NLBuilder.h:164
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
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
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
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
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.
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:115
bool haveSeenInternalEdge() const
Definition: NLHandler.h:103
double networkVersion() const
Definition: NLHandler.h:123
bool haveSeenDefaultLength() const
Definition: NLHandler.h:107
bool haveSeenNeighs() const
Definition: NLHandler.h:111
bool haveSeenMesoEdgeType() const
Definition: NLHandler.h:119
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 std::mt19937 * 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.
bool set(const std::string &name, const std::string &value)
Sets the given value for the named option.
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 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:58
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:79
static void initRandGlobal(std::mt19937 *which=nullptr)
Reads the given random number options and initialises the random number generator in accordance.
Definition: RandHelper.cpp:76
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 void openSocket(const std::map< int, CmdExecutor > &execs)
Initialises the server.
static TraCIServer * getInstance()
Definition: TraCIServer.h:68
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:148
static void registerVehicleStateListener()
Definition: Helper.cpp:538