SUMO - Simulation of Urban MObility
SUMOVehicleParameter.cpp
Go to the documentation of this file.
1 /****************************************************************************/
9 // Structure representing possible vehicle parameter
10 /****************************************************************************/
11 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
12 // Copyright (C) 2001-2016 DLR (http://www.dlr.de/) and contributors
13 /****************************************************************************/
14 //
15 // This file is part of SUMO.
16 // SUMO is free software: you can redistribute it and/or modify
17 // it under the terms of the GNU General Public License as published by
18 // the Free Software Foundation, either version 3 of the License, or
19 // (at your option) any later version.
20 //
21 /****************************************************************************/
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #ifdef _MSC_VER
28 #include <windows_config.h>
29 #else
30 #include <config.h>
31 #endif
32 
33 #include "SUMOVehicleParameter.h"
34 #include <utils/common/ToString.h>
39 
40 #ifdef CHECK_MEMORY_LEAKS
41 #include <foreign/nvwa/debug_new.h>
42 #endif // CHECK_MEMORY_LEAKS
43 
44 
45 // ===========================================================================
46 // member method definitions
47 // ===========================================================================
49  : vtypeid(DEFAULT_VTYPE_ID), color(RGBColor::DEFAULT_COLOR),
50  depart(-1), departProcedure(DEPART_GIVEN),
51  departLane(0), departLaneProcedure(DEPART_LANE_DEFAULT),
52  departPos(0), departPosProcedure(DEPART_POS_DEFAULT),
53  departPosLat(0), departPosLatProcedure(DEPART_POSLAT_DEFAULT),
54  departSpeed(-1), departSpeedProcedure(DEPART_SPEED_DEFAULT),
55  arrivalLane(0), arrivalLaneProcedure(ARRIVAL_LANE_DEFAULT),
56  arrivalPos(0), arrivalPosProcedure(ARRIVAL_POS_DEFAULT),
57  arrivalSpeed(-1), arrivalSpeedProcedure(ARRIVAL_SPEED_DEFAULT),
58  repetitionNumber(-1), repetitionsDone(-1), repetitionOffset(-1), repetitionProbability(-1), repetitionEnd(-1),
59  line(), fromTaz(), toTaz(), personNumber(0), containerNumber(0), setParameter(0) {
60 }
61 
62 
63 bool
64 SUMOVehicleParameter::defaultOptionOverrides(const OptionsCont& oc, const std::string& optionName) const {
65  return oc.isSet(optionName) && oc.getBool("defaults-override");
66 }
67 
68 
69 void
71  dev.openTag(tag).writeAttr(SUMO_ATTR_ID, id);
74  }
76  dev.writeAttr(SUMO_ATTR_DEPART, "triggered");
78  dev.writeAttr(SUMO_ATTR_DEPART, "containerTriggered");
79  } else {
81  }
82 
83  // optional parameter
84  // departlane
85  if (wasSet(VEHPARS_DEPARTLANE_SET) && !defaultOptionOverrides(oc, "departlane")) {
86  std::string val;
87  switch (departLaneProcedure) {
88  case DEPART_LANE_GIVEN:
89  val = toString(departLane);
90  break;
91  case DEPART_LANE_RANDOM:
92  val = "random";
93  break;
94  case DEPART_LANE_FREE:
95  val = "free";
96  break;
98  val = "allowed";
99  break;
101  val = "best";
102  break;
104  val = "first";
105  break;
106  case DEPART_LANE_DEFAULT:
107  default:
108  break;
109  }
111  } else if (oc.isSet("departlane")) {
112  dev.writeNonEmptyAttr(SUMO_ATTR_DEPARTLANE, oc.getString("departlane"));
113  }
114  // departpos
115  if (wasSet(VEHPARS_DEPARTPOS_SET) && !defaultOptionOverrides(oc, "departpos")) {
116  std::string val;
117  switch (departPosProcedure) {
118  case DEPART_POS_GIVEN:
119  val = toString(departPos);
120  break;
121  case DEPART_POS_RANDOM:
122  val = "random";
123  break;
125  val = "random_free";
126  break;
127  case DEPART_POS_FREE:
128  val = "free";
129  break;
130  case DEPART_POS_LAST:
131  val = "last";
132  break;
133  case DEPART_POS_BASE:
134  val = "base";
135  break;
136  case DEPART_POS_DEFAULT:
137  default:
138  break;
139  }
141  } else if (oc.isSet("departpos")) {
142  dev.writeNonEmptyAttr(SUMO_ATTR_DEPARTPOS, oc.getString("departpos"));
143  }
144  // departspeed
145  if (wasSet(VEHPARS_DEPARTSPEED_SET) && !defaultOptionOverrides(oc, "departspeed")) {
146  std::string val;
147  switch (departSpeedProcedure) {
148  case DEPART_SPEED_GIVEN:
149  val = toString(departSpeed);
150  break;
151  case DEPART_SPEED_RANDOM:
152  val = "random";
153  break;
154  case DEPART_SPEED_MAX:
155  val = "max";
156  break;
158  default:
159  break;
160  }
162  } else if (oc.isSet("departspeed")) {
163  dev.writeNonEmptyAttr(SUMO_ATTR_DEPARTSPEED, oc.getString("departspeed"));
164  }
165 
166  // arrivallane
167  if (wasSet(VEHPARS_ARRIVALLANE_SET) && !defaultOptionOverrides(oc, "arrivallane")) {
168  std::string val;
169  switch (arrivalLaneProcedure) {
170  case ARRIVAL_LANE_GIVEN:
171  val = toString(arrivalLane);
172  break;
174  val = "current";
175  break;
177  default:
178  break;
179  }
181  } else if (oc.isSet("arrivallane")) {
182  dev.writeNonEmptyAttr(SUMO_ATTR_ARRIVALLANE, oc.getString("arrivallane"));
183  }
184  // arrivalpos
185  if (wasSet(VEHPARS_ARRIVALPOS_SET) && !defaultOptionOverrides(oc, "arrivalpos")) {
186  std::string val;
187  switch (arrivalPosProcedure) {
188  case ARRIVAL_POS_GIVEN:
189  val = toString(arrivalPos);
190  break;
191  case ARRIVAL_POS_RANDOM:
192  val = "random";
193  break;
194  case ARRIVAL_POS_MAX:
195  val = "max";
196  break;
197  case ARRIVAL_POS_DEFAULT:
198  default:
199  break;
200  }
202  } else if (oc.isSet("arrivalpos")) {
203  dev.writeNonEmptyAttr(SUMO_ATTR_ARRIVALPOS, oc.getString("arrivalpos"));
204  }
205  // arrivalspeed
206  if (wasSet(VEHPARS_ARRIVALSPEED_SET) && !defaultOptionOverrides(oc, "arrivalspeed")) {
207  std::string val;
208  switch (arrivalSpeedProcedure) {
209  case ARRIVAL_SPEED_GIVEN:
210  val = toString(arrivalSpeed);
211  break;
213  val = "current";
214  break;
216  default:
217  break;
218  }
220  } else if (oc.isSet("arrivalspeed")) {
221  dev.writeNonEmptyAttr(SUMO_ATTR_ARRIVALSPEED, oc.getString("arrivalspeed"));
222  }
223 
224  // color
225  if (wasSet(VEHPARS_COLOR_SET)) {
227  }
228  if (wasSet(VEHPARS_LINE_SET)) {
230  }
233  }
234  if (wasSet(VEHPARS_TO_TAZ_SET)) {
236  }
239  }
242  }
243 }
244 
245 
246 void
248  dev.openTag(SUMO_TAG_STOP);
249  if (busstop != "") {
250  dev.writeAttr(SUMO_ATTR_BUS_STOP, busstop);
251  }
252  if (containerstop != "") {
253  dev.writeAttr(SUMO_ATTR_CONTAINER_STOP, containerstop);
254  }
255  if (busstop == "" && containerstop == "") {
256  dev.writeAttr(SUMO_ATTR_LANE, lane);
257  if ((setParameter & STOP_START_SET) != 0) {
258  dev.writeAttr(SUMO_ATTR_STARTPOS, startPos);
259  }
260  if ((setParameter & STOP_END_SET) != 0) {
261  dev.writeAttr(SUMO_ATTR_ENDPOS, endPos);
262  }
263  }
264  if (duration >= 0) {
265  dev.writeAttr(SUMO_ATTR_DURATION, STEPS2TIME(duration));
266  }
267  if (until >= 0) {
268  dev.writeAttr(SUMO_ATTR_UNTIL, STEPS2TIME(until));
269  }
270  if ((setParameter & STOP_TRIGGER_SET) != 0) {
271  dev.writeAttr(SUMO_ATTR_TRIGGERED, triggered);
272  }
274  dev.writeAttr(SUMO_ATTR_CONTAINER_TRIGGERED, containerTriggered);
275  }
276  if ((setParameter & STOP_PARKING_SET) != 0) {
277  dev.writeAttr(SUMO_ATTR_PARKING, parking);
278  }
279  // look, we are writing the set of expected persons in its current state...
280  // if this method is used somewhere in the simulation output,
281  // one should consider keeping the original values additionally,
282  // as the ones we write may hev changed.
283  if ((setParameter & STOP_EXPECTED_SET) != 0) {
284  dev.writeAttr(SUMO_ATTR_EXPECTED, awaitedPersons);
285  }
287  dev.writeAttr(SUMO_ATTR_EXPECTED_CONTAINERS, awaitedContainers);
288  }
289  dev.closeTag();
290 }
291 
292 
293 bool
294 SUMOVehicleParameter::parseDepart(const std::string& val, const std::string& element, const std::string& id,
295  SUMOTime& depart, DepartDefinition& dd, std::string& error) {
296  if (val == "triggered") {
297  dd = DEPART_TRIGGERED;
298  } else if (val == "containerTriggered") {
300  } else if (val == "now") {
301  dd = DEPART_NOW;
302  } else {
303  try {
304  depart = string2time(val);
305  dd = DEPART_GIVEN;
306  if (depart < 0) {
307  error = "Negative departure time in the definition of '" + id + "'.";
308  return false;
309  }
310  } catch (...) {
311  error = "Invalid departure time for " + element + " '" + id + "';\n must be one of (\"triggered\", \"containerTriggered\", \"now\", or a float >= 0)";
312  return false;
313  }
314  }
315  return true;
316 }
317 
318 
319 bool
320 SUMOVehicleParameter::parseDepartLane(const std::string& val, const std::string& element, const std::string& id,
321  int& lane, DepartLaneDefinition& dld, std::string& error) {
322  bool ok = true;
323  if (val == "random") {
324  dld = DEPART_LANE_RANDOM;
325  } else if (val == "free") {
326  dld = DEPART_LANE_FREE;
327  } else if (val == "allowed") {
329  } else if (val == "best") {
330  dld = DEPART_LANE_BEST_FREE;
331  } else if (val == "first") {
333  } else {
334  try {
335  lane = TplConvert::_2int(val.c_str());
336  dld = DEPART_LANE_GIVEN;
337  if (lane < 0) {
338  ok = false;
339  }
340  } catch (...) {
341  ok = false;
342  }
343  }
344  if (!ok) {
345  error = "Invalid departLane definition for " + element + " '" + id + "';\n must be one of (\"random\", \"free\", \"allowed\", \"best\", \"first\", or an int>=0)";
346  }
347  return ok;
348 }
349 
350 
351 bool
352 SUMOVehicleParameter::parseDepartPos(const std::string& val, const std::string& element, const std::string& id,
353  SUMOReal& pos, DepartPosDefinition& dpd, std::string& error) {
354  bool ok = true;
355  if (val == "random") {
356  dpd = DEPART_POS_RANDOM;
357  } else if (val == "random_free") {
359  } else if (val == "free") {
360  dpd = DEPART_POS_FREE;
361  } else if (val == "base") {
362  dpd = DEPART_POS_BASE;
363  } else if (val == "last") {
364  dpd = DEPART_POS_LAST;
365  } else {
366  try {
367  pos = TplConvert::_2SUMOReal(val.c_str());
368  dpd = DEPART_POS_GIVEN;
369  } catch (...) {
370  ok = false;
371  }
372  }
373  if (!ok) {
374  error = "Invalid departPos definition for " + element + " '" + id + "';\n must be one of (\"random\", \"random_free\", \"free\", \"base\", \"last\" or a float)";
375  }
376  return ok;
377 }
378 
379 
380 bool
381 SUMOVehicleParameter::parseDepartPosLat(const std::string& val, const std::string& element, const std::string& id,
382  SUMOReal& pos, DepartPosLatDefinition& dpd, std::string& error) {
383  bool ok = true;
384  if (val == "random") {
385  dpd = DEPART_POSLAT_RANDOM;
386  } else if (val == "random_free") {
388  } else if (val == "free") {
389  dpd = DEPART_POSLAT_FREE;
390  } else if (val == "right") {
391  dpd = DEPART_POSLAT_RIGHT;
392  } else if (val == "center") {
393  dpd = DEPART_POSLAT_CENTER;
394  } else if (val == "left") {
395  dpd = DEPART_POSLAT_LEFT;
396  } else {
397  try {
398  pos = TplConvert::_2SUMOReal(val.c_str());
399  dpd = DEPART_POSLAT_GIVEN;
400  } catch (...) {
401  ok = false;
402  }
403  }
404  if (!ok) {
405  error = "Invalid departPosLat definition for " + element + " '" + id + "';\n must be one of (\"random\", \"random_free\", \"free\", \"right\", \"center\", \"left\", or a float)";
406  }
407  return ok;
408 }
409 
410 
411 bool
412 SUMOVehicleParameter::parseDepartSpeed(const std::string& val, const std::string& element, const std::string& id,
413  SUMOReal& speed, DepartSpeedDefinition& dsd, std::string& error) {
414  bool ok = true;
415  if (val == "random") {
416  dsd = DEPART_SPEED_RANDOM;
417  } else if (val == "max") {
418  dsd = DEPART_SPEED_MAX;
419  } else {
420  try {
421  speed = TplConvert::_2SUMOReal(val.c_str());
422  dsd = DEPART_SPEED_GIVEN;
423  if (speed < 0) {
424  ok = false;
425  }
426  } catch (...) {
427  ok = false;
428  }
429  }
430  if (!ok) {
431  error = "Invalid departSpeed definition for " + element + " '" + id + "';\n must be one of (\"random\", \"max\", or a float>=0)";
432  }
433  return ok;
434 }
435 
436 
437 bool
438 SUMOVehicleParameter::parseArrivalLane(const std::string& val, const std::string& element, const std::string& id,
439  int& lane, ArrivalLaneDefinition& ald, std::string& error) {
440  bool ok = true;
441  if (val == "current") {
442  ald = ARRIVAL_LANE_CURRENT;
443  } else {
444  try {
445  lane = TplConvert::_2int(val.c_str());
446  ald = ARRIVAL_LANE_GIVEN;
447  if (lane < 0) {
448  ok = false;
449  }
450  } catch (...) {
451  ok = false;
452  }
453  }
454  if (!ok) {
455  error = "Invalid arrivalLane definition for " + element + " '" + id + "';\n must be one of (\"current\", or an int>=0)";
456  }
457  return ok;
458 }
459 
460 
461 bool
462 SUMOVehicleParameter::parseArrivalPos(const std::string& val, const std::string& element, const std::string& id,
463  SUMOReal& pos, ArrivalPosDefinition& apd, std::string& error) {
464  bool ok = true;
465  if (val == "random") {
466  apd = ARRIVAL_POS_RANDOM;
467  } else if (val == "max") {
468  apd = ARRIVAL_POS_MAX;
469  } else {
470  try {
471  pos = TplConvert::_2SUMOReal(val.c_str());
472  apd = ARRIVAL_POS_GIVEN;
473  } catch (...) {
474  ok = false;
475  }
476  }
477  if (!ok) {
478  error = "Invalid arrivalPos definition for " + element + " '" + id + "';\n must be one of (\"random\", \"max\", or a float)";
479  }
480  return ok;
481 }
482 
483 
484 bool
485 SUMOVehicleParameter::parseArrivalSpeed(const std::string& val, const std::string& element, const std::string& id,
486  SUMOReal& speed, ArrivalSpeedDefinition& asd, std::string& error) {
487  bool ok = true;
488  if (val == "current") {
489  asd = ARRIVAL_SPEED_CURRENT;
490  } else {
491  try {
492  speed = TplConvert::_2SUMOReal(val.c_str());
493  if (speed < 0) {
494  ok = false;
495  }
496  asd = ARRIVAL_SPEED_GIVEN;
497  } catch (...) {
498  ok = false;
499  }
500  }
501  if (!ok) {
502  error = "Invalid arrivalSpeed definition for " + element + " '" + id + "';\n must be one of (\"current\", or a float>=0)";
503  }
504  return ok;
505 }
506 
507 
508 SUMOReal
509 SUMOVehicleParameter::interpretEdgePos(SUMOReal pos, SUMOReal maximumValue, SumoXMLAttr attr, const std::string& id) {
510  if (pos < 0) {
511  pos = maximumValue + pos;
512  }
513  if (pos > maximumValue) {
514  WRITE_WARNING("Invalid " + toString(attr) + " " + toString(pos) + " given for " + id + ". Using edge end instead.");
515  pos = maximumValue;
516  }
517  return pos;
518 }
519 
520 
521 /****************************************************************************/
The departure is person triggered.
const int VEHPARS_TO_TAZ_SET
The current lane shall be used.
const int STOP_CONTAINER_TRIGGER_SET
No information given; use default.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
Definition: OutputDevice.h:257
SumoXMLTag
Numbers representing SUMO-XML - element names.
RGBColor color
The vehicle&#39;s color.
A free lateral position is chosen.
The position is given.
long long int SUMOTime
Definition: SUMOTime.h:43
At the leftmost side of the lane.
The time is given.
static bool parseDepartSpeed(const std::string &val, const std::string &element, const std::string &id, SUMOReal &speed, DepartSpeedDefinition &dsd, std::string &error)
Validates a given departSpeed value.
The vehicle is discarded if emission fails (not fully implemented yet)
std::string vtypeid
The vehicle&#39;s type id.
static bool parseArrivalPos(const std::string &val, const std::string &element, const std::string &id, SUMOReal &pos, ArrivalPosDefinition &apd, std::string &error)
Validates a given arrivalPos value.
ArrivalLaneDefinition
Possible ways to choose the arrival lane.
static SUMOReal _2SUMOReal(const E *const data)
converts a char-type array into the SUMOReal value described by it
Definition: TplConvert.h:290
ArrivalLaneDefinition arrivalLaneProcedure
Information how the vehicle shall choose the lane to arrive on.
The speed is given.
The departure is container triggered.
DepartLaneDefinition departLaneProcedure
Information how the vehicle shall choose the lane to depart from.
SUMOReal departSpeed
(optional) The initial speed of the vehicle
The position is given.
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
The lateral position is chosen randomly.
SUMOReal arrivalSpeed
(optional) The final speed of the vehicle (not used yet)
The least occupied lane is used.
If a fixed number of random choices fails, a free lateral position is chosen.
std::string time2string(SUMOTime t)
Definition: SUMOTime.cpp:59
SUMOReal arrivalPos
(optional) The position the vehicle shall arrive on
const int VEHPARS_ARRIVALLANE_SET
The speed is chosen randomly.
void write(OutputDevice &dev) const
Writes the stop as XML.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
The lane is chosen randomly.
ArrivalSpeedDefinition arrivalSpeedProcedure
Information how the vehicle&#39;s end speed shall be chosen.
The arrival position is given.
DepartPosLatDefinition
const std::string DEFAULT_VTYPE_ID
The least occupied lane from best lanes.
The position is chosen randomly.
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:200
The speed is given.
std::string toTaz
The vehicle&#39;s destination zone (district)
The lane is given.
const int VEHPARS_ARRIVALSPEED_SET
static SUMOReal interpretEdgePos(SUMOReal pos, SUMOReal maximumValue, SumoXMLAttr attr, const std::string &id)
Interprets negative edge positions and fits them onto a given edge.
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
SUMOVehicleParameter()
Constructor.
No information given; use default.
const int STOP_START_SET
bool defaultOptionOverrides(const OptionsCont &oc, const std::string &optionName) const
Returns whether the defaults shall be used.
DepartSpeedDefinition departSpeedProcedure
Information how the vehicle&#39;s initial speed shall be chosen.
DepartLaneDefinition
Possible ways to choose a lane on depart.
OutputDevice & writeNonEmptyAttr(const SumoXMLAttr attr, const std::string &val)
writes a string attribute only if it is not the empty string and not the string "default" ...
Definition: OutputDevice.h:290
DepartPosDefinition departPosProcedure
Information how the vehicle shall choose the departure position.
The least occupied lane from lanes which allow the continuation.
bool wasSet(int what) const
Returns whether the given parameter was set.
const int VEHPARS_DEPARTSPEED_SET
The current speed is used.
int arrivalLane
(optional) The lane the vehicle shall arrive on (not used yet)
SUMOTime depart
The vehicle&#39;s departure time.
#define STEPS2TIME(x)
Definition: SUMOTime.h:65
The maximum speed is used.
DepartDefinition departProcedure
Information how the vehicle shall choose the depart time.
SUMOTime string2time(const std::string &r)
Definition: SUMOTime.cpp:46
void write(OutputDevice &dev, const OptionsCont &oc, const SumoXMLTag tag=SUMO_TAG_VEHICLE) const
Writes the parameters as a beginning element.
virtual bool ok()
returns the information whether one can write into the device
std::string fromTaz
The vehicle&#39;s origin zone (district)
No information given; use default.
const int STOP_EXPECTED_SET
static bool parseArrivalLane(const std::string &val, const std::string &element, const std::string &id, int &lane, ArrivalLaneDefinition &ald, std::string &error)
Validates a given arrivalLane value.
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
Definition: ToString.h:55
const int VEHPARS_COLOR_SET
int personNumber
The static number of persons in the vehicle when it departs (not including boarding persons) ...
If a fixed number of random choices fails, a free position is chosen.
static bool parseDepartPos(const std::string &val, const std::string &element, const std::string &id, SUMOReal &pos, DepartPosDefinition &dpd, std::string &error)
Validates a given departPos value.
const int VEHPARS_FROM_TAZ_SET
The rightmost lane the vehicle may use.
int departLane
(optional) The lane the vehicle shall depart from (index in edge)
std::string line
The vehicle&#39;s line (mainly for public transport)
DepartSpeedDefinition
Possible ways to choose the departure speed.
const int STOP_END_SET
const int VEHPARS_LINE_SET
static bool parseArrivalSpeed(const std::string &val, const std::string &element, const std::string &id, SUMOReal &speed, ArrivalSpeedDefinition &asd, std::string &error)
Validates a given arrivalSpeed value.
const int VEHPARS_ARRIVALPOS_SET
No information given; use default.
const int STOP_PARKING_SET
static int _2int(const E *const data)
converts a char-type array into the integer value described by it
Definition: TplConvert.h:149
const int STOP_TRIGGER_SET
const int STOP_EXPECTED_CONTAINERS_SET
int setParameter
Information for the router which parameter were set.
At the rightmost side of the lane.
At the center of the lane.
A storage for options typed value containers)
Definition: OptionsCont.h:99
const int VEHPARS_DEPARTLANE_SET
No information given; use default.
The arrival lane is given.
int containerNumber
The static number of containers in the vehicle when it departs.
SUMOReal departPos
(optional) The position the vehicle shall depart from
static bool parseDepartPosLat(const std::string &val, const std::string &element, const std::string &id, SUMOReal &pos, DepartPosLatDefinition &dpd, std::string &error)
Validates a given departPosLat value.
const int VEHPARS_VTYPE_SET
No information given; use default.
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:71
bool closeTag()
Closes the most recently opened tag.
#define SUMOReal
Definition: config.h:213
ArrivalPosDefinition
Possible ways to choose the arrival position.
No information given; use default.
A free position is chosen.
const int VEHPARS_DEPARTPOS_SET
Insert behind the last vehicle as close as possible to still allow the specified departSpeed. Fallback to DEPART_POS_BASE if there is no vehicle on the departLane yet.
const int VEHPARS_PERSON_NUMBER_SET
ArrivalSpeedDefinition
Possible ways to choose the arrival speed.
DepartPosDefinition
Possible ways to choose the departure position.
const int VEHPARS_CONTAINER_NUMBER_SET
A color information.
The maximum arrival position is used.
Back-at-zero position.
DepartDefinition
Possible ways to depart.
static bool parseDepart(const std::string &val, const std::string &element, const std::string &id, SUMOTime &depart, DepartDefinition &dd, std::string &error)
Validates a given depart value.
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
ArrivalPosDefinition arrivalPosProcedure
Information how the vehicle shall choose the arrival position.
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
static bool parseDepartLane(const std::string &val, const std::string &element, const std::string &id, int &lane, DepartLaneDefinition &dld, std::string &error)
Validates a given departLane value.
The arrival position is chosen randomly.