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-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
16 // The main interface for loading a microsim
17 /****************************************************************************/
18 
19 
20 // ===========================================================================
21 // included modules
22 // ===========================================================================
23 #include <config.h>
24 
25 #include <iostream>
26 #include <vector>
27 #include <string>
28 #include <map>
29 
34 #include <utils/options/Option.h>
39 #include <utils/common/SysUtils.h>
40 #include <utils/common/ToString.h>
43 #include <utils/xml/XMLSubSys.h>
44 #ifdef HAVE_FOX
46 #endif
50 #include <microsim/MSNet.h>
52 #include <microsim/MSEdgeControl.h>
53 #include <microsim/MSGlobals.h>
55 #include <microsim/MSFrame.h>
58 #include <microsim/MSDriverState.h>
60 
61 #include "NLHandler.h"
62 #include "NLEdgeControlBuilder.h"
64 #include "NLDetectorBuilder.h"
65 #include "NLTriggerBuilder.h"
66 #include "NLBuilder.h"
67 
68 
69 // ===========================================================================
70 // method definitions
71 // ===========================================================================
72 // ---------------------------------------------------------------------------
73 // NLBuilder::EdgeFloatTimeLineRetriever_EdgeWeight - methods
74 // ---------------------------------------------------------------------------
75 void
77  double value, double begTime, double endTime) const {
78  MSEdge* edge = MSEdge::dictionary(id);
79  if (edge != nullptr) {
80  myNet.getWeightsStorage().addEffort(edge, begTime, endTime, value);
81  } else {
82  WRITE_ERROR("Trying to set the effort for the unknown edge '" + id + "'.");
83  }
84 }
85 
86 
87 // ---------------------------------------------------------------------------
88 // NLBuilder::EdgeFloatTimeLineRetriever_EdgeTravelTime - methods
89 // ---------------------------------------------------------------------------
90 void
92  double value, double begTime, double endTime) const {
93  MSEdge* edge = MSEdge::dictionary(id);
94  if (edge != nullptr) {
95  myNet.getWeightsStorage().addTravelTime(edge, begTime, endTime, value);
96  } else {
97  WRITE_ERROR("Trying to set the travel time for the unknown edge '" + id + "'.");
98  }
99 }
100 
101 
102 // ---------------------------------------------------------------------------
103 // NLBuilder - methods
104 // ---------------------------------------------------------------------------
106  MSNet& net,
109  NLDetectorBuilder& db,
110  NLHandler& xmlHandler)
111  : myOptions(oc), myEdgeBuilder(eb), myJunctionBuilder(jb),
112  myDetectorBuilder(db),
113  myNet(net), myXMLHandler(xmlHandler) {}
114 
115 
117 
118 
119 bool
121  // try to build the net
122  if (!load("net-file", true)) {
123  return false;
124  }
125  if (myXMLHandler.networkVersion() == 0.) {
126  throw ProcessError("Invalid network, no network version declared.");
127  }
128  // check whether the loaded net agrees with the simulation options
129  if (myOptions.getBool("no-internal-links") && myXMLHandler.haveSeenInternalEdge()) {
130  WRITE_WARNING("Network contains internal links but option --no-internal-links is set. Vehicles will 'jump' across junctions and thus underestimate route lengths and travel times.");
131  }
132  buildNet();
133  // @note on loading order constraints:
134  // - additional-files before route-files and state-files due to referencing
135  // - 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
136 
137  // load additional net elements (sources, detectors, ...)
138  if (myOptions.isSet("additional-files")) {
139  if (!load("additional-files")) {
140  return false;
141  }
142  // load shapes with separate handler
144  if (!ShapeHandler::loadFiles(myOptions.getStringVector("additional-files"), sh)) {
145  return false;
146  }
149  }
150  }
151  // load weights if wished
152  if (myOptions.isSet("weight-files")) {
153  if (!myOptions.isUsableFileList("weight-files")) {
154  return false;
155  }
156  // build and prepare the weights handler
157  std::vector<SAXWeightsHandler::ToRetrieveDefinition*> retrieverDefs;
158  // travel time, first (always used)
160  retrieverDefs.push_back(new SAXWeightsHandler::ToRetrieveDefinition("traveltime", true, ttRetriever));
161  // the measure to use, then
163  std::string measure = myOptions.getString("weight-attribute");
164  if (!myOptions.isDefault("weight-attribute")) {
165  if (measure == "CO" || measure == "CO2" || measure == "HC" || measure == "PMx" || measure == "NOx" || measure == "fuel" || measure == "electricity") {
166  measure += "_perVeh";
167  }
168  retrieverDefs.push_back(new SAXWeightsHandler::ToRetrieveDefinition(measure, true, eRetriever));
169  }
170  // set up handler
171  SAXWeightsHandler handler(retrieverDefs, "");
172  // start parsing; for each file in the list
173  std::vector<std::string> files = myOptions.getStringVector("weight-files");
174  for (std::vector<std::string>::iterator i = files.begin(); i != files.end(); ++i) {
175  // report about loading when wished
176  WRITE_MESSAGE("Loading weights from '" + *i + "'...");
177  // parse the file
178  if (!XMLSubSys::runParser(handler, *i)) {
179  return false;
180  }
181  }
182  }
183  // load the previous state if wished
184  if (myOptions.isSet("load-state")) {
185  const std::string& f = myOptions.getString("load-state");
186  long before = PROGRESS_BEGIN_TIME_MESSAGE("Loading state from '" + f + "'");
187  MSStateHandler h(f, string2time(myOptions.getString("load-state.offset")));
188  XMLSubSys::runParser(h, f);
189  if (myOptions.isDefault("begin")) {
190  myOptions.set("begin", time2string(h.getTime()));
191  if (TraCIServer::getInstance() != nullptr) {
193  }
194  }
196  return false;
197  }
198  if (h.getTime() != string2time(myOptions.getString("begin"))) {
199  WRITE_WARNING("State was written at a different time " + time2string(h.getTime()) + " than the begin time " + myOptions.getString("begin") + "!");
200  }
201  PROGRESS_TIME_MESSAGE(before);
202  }
203  // load routes
204  if (myOptions.isSet("route-files") && string2time(myOptions.getString("route-steps")) <= 0) {
205  if (!load("route-files")) {
206  return false;
207  }
208  }
209  // optionally switch off traffic lights
210  if (myOptions.getBool("tls.all-off")) {
212  }
213  WRITE_MESSAGE("Loading done.");
214  return true;
215 }
216 
217 
218 MSNet*
221  oc.clear();
224  if (oc.processMetaOptions(OptionsIO::getArgC() < 2)) {
226  return nullptr;
227  }
228  XMLSubSys::setValidation(oc.getString("xml-validation"), oc.getString("xml-validation.net"));
229  if (!MSFrame::checkOptions()) {
230  throw ProcessError();
231  }
232 #ifdef HAVE_FOX
233  if (oc.getInt("threads") > 1) {
234  // make the output aware of threading
236  }
237 #endif
239  initRandomness();
241  MSVehicleControl* vc = nullptr;
243  vc = new MEVehicleControl();
244  } else {
245  vc = new MSVehicleControl();
246  }
247  MSNet* net = new MSNet(vc, new MSEventControl(), new MSEventControl(), new MSEventControl());
248  // need to init TraCI-Server before loading routes to catch VEHICLE_STATE_BUILT
249  TraCIServer::openSocket(std::map<int, TraCIServer::CmdExecutor>());
250 
252  NLDetectorBuilder db(*net);
253  NLJunctionControlBuilder jb(*net, db);
254  NLTriggerBuilder tb;
255  NLHandler handler("", *net, db, tb, eb, jb);
256  tb.setHandler(&handler);
257  NLBuilder builder(oc, *net, eb, jb, db, handler);
261  if (builder.build()) {
262  // preload the routes especially for TraCI
263  net->loadRoutes();
264  return net;
265  }
266  delete net;
267  throw ProcessError();
268 }
269 
270 void
277 }
278 
279 void
281  MSEdgeControl* edges = nullptr;
282  MSJunctionControl* junctions = nullptr;
283  SUMORouteLoaderControl* routeLoaders = nullptr;
284  MSTLLogicControl* tlc = nullptr;
285  std::vector<SUMOTime> stateDumpTimes;
286  std::vector<std::string> stateDumpFiles;
287  try {
288  MSFrame::buildStreams(); // ensure streams are ready for output during building
290  junctions = myJunctionBuilder.build();
291  junctions->postloadInitContainer();
292  routeLoaders = buildRouteLoaderControl(myOptions);
294  const std::vector<int> times = myOptions.getIntVector("save-state.times");
295  for (std::vector<int>::const_iterator i = times.begin(); i != times.end(); ++i) {
296  stateDumpTimes.push_back(TIME2STEPS(*i));
297  }
298  if (myOptions.isSet("save-state.files")) {
299  stateDumpFiles = myOptions.getStringVector("save-state.files");
300  if (stateDumpFiles.size() != stateDumpTimes.size()) {
301  WRITE_ERROR("Wrong number of state file names!");
302  }
303  } else {
304  const std::string prefix = myOptions.getString("save-state.prefix");
305  const std::string suffix = myOptions.getString("save-state.suffix");
306  for (std::vector<SUMOTime>::iterator i = stateDumpTimes.begin(); i != stateDumpTimes.end(); ++i) {
307  stateDumpFiles.push_back(prefix + "_" + time2string(*i) + suffix);
308  }
309  }
310  } catch (IOError& e) {
311  delete edges;
312  delete junctions;
313  delete routeLoaders;
314  delete tlc;
315  throw ProcessError(e.what());
316  } catch (ProcessError&) {
317  delete edges;
318  delete junctions;
319  delete routeLoaders;
320  delete tlc;
321  throw;
322  }
323  // if anthing goes wrong after this point, the net is responsible for cleaning up
324  myNet.closeBuilding(myOptions, edges, junctions, routeLoaders, tlc, stateDumpTimes, stateDumpFiles,
329 }
330 
331 
332 bool
333 NLBuilder::load(const std::string& mmlWhat, const bool isNet) {
334  if (!myOptions.isUsableFileList(mmlWhat)) {
335  return false;
336  }
337  std::vector<std::string> files = myOptions.getStringVector(mmlWhat);
338  for (std::vector<std::string>::const_iterator fileIt = files.begin(); fileIt != files.end(); ++fileIt) {
339  const long before = PROGRESS_BEGIN_TIME_MESSAGE("Loading " + mmlWhat + " from '" + *fileIt + "'");
340  if (!XMLSubSys::runParser(myXMLHandler, *fileIt, isNet)) {
341  WRITE_MESSAGE("Loading of " + mmlWhat + " failed.");
342  return false;
343  }
344  PROGRESS_TIME_MESSAGE(before);
345  }
346  return true;
347 }
348 
349 
352  // build the loaders
353  SUMORouteLoaderControl* loaders = new SUMORouteLoaderControl(string2time(oc.getString("route-steps")));
354  // check whether a list is existing
355  if (oc.isSet("route-files") && string2time(oc.getString("route-steps")) > 0) {
356  std::vector<std::string> files = oc.getStringVector("route-files");
357  for (std::vector<std::string>::const_iterator fileIt = files.begin(); fileIt != files.end(); ++fileIt) {
358  if (!FileHelpers::isReadable(*fileIt)) {
359  throw ProcessError("The route file '" + *fileIt + "' is not accessible.");
360  }
361  }
362  // open files for reading
363  for (std::vector<std::string>::const_iterator fileIt = files.begin(); fileIt != files.end(); ++fileIt) {
364  loaders->add(new SUMORouteLoader(new MSRouteHandler(*fileIt, false)));
365  }
366  }
367  return loaders;
368 }
369 
370 
371 /****************************************************************************/
OptionsCont::isSet
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
Definition: OptionsCont.cpp:135
MSEventControl
Stores time-dependant events and executes them at the proper time.
Definition: MSEventControl.h:49
MSFrame::fillOptions
static void fillOptions()
Inserts options used by the simulation into the OptionsCont-singleton.
Definition: MSFrame.cpp:60
NLBuilder::initRandomness
static void initRandomness()
initializes all RNGs
Definition: NLBuilder.cpp:271
OptionsCont::getInt
int getInt(const std::string &name) const
Returns the int-value of the named option (only for Option_Integer)
Definition: OptionsCont.cpp:215
OptionsCont::processMetaOptions
bool processMetaOptions(bool missingOptions)
Checks for help and configuration output, returns whether we should exit.
Definition: OptionsCont.cpp:557
ToString.h
XMLSubSys::runParser
static bool runParser(GenericSAXHandler &handler, const std::string &file, const bool isNet=false)
Runs the given handler on the given file; returns if everything's ok.
Definition: XMLSubSys.cpp:112
SUMORouteLoader
Definition: SUMORouteLoader.h:42
TraCIServer::setTargetTime
void setTargetTime(SUMOTime targetTime)
Sets myTargetTime on server and sockets to the given value.
Definition: TraCIServer.cpp:1512
NLBuilder
The main interface for loading a microsim.
Definition: NLBuilder.h:60
NLShapeHandler
The XML-Handler for shapes loading network loading.
Definition: NLHandler.h:56
OptionsCont::getIntVector
const IntVector & getIntVector(const std::string &name) const
Returns the list of integer-value of the named option (only for Option_IntVector)
Definition: OptionsCont.cpp:229
SystemFrame::close
static void close()
Closes all of an applications subsystems.
Definition: SystemFrame.cpp:133
WRITE_WARNING
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:275
MsgHandler::initOutputOptions
static void initOutputOptions()
init output options
Definition: MsgHandler.cpp:216
PROGRESS_BEGIN_TIME_MESSAGE
#define PROGRESS_BEGIN_TIME_MESSAGE(msg)
Definition: MsgHandler.h:280
MSNet.h
MSEdgeControl::setAdditionalRestrictions
void setAdditionalRestrictions()
apply additional restrictions
Definition: MSEdgeControl.cpp:323
MSDetectorControl.h
NLBuilder::load
bool load(const std::string &mmlWhat, const bool isNet=false)
Loads a described subpart form the given list of files.
Definition: NLBuilder.cpp:333
MSFrame::setMSGlobals
static void setMSGlobals(OptionsCont &oc)
Sets the global microsim-options.
Definition: MSFrame.cpp:713
MsgHandler::wasInformed
bool wasInformed() const
Returns the information whether any messages were added.
Definition: MsgHandler.cpp:279
NLEdgeControlBuilder
Interface for building edges.
Definition: NLEdgeControlBuilder.h:57
NLBuilder.h
MSNet::getShapeContainer
ShapeContainer & getShapeContainer()
Returns the shapes container.
Definition: MSNet.h:459
NLHandler::networkVersion
double networkVersion() const
Definition: NLHandler.h:120
MSJunctionControl::postloadInitContainer
void postloadInitContainer()
Closes building of junctions.
Definition: MSJunctionControl.cpp:42
OptionsCont.h
OptionsCont::set
bool set(const std::string &name, const std::string &value)
Sets the given value for the named option.
Definition: OptionsCont.cpp:241
MSDevice::getEquipmentRNG
static std::mt19937 * getEquipmentRNG()
Definition: MSDevice.h:90
MsgHandler.h
NLHandler::haveSeenAdditionalSpeedRestrictions
bool haveSeenAdditionalSpeedRestrictions() const
Definition: NLHandler.h:112
MSNet
The simulated network and simulation perfomer.
Definition: MSNet.h:91
OptionsCont::getString
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
Definition: OptionsCont.cpp:201
FileHelpers.h
NLBuilder::EdgeFloatTimeLineRetriever_EdgeEffort
Definition: NLBuilder.h:145
NLTriggerBuilder::setHandler
void setHandler(NLHandler *handler)
Sets the parent handler to use for nested parsing.
Definition: NLTriggerBuilder.cpp:66
NLBuilder::myOptions
OptionsCont & myOptions
The options to get the names of the files to load and further information from.
Definition: NLBuilder.h:204
OptionsCont::getBool
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
Definition: OptionsCont.cpp:222
OptionsCont::getOptions
static OptionsCont & getOptions()
Retrieves the options.
Definition: OptionsCont.cpp:57
MSGlobals::gUseMesoSim
static bool gUseMesoSim
Definition: MSGlobals.h:90
NLEdgeControlBuilder::build
MSEdgeControl * build(double networkVersion)
builds the MSEdgeControl-class which holds all edges
Definition: NLEdgeControlBuilder.cpp:182
ShapeHandler::loadFiles
static bool loadFiles(const std::vector< std::string > &files, ShapeHandler &sh)
loads all of the given files
Definition: ShapeHandler.cpp:273
NLTriggerBuilder
Builds trigger objects for microsim.
Definition: NLTriggerBuilder.h:61
PROGRESS_TIME_MESSAGE
#define PROGRESS_TIME_MESSAGE(before)
Definition: MsgHandler.h:281
SUMORouteLoaderControl::add
void add(SUMORouteLoader *loader)
add another loader
Definition: SUMORouteLoaderControl.cpp:53
NLBuilder::~NLBuilder
virtual ~NLBuilder()
Destructor.
Definition: NLBuilder.cpp:116
NLBuilder::EdgeFloatTimeLineRetriever_EdgeTravelTime::addEdgeWeight
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:91
NLHandler::haveSeenInternalEdge
bool haveSeenInternalEdge() const
Definition: NLHandler.h:104
MSTLLogicControl::switchOffAll
void switchOffAll()
switch all logic variants to 'off'
Definition: MSTLLogicControl.cpp:846
MSEdgeWeightsStorage::addEffort
void addEffort(const MSEdge *const e, double begin, double end, double value)
Adds an effort information for an edge and a time span.
Definition: MSEdgeWeightsStorage.cpp:82
MSDevice.h
NLBuilder::EdgeFloatTimeLineRetriever_EdgeTravelTime
Obtains edge efforts from a weights handler and stores them within the edges.
Definition: NLBuilder.h:176
NLBuilder::myJunctionBuilder
NLJunctionControlBuilder & myJunctionBuilder
The junction control builder to use.
Definition: NLBuilder.h:210
OptionsCont::getStringVector
const StringVector & getStringVector(const std::string &name) const
Returns the list of string-value of the named option (only for Option_StringVector)
Definition: OptionsCont.cpp:235
MsgHandler::clear
virtual void clear()
Clears information whether an error occurred previously.
Definition: MsgHandler.cpp:160
NLJunctionControlBuilder
Builder of microsim-junctions and tls.
Definition: NLJunctionControlBuilder.h:62
MsgHandlerSynchronized::create
static MsgHandler * create(MsgType type)
Definition: MsgHandlerSynchronized.h:50
NLHandler.h
BinaryInputDevice.h
MSJunctionControl
Container for junctions; performs operations on all stored junctions.
Definition: MSJunctionControl.h:44
MSStateHandler::getTime
SUMOTime getTime() const
get time
Definition: MSStateHandler.h:59
NLBuilder::buildNet
void buildNet()
Closes the net building process.
Definition: NLBuilder.cpp:280
NLBuilder::myXMLHandler
NLHandler & myXMLHandler
The handler used to parse the net.
Definition: NLBuilder.h:219
MsgHandler::setFactory
static void setFactory(Factory func)
Sets the factory function to use for new MsgHandlers.
Definition: MsgHandler.h:63
SAXWeightsHandler::ToRetrieveDefinition
Complete definition about what shall be retrieved and where to store it.
Definition: SAXWeightsHandler.h:100
OptionsCont::isUsableFileList
bool isUsableFileList(const std::string &name) const
Checks whether the named option is usable as a file list (with at least a single file)
Definition: OptionsCont.cpp:356
MSEdgeWeightsStorage.h
MSLane::initRNGs
static void initRNGs(const OptionsCont &oc)
initialize rngs
Definition: MSLane.cpp:3692
MSNet::getWeightsStorage
MSEdgeWeightsStorage & getWeightsStorage()
Returns the net's internal edge travel times/efforts container.
Definition: MSNet.cpp:832
SystemFrame.h
TIME2STEPS
#define TIME2STEPS(x)
Definition: SUMOTime.h:58
XMLSubSys::setValidation
static void setValidation(const std::string &validationScheme, const std::string &netValidationScheme)
Enables or disables validation.
Definition: XMLSubSys.cpp:58
MsgHandler::getWarningInstance
static MsgHandler * getWarningInstance()
Returns the instance to add warnings to.
Definition: MsgHandler.cpp:68
SysUtils.h
MSEdge::dictionary
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:765
MEVehicleControl.h
NLHandler::haveSeenNeighs
bool haveSeenNeighs() const
Definition: NLHandler.h:108
ProcessError
Definition: UtilExceptions.h:39
NLDetectorBuilder.h
time2string
std::string time2string(SUMOTime t)
Definition: SUMOTime.cpp:67
NLBuilder::EdgeFloatTimeLineRetriever_EdgeEffort::addEdgeWeight
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:76
MSGlobals.h
NLBuilder::init
static MSNet * init()
Definition: NLBuilder.cpp:219
OptionsCont
A storage for options typed value containers)
Definition: OptionsCont.h:89
MSEdge
A road/street connecting two junctions.
Definition: MSEdge.h:78
MEVehicleControl
The class responsible for building and deletion of vehicles (gui-version)
Definition: MEVehicleControl.h:42
MSNet::loadRoutes
void loadRoutes()
loads routes for the next few steps
Definition: MSNet.cpp:381
NLBuilder::myEdgeBuilder
NLEdgeControlBuilder & myEdgeBuilder
The edge control builder to use.
Definition: NLBuilder.h:207
NLEdgeControlBuilder.h
NLHandler::lefthand
bool lefthand() const
Definition: NLHandler.h:116
string2time
SUMOTime string2time(const std::string &r)
Definition: SUMOTime.cpp:44
NLTriggerBuilder.h
TraCIServer::openSocket
static void openSocket(const std::map< int, CmdExecutor > &execs)
Initialises the server.
Definition: TraCIServer.cpp:285
OptionsCont::isDefault
bool isDefault(const std::string &name) const
Returns the information whether the named option has still the default value.
Definition: OptionsCont.cpp:163
NLBuilder::build
virtual bool build()
Builds and initialises the simulation.
Definition: NLBuilder.cpp:120
RandHelper::initRandGlobal
static void initRandGlobal(std::mt19937 *which=0)
Reads the given random number options and initialises the random number generator in accordance.
Definition: RandHelper.cpp:77
NLBuilder::NLBuilder
NLBuilder(OptionsCont &oc, MSNet &net, NLEdgeControlBuilder &eb, NLJunctionControlBuilder &jb, NLDetectorBuilder &db, NLHandler &xmlHandler)
Constructor.
Definition: NLBuilder.cpp:105
MSEdgeControl.h
MSEdgeWeightsStorage::addTravelTime
void addTravelTime(const MSEdge *const e, double begin, double end, double value)
Adds a travel time information for an edge and a time span.
Definition: MSEdgeWeightsStorage.cpp:69
OptionsIO::getOptions
static void getOptions(const bool commandLineOnly=false)
Parses the command line arguments and loads the configuration.
Definition: OptionsIO.cpp:75
MSNet::getTLSControl
MSTLLogicControl & getTLSControl()
Returns the tls logics control.
Definition: MSNet.h:409
NLBuilder::myDetectorBuilder
NLDetectorBuilder & myDetectorBuilder
The detector control builder to use.
Definition: NLBuilder.h:213
StringUtils.h
MSDriverState.h
OptionsIO::getArgC
static int getArgC()
Return the number of command line arguments.
Definition: OptionsIO.h:65
Option.h
MSStateHandler.h
SUMORouteLoaderControl.h
MSRouteHandler::getParsingRNG
static std::mt19937 * getParsingRNG()
get parsing RNG
Definition: MSRouteHandler.h:62
MSRouteHandler
Parser and container for routes during their loading.
Definition: MSRouteHandler.h:53
MsgHandlerSynchronized.h
MSFrame::buildStreams
static void buildStreams()
Builds the streams used possibly by the simulation.
Definition: MSFrame.cpp:533
IOError
Definition: UtilExceptions.h:161
TraCIServer.h
NLBuilder::buildRouteLoaderControl
SUMORouteLoaderControl * buildRouteLoaderControl(const OptionsCont &oc)
Builds the route loader control.
Definition: NLBuilder.cpp:351
NLJunctionControlBuilder.h
MSFrame.h
FileHelpers::isReadable
static bool isReadable(std::string path)
Checks whether the given file is readable.
Definition: FileHelpers.cpp:49
NLHandler
The XML-Handler for network loading.
Definition: NLHandler.h:80
OUProcess::getRNG
static std::mt19937 * getRNG()
Definition: MSDriverState.h:79
config.h
MSVehicleControl
The class responsible for building and deletion of vehicles.
Definition: MSVehicleControl.h:71
MSEdgeControl
Stores edges and lanes, performs moving of vehicle.
Definition: MSEdgeControl.h:74
TraCIServer::getInstance
static TraCIServer * getInstance()
Definition: TraCIServer.h:70
StringTokenizer.h
MSTLLogicControl
A class that stores and controls tls and switching of their programs.
Definition: MSTLLogicControl.h:59
MSNet::closeBuilding
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, bool lefthand, double version)
Closes the network's building process.
Definition: MSNet.cpp:238
MsgHandler::getErrorInstance
static MsgHandler * getErrorInstance()
Returns the instance to add errors to.
Definition: MsgHandler.cpp:81
NLJunctionControlBuilder::build
MSJunctionControl * build() const
Builds the MSJunctionControl which holds all of the simulations junctions.
Definition: NLJunctionControlBuilder.cpp:155
MSNet::getEdgeControl
MSEdgeControl & getEdgeControl()
Returns the edge control.
Definition: MSNet.h:379
SUMORouteLoaderControl
Definition: SUMORouteLoaderControl.h:49
SAXWeightsHandler
An XML-handler for network weights.
Definition: SAXWeightsHandler.h:68
NLJunctionControlBuilder::buildTLLogics
MSTLLogicControl * buildTLLogics()
Returns the built tls-logic control.
Definition: NLJunctionControlBuilder.cpp:445
NLBuilder::myNet
MSNet & myNet
The net to fill.
Definition: NLBuilder.h:216
OptionsCont::clear
void clear()
Removes all information from the container.
Definition: OptionsCont.cpp:456
MSVehicleControl.h
MSVehicleTransfer.h
WRITE_ERROR
#define WRITE_ERROR(msg)
Definition: MsgHandler.h:283
MSFrame::checkOptions
static bool checkOptions()
Checks the set options.
Definition: MSFrame.cpp:565
WRITE_MESSAGE
#define WRITE_MESSAGE(msg)
Definition: MsgHandler.h:277
MSStateHandler
Parser and output filter for routes and vehicles state saving and loading.
Definition: MSStateHandler.h:44
NLDetectorBuilder
Builds detectors for microsim.
Definition: NLDetectorBuilder.h:55
SUMORouteLoader.h
OptionsIO.h
XMLSubSys.h
NLBuilder::EdgeFloatTimeLineRetriever_EdgeEffort::myNet
MSNet & myNet
The network edges shall be obtained from.
Definition: NLBuilder.h:166
MsgHandler::getMessageInstance
static MsgHandler * getMessageInstance()
Returns the instance to add normal messages to.
Definition: MsgHandler.cpp:55