SUMO - Simulation of Urban MObility
NLTriggerBuilder.cpp
Go to the documentation of this file.
1 /****************************************************************************/
12 // Builds trigger objects for microsim
13 /****************************************************************************/
14 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
15 // Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors
16 /****************************************************************************/
17 //
18 // This file is part of SUMO.
19 // SUMO is free software: you can redistribute it and/or modify
20 // it under the terms of the GNU General Public License as published by
21 // the Free Software Foundation, either version 3 of the License, or
22 // (at your option) any later version.
23 //
24 /****************************************************************************/
25 
26 
27 // ===========================================================================
28 // included modules
29 // ===========================================================================
30 #ifdef _MSC_VER
31 #include <windows_config.h>
32 #else
33 #include <config.h>
34 #endif
35 
36 #include <string>
38 #include <microsim/MSLane.h>
39 #include <microsim/MSEdge.h>
40 #include <microsim/MSGlobals.h>
53 #include "NLHandler.h"
54 #include "NLTriggerBuilder.h"
56 #include <utils/xml/XMLSubSys.h>
57 
58 
59 #ifdef HAVE_INTERNAL
60 #include <mesosim/MELoop.h>
61 #include <mesosim/METriggeredCalibrator.h>
62 #endif
63 
64 #ifdef CHECK_MEMORY_LEAKS
65 #include <foreign/nvwa/debug_new.h>
66 #endif // CHECK_MEMORY_LEAKS
67 
68 
69 // ===========================================================================
70 // method definitions
71 // ===========================================================================
73  : myHandler(0) {}
74 
75 
77 
78 void
80  myHandler = handler;
81 }
82 
83 
84 void
86  bool ok = true;
87  // get the id, throw if not given or empty...
88  std::string id = attrs.get<std::string>(SUMO_ATTR_ID, 0, ok);
89  if (!ok) {
90  return;
91  }
92  MSEdge* e = MSEdge::dictionary(id);
93  if (e == 0) {
94  WRITE_ERROR("Unknown edge ('" + id + "') referenced in a vaporizer.");
95  return;
96  }
97  SUMOTime begin = attrs.getSUMOTimeReporting(SUMO_ATTR_BEGIN, 0, ok);
98  SUMOTime end = attrs.getSUMOTimeReporting(SUMO_ATTR_END, 0, ok);
99  if (!ok) {
100  return;
101  }
102  if (begin < 0) {
103  WRITE_ERROR("A vaporization begin time is negative (edge id='" + id + "').");
104  return;
105  }
106  if (begin >= end) {
107  WRITE_ERROR("A vaporization ends before it starts (edge id='" + id + "').");
108  return;
109  }
110  if (end >= string2time(OptionsCont::getOptions().getString("begin"))) {
115  }
116 }
117 
118 
119 
120 void
122  const std::string& base) {
123  // get the id, throw if not given or empty...
124  bool ok = true;
125  // get the id, throw if not given or empty...
126  std::string id = attrs.get<std::string>(SUMO_ATTR_ID, 0, ok);
127  if (!ok) {
128  return;
129  }
130  // get the file name to read further definitions from
131  std::string file = getFileName(attrs, base, true);
132  std::string objectid = attrs.get<std::string>(SUMO_ATTR_LANES, id.c_str(), ok);
133  if (!ok) {
134  throw InvalidArgument("The lanes to use within MSLaneSpeedTrigger '" + id + "' are not known.");
135  }
136  std::vector<MSLane*> lanes;
137  std::vector<std::string> laneIDs;
138  SUMOSAXAttributes::parseStringVector(objectid, laneIDs);
139  for (std::vector<std::string>::iterator i = laneIDs.begin(); i != laneIDs.end(); ++i) {
140  MSLane* lane = MSLane::dictionary(*i);
141  if (lane == 0) {
142  throw InvalidArgument("The lane to use within MSLaneSpeedTrigger '" + id + "' is not known.");
143  }
144  lanes.push_back(lane);
145  }
146  if (lanes.size() == 0) {
147  throw InvalidArgument("No lane defined for MSLaneSpeedTrigger '" + id + "'.");
148  }
149  try {
150  MSLaneSpeedTrigger* trigger = buildLaneSpeedTrigger(net, id, lanes, file);
151  if (file == "") {
153  }
154  } catch (ProcessError& e) {
155  throw InvalidArgument(e.what());
156  }
157 }
158 
159 void
161  bool ok = true;
162 
163  // get the id, throw if not given or empty...
164  std::string id = attrs.get<std::string>(SUMO_ATTR_ID, 0, ok);
165 
166  if (!ok) {
167  throw ProcessError();
168  }
169 
170  // get the lane
171  MSLane* lane = getLane(attrs, "chargingStation", id);
172 
173  // get the positions
174  SUMOReal frompos = attrs.getOpt<SUMOReal>(SUMO_ATTR_STARTPOS, id.c_str(), ok, 0);
175  SUMOReal topos = attrs.getOpt<SUMOReal>(SUMO_ATTR_ENDPOS, id.c_str(), ok, lane->getLength());
176  SUMOReal chrgpower = attrs.getOpt<SUMOReal>(SUMO_ATTR_CHARGINGPOWER, id.c_str(), ok, 0);
177  SUMOReal efficiency = attrs.getOpt<SUMOReal>(SUMO_ATTR_EFFICIENCY, id.c_str(), ok, 0);
178  SUMOReal chargeInTransit = attrs.getOpt<SUMOReal>(SUMO_ATTR_CHARGEINTRANSIT, id.c_str(), ok, 0);
179  SUMOReal ChargeDelay = attrs.getOpt<SUMOReal>(SUMO_ATTR_CHARGEDELAY, id.c_str(), ok, 0);
180 
181  const bool friendlyPos = attrs.getOpt<bool>(SUMO_ATTR_FRIENDLY_POS, id.c_str(), ok, false);
182 
183  if (!ok || !myHandler->checkStopPos(frompos, topos, lane->getLength(), POSITION_EPS, friendlyPos)) {
184  throw InvalidArgument("Invalid position for Charging Station '" + id + "'.");
185  }
186 
187  // get the lines
188  std::vector<std::string> lines;
189  SUMOSAXAttributes::parseStringVector(attrs.getOpt<std::string>(SUMO_ATTR_LINES, id.c_str(), ok, "", false), lines);
190 
191  // build the Charging Station
192  buildChargingStation(net, id, lines, lane, frompos, topos, chrgpower, efficiency, chargeInTransit, ChargeDelay);
193 }
194 
195 void
197  bool ok = true;
198  // get the id, throw if not given or empty...
199  std::string id = attrs.get<std::string>(SUMO_ATTR_ID, 0, ok);
200  if (!ok) {
201  throw ProcessError();
202  }
203  // get the lane
204  MSLane* lane = getLane(attrs, "busStop", id);
205  // get the positions
206  SUMOReal frompos = attrs.getOpt<SUMOReal>(SUMO_ATTR_STARTPOS, id.c_str(), ok, 0);
207  SUMOReal topos = attrs.getOpt<SUMOReal>(SUMO_ATTR_ENDPOS, id.c_str(), ok, lane->getLength());
208  const bool friendlyPos = attrs.getOpt<bool>(SUMO_ATTR_FRIENDLY_POS, id.c_str(), ok, false);
209  if (!ok || !myHandler->checkStopPos(frompos, topos, lane->getLength(), POSITION_EPS, friendlyPos)) {
210  throw InvalidArgument("Invalid position for bus stop '" + id + "'.");
211  }
212  // get the lines
213  std::vector<std::string> lines;
214  SUMOSAXAttributes::parseStringVector(attrs.getOpt<std::string>(SUMO_ATTR_LINES, id.c_str(), ok, "", false), lines);
215  // build the bus stop
216  buildBusStop(net, id, lines, lane, frompos, topos);
217 }
218 
219 void
221  bool ok = true;
222  // get the id, throw if not given or empty...
223  std::string id = attrs.get<std::string>(SUMO_ATTR_ID, 0, ok);
224  if (!ok) {
225  throw ProcessError();
226  }
227  // get the lane
228  MSLane* lane = getLane(attrs, "containerStop", id);
229  // get the positions
230  SUMOReal frompos = attrs.getOpt<SUMOReal>(SUMO_ATTR_STARTPOS, id.c_str(), ok, 0);
231  SUMOReal topos = attrs.getOpt<SUMOReal>(SUMO_ATTR_ENDPOS, id.c_str(), ok, lane->getLength());
232  const bool friendlyPos = attrs.getOpt<bool>(SUMO_ATTR_FRIENDLY_POS, id.c_str(), ok, false);
233  if (!ok || !myHandler->checkStopPos(frompos, topos, lane->getLength(), POSITION_EPS, friendlyPos)) {
234  throw InvalidArgument("Invalid position for container stop '" + id + "'.");
235  }
236  // get the lines
237  std::vector<std::string> lines;
238  SUMOSAXAttributes::parseStringVector(attrs.getOpt<std::string>(SUMO_ATTR_LINES, id.c_str(), ok, "", false), lines);
239  // build the container stop
240  buildContainerStop(net, id, lines, lane, frompos, topos);
241 }
242 
243 void
245  const std::string& base) {
246  bool ok = true;
247  // get the id, throw if not given or empty...
248  std::string id = attrs.get<std::string>(SUMO_ATTR_ID, 0, ok);
249  if (!ok) {
250  throw ProcessError();
251  }
252  // get the file name to read further definitions from
253  MSLane* lane = getLane(attrs, "calibrator", id);
254  const SUMOReal pos = getPosition(attrs, lane, "calibrator", id);
255  const SUMOTime freq = attrs.getOptSUMOTimeReporting(SUMO_ATTR_FREQUENCY, id.c_str(), ok, DELTA_T); // !!! no error handling
256  std::string file = getFileName(attrs, base, true);
257  std::string outfile = attrs.getOpt<std::string>(SUMO_ATTR_OUTPUT, id.c_str(), ok, "");
258  std::string routeProbe = attrs.getOpt<std::string>(SUMO_ATTR_ROUTEPROBE, id.c_str(), ok, "");
259  MSRouteProbe* probe = 0;
260  if (routeProbe != "") {
261  probe = dynamic_cast<MSRouteProbe*>(net.getDetectorControl().getTypedDetectors(SUMO_TAG_ROUTEPROBE).get(routeProbe));
262  }
264 #ifdef HAVE_INTERNAL
265  METriggeredCalibrator* trigger = buildMECalibrator(net, id, &lane->getEdge(), pos, file, outfile, freq, probe);
266  if (file == "") {
267  trigger->registerParent(SUMO_TAG_CALIBRATOR, myHandler);
268  }
269 #endif
270  } else {
271  MSCalibrator* trigger = buildCalibrator(net, id, &lane->getEdge(), pos, file, outfile, freq, probe);
272  if (file == "") {
274  }
275  }
276 }
277 
278 
279 void
281  const std::string& base) {
282  bool ok = true;
283  // get the id, throw if not given or empty...
284  std::string id = attrs.get<std::string>(SUMO_ATTR_ID, 0, ok);
285  if (!ok) {
286  throw ProcessError();
287  }
288  // get the file name to read further definitions from
289  std::string file = getFileName(attrs, base, true);
290  std::string objectid = attrs.get<std::string>(SUMO_ATTR_EDGES, id.c_str(), ok);
291  if (!ok) {
292  throw InvalidArgument("The edge to use within MSTriggeredRerouter '" + id + "' is not known.");
293  }
294  MSEdgeVector edges;
295  std::vector<std::string> edgeIDs;
296  SUMOSAXAttributes::parseStringVector(objectid, edgeIDs);
297  for (std::vector<std::string>::iterator i = edgeIDs.begin(); i != edgeIDs.end(); ++i) {
298  MSEdge* edge = MSEdge::dictionary(*i);
299  if (edge == 0) {
300  throw InvalidArgument("The edge to use within MSTriggeredRerouter '" + id + "' is not known.");
301  }
302  edges.push_back(edge);
303  }
304  if (edges.size() == 0) {
305  throw InvalidArgument("No edges found for MSTriggeredRerouter '" + id + "'.");
306  }
307  SUMOReal prob = attrs.getOpt<SUMOReal>(SUMO_ATTR_PROB, id.c_str(), ok, 1);
308  bool off = attrs.getOpt<bool>(SUMO_ATTR_OFF, id.c_str(), ok, false);
309  if (!ok) {
310  throw InvalidArgument("Could not parse MSTriggeredRerouter '" + id + "'.");
311  }
312  MSTriggeredRerouter* trigger = buildRerouter(net, id, edges, prob, file, off);
313  // read in the trigger description
314  if (file == "") {
316  } else if (!XMLSubSys::runParser(*trigger, file)) {
317  throw ProcessError();
318  }
319 }
320 
321 
322 // -------------------------
323 
324 
326 NLTriggerBuilder::buildLaneSpeedTrigger(MSNet& /*net*/, const std::string& id,
327  const std::vector<MSLane*>& destLanes,
328  const std::string& file) {
329  return new MSLaneSpeedTrigger(id, destLanes, file);
330 }
331 
332 
333 #ifdef HAVE_INTERNAL
334 METriggeredCalibrator*
335 NLTriggerBuilder::buildMECalibrator(MSNet& /*net*/, const std::string& id,
336  const MSEdge* edge, SUMOReal pos,
337  const std::string& file,
338  const std::string& outfile,
339  const SUMOTime freq, MSRouteProbe* probe) {
340  return new METriggeredCalibrator(id, edge, pos, file, outfile, freq, MSGlobals::gMesoNet->getSegmentForEdge(*edge, pos)->getLength(), probe);
341 }
342 #endif
343 
344 
346 NLTriggerBuilder::buildCalibrator(MSNet& /*net*/, const std::string& id,
347  MSEdge* edge, SUMOReal pos,
348  const std::string& file,
349  const std::string& outfile,
350  const SUMOTime freq, const MSRouteProbe* probe) {
351  return new MSCalibrator(id, edge, pos, file, outfile, freq, edge->getLength(), probe);
352 }
353 
354 
356 NLTriggerBuilder::buildRerouter(MSNet&, const std::string& id,
357  MSEdgeVector& edges,
358  SUMOReal prob, const std::string& file, bool off) {
359  return new MSTriggeredRerouter(id, edges, prob, file, off);
360 }
361 
362 
363 void
364 NLTriggerBuilder::buildBusStop(MSNet& net, const std::string& id,
365  const std::vector<std::string>& lines,
366  MSLane* lane, SUMOReal frompos, SUMOReal topos) {
367  MSStoppingPlace* stop = new MSStoppingPlace(id, lines, *lane, frompos, topos);
368  if (!net.addBusStop(stop)) {
369  delete stop;
370  throw InvalidArgument("Could not build bus stop '" + id + "'; probably declared twice.");
371  }
372 }
373 
374 
375 void
376 NLTriggerBuilder::buildContainerStop(MSNet& net, const std::string& id,
377  const std::vector<std::string>& lines,
378  MSLane* lane, SUMOReal frompos, SUMOReal topos) {
379  MSStoppingPlace* stop = new MSStoppingPlace(id, lines, *lane, frompos, topos);
380  if (!net.addContainerStop(stop)) {
381  delete stop;
382  throw InvalidArgument("Could not build container stop '" + id + "'; probably declared twice.");
383  }
384 }
385 
386 void
387 NLTriggerBuilder::buildChargingStation(MSNet& net, const std::string& id,
388  const std::vector<std::string>& lines,
389  MSLane* lane, SUMOReal frompos, SUMOReal topos, SUMOReal chrgpower, SUMOReal efficiency, SUMOReal chargeInTransit, SUMOReal ChargeDelay) {
390 
391  MSChargingStation* chargingStation = new MSChargingStation(id, lines, *lane, frompos, topos, chrgpower, efficiency, chargeInTransit, ChargeDelay);
392 
393  if (!net.addChargingStation(chargingStation)) {
394  delete chargingStation;
395  throw InvalidArgument("Could not build Charging Station '" + id + "'; probably declared twice.");
396  }
397 }
398 
399 std::string
401  const std::string& base,
402  const bool allowEmpty) {
403  // get the file name to read further definitions from
404  bool ok = true;
405  std::string file = attrs.getOpt<std::string>(SUMO_ATTR_FILE, 0, ok, "");
406  if (file == "") {
407  if (allowEmpty) {
408  return file;
409  }
410  throw InvalidArgument("No filename given.");
411  }
412  // check whether absolute or relative filenames are given
413  if (!FileHelpers::isAbsolute(file)) {
414  return FileHelpers::getConfigurationRelative(base, file);
415  }
416  return file;
417 }
418 
419 
420 MSLane*
422  const std::string& tt,
423  const std::string& tid) {
424  bool ok = true;
425  std::string objectid = attrs.get<std::string>(SUMO_ATTR_LANE, tid.c_str(), ok);
426  MSLane* lane = MSLane::dictionary(objectid);
427  if (lane == 0) {
428  throw InvalidArgument("The lane " + objectid + " to use within the " + tt + " '" + tid + "' is not known.");
429  }
430  return lane;
431 }
432 
433 
434 SUMOReal
436  MSLane* lane,
437  const std::string& tt, const std::string& tid) {
438  bool ok = true;
439  SUMOReal pos = attrs.get<SUMOReal>(SUMO_ATTR_POSITION, 0, ok);
440  const bool friendlyPos = attrs.getOpt<bool>(SUMO_ATTR_FRIENDLY_POS, 0, ok, false);
441  if (!ok) {
442  throw InvalidArgument("Error on parsing a position information.");
443  }
444  if (pos < 0) {
445  pos = lane->getLength() + pos;
446  }
447  if (pos > lane->getLength()) {
448  if (friendlyPos) {
449  pos = lane->getLength() - (SUMOReal) 0.1;
450  } else {
451  throw InvalidArgument("The position of " + tt + " '" + tid + "' lies beyond the lane's '" + lane->getID() + "' length.");
452  }
453  }
454  return pos;
455 }
456 
457 
458 
459 /****************************************************************************/
void setHandler(NLHandler *handler)
Sets the parent handler to use for nested parsing.
void parseAndBuildCalibrator(MSNet &net, const SUMOSAXAttributes &attrs, const std::string &base)
Parses his values and builds a mesoscopic or microscopic calibrator.
virtual void buildBusStop(MSNet &net, const std::string &id, const std::vector< std::string > &lines, MSLane *lane, SUMOReal frompos, SUMOReal topos)
Builds a bus stop.
MSEdge & getEdge() const
Returns the lane&#39;s edge.
Definition: MSLane.h:461
virtual MSCalibrator * buildCalibrator(MSNet &net, const std::string &id, MSEdge *edge, SUMOReal pos, const std::string &file, const std::string &outfile, const SUMOTime freq, const MSRouteProbe *probe)
builds a microscopic calibrator
long long int SUMOTime
Definition: SUMOTime.h:43
static std::string getConfigurationRelative(const std::string &configPath, const std::string &path)
Returns the second path as a relative path to the first file.
Definition: FileHelpers.cpp:86
A lane area vehicles can halt at.
virtual void buildChargingStation(MSNet &net, const std::string &id, const std::vector< std::string > &lines, MSLane *lane, SUMOReal frompos, SUMOReal topos, SUMOReal chrgpower, SUMOReal efficiency, SUMOReal chargeInTransit, SUMOReal ChargeDelay)
Builds a charging Station.
Writes routes of vehicles passing a certain edge.
Definition: MSRouteProbe.h:68
SUMOReal getLength() const
Returns the lane&#39;s length.
Definition: MSLane.h:376
void parseAndBuildChargingStation(MSNet &net, const SUMOSAXAttributes &attrs)
Parses his values and builds a charging station.
void parseAndBuildRerouter(MSNet &net, const SUMOSAXAttributes &attrs, const std::string &base)
Parses his values and builds a rerouter.
static bool checkStopPos(SUMOReal &startPos, SUMOReal &endPos, const SUMOReal laneLength, const SUMOReal minLength, const bool friendlyPos)
check start and end position of a stop
bool addBusStop(MSStoppingPlace *busStop)
Adds a bus stop.
Definition: MSNet.cpp:780
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
Definition: MSNet.cpp:162
static bool dictionary(const std::string &id, MSEdge *edge)
Inserts edge into the static dictionary Returns true if the key id isn&#39;t already in the dictionary...
Definition: MSEdge.cpp:579
SUMOTime incVaporization(SUMOTime t)
Enables vaporization.
Definition: MSEdge.cpp:307
void parseAndBuildBusStop(MSNet &net, const SUMOSAXAttributes &attrs)
Parses his values and builds a bus stop.
NLTriggerBuilder()
Constructor.
Base (microsim) event class.
Definition: Command.h:61
static bool runParser(GenericSAXHandler &handler, const std::string &file, const bool isNet=false)
Runs the given handler on the given file; returns if everything&#39;s ok.
Definition: XMLSubSys.cpp:114
virtual ~NLTriggerBuilder()
Destructor.
SUMOTime decVaporization(SUMOTime t)
Disables vaporization.
Definition: MSEdge.cpp:314
The simulated network and simulation perfomer.
Definition: MSNet.h:94
static OptionsCont & getOptions()
Retrieves the options.
Definition: OptionsCont.cpp:69
SUMOTime getOptSUMOTimeReporting(int attr, const char *objectid, bool &ok, SUMOTime defaultValue, bool report=true) const
Tries to read given attribute assuming it is a SUMOTime.
Changes the speed allowed on a set of lanes.
T get(const std::string &id) const
Retrieves an item.
const std::string & getID() const
Returns the id.
Definition: Named.h:65
A road/street connecting two junctions.
Definition: MSEdge.h:81
const NamedObjectCont< MSDetectorFileOutput * > & getTypedDetectors(SumoXMLTag type) const
Returns the list of detectors of the given type.
static void parseStringVector(const std::string &def, std::vector< std::string > &into)
Splits the given string.
SUMOReal getLength() const
return the length of the edge
Definition: MSEdge.h:535
SUMOReal getPosition(const SUMOSAXAttributes &attrs, MSLane *lane, const std::string &tt, const std::string &tid)
returns the position on the lane checking it
the edges of a route
Encapsulated SAX-Attributes.
NLHandler * myHandler
The parent handler to set for subhandlers.
static bool isAbsolute(const std::string &path)
Returns the information whether the given path is absolute.
void parseAndBuildContainerStop(MSNet &net, const SUMOSAXAttributes &attrs)
Parses his values and builds a container stop.
MSEventControl * getBeginOfTimestepEvents()
Returns the event control for events executed at the begin of a time step.
Definition: MSNet.h:389
A wrapper for a Command function.
void parseAndBuildLaneSpeedTrigger(MSNet &net, const SUMOSAXAttributes &attrs, const std::string &base)
Parses his values and builds a lane speed trigger.
virtual void buildContainerStop(MSNet &net, const std::string &id, const std::vector< std::string > &lines, MSLane *lane, SUMOReal frompos, SUMOReal topos)
Builds a container stop.
void registerParent(const int tag, GenericSAXHandler *handler)
Assigning a parent handler which is enabled when the specified tag is closed.
SUMOTime string2time(const std::string &r)
Definition: SUMOTime.cpp:48
#define POSITION_EPS
Definition: config.h:188
SUMOTime getSUMOTimeReporting(int attr, const char *objectid, bool &ok, bool report=true) const
Tries to read given attribute assuming it is a SUMOTime.
MSDetectorControl & getDetectorControl()
Returns the detector control.
Definition: MSNet.h:359
std::string getFileName(const SUMOSAXAttributes &attrs, const std::string &base, const bool allowEmpty=false)
Helper method to obtain the filename.
virtual SUMOTime addEvent(Command *operation, SUMOTime execTimeStep, AdaptType type)
Adds an Event.
The XML-Handler for network loading.
Definition: NLHandler.h:84
#define WRITE_ERROR(msg)
Definition: MsgHandler.h:205
Reroutes vehicles passing an edge.
static bool dictionary(const std::string &id, MSLane *lane)
Static (sic!) container methods {.
Definition: MSLane.cpp:884
bool addContainerStop(MSStoppingPlace *containerStop)
Adds a container stop.
Definition: MSNet.cpp:805
bool addChargingStation(MSChargingStation *chargingStation)
Adds a chargingg station.
Definition: MSNet.cpp:828
Calibrates the flow on a segment to a specified one.
Definition: MSCalibrator.h:57
A variable speed sign.
Patch the time in a way that it is at least as high as the simulation begin time. ...
#define SUMOReal
Definition: config.h:214
static const bool gUseMesoSim
Definition: MSGlobals.h:102
#define DELTA_T
Definition: SUMOTime.h:50
virtual MSTriggeredRerouter * buildRerouter(MSNet &net, const std::string &id, MSEdgeVector &edges, SUMOReal prob, const std::string &file, bool off)
builds an rerouter
T getOpt(int attr, const char *objectid, bool &ok, T defaultValue, bool report=true) const
Tries to read given attribute assuming it is an int.
virtual MSLaneSpeedTrigger * buildLaneSpeedTrigger(MSNet &net, const std::string &id, const std::vector< MSLane * > &destLanes, const std::string &file)
Builds a lane speed trigger.
std::vector< MSEdge * > MSEdgeVector
Definition: MSEdge.h:78
T get(int attr, const char *objectid, bool &ok, bool report=true) const
Tries to read given attribute assuming it is an int.
Representation of a lane in the micro simulation.
Definition: MSLane.h:77
void buildVaporizer(const SUMOSAXAttributes &attrs)
Builds a vaporization.
MSLane * getLane(const SUMOSAXAttributes &attrs, const std::string &tt, const std::string &tid)
Returns the lane defined by attribute "lane".