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  arrivalPosLat(0), arrivalPosLatProcedure(ARRIVAL_POSLAT_DEFAULT),
58  arrivalSpeed(-1), arrivalSpeedProcedure(ARRIVAL_SPEED_DEFAULT),
59  repetitionNumber(-1), repetitionsDone(-1), repetitionOffset(-1), repetitionProbability(-1), repetitionEnd(-1),
60  line(), fromTaz(), toTaz(), personNumber(0), containerNumber(0), setParameter(0) {
61 }
62 
63 
64 bool
65 SUMOVehicleParameter::defaultOptionOverrides(const OptionsCont& oc, const std::string& optionName) const {
66  return oc.isSet(optionName) && oc.getBool("defaults-override");
67 }
68 
69 
70 void
72  dev.openTag(tag).writeAttr(SUMO_ATTR_ID, id);
75  }
77  dev.writeAttr(SUMO_ATTR_DEPART, "triggered");
79  dev.writeAttr(SUMO_ATTR_DEPART, "containerTriggered");
80  } else {
82  }
83 
84  // optional parameter
85  // departlane
86  if (wasSet(VEHPARS_DEPARTLANE_SET) && !defaultOptionOverrides(oc, "departlane")) {
87  std::string val;
88  switch (departLaneProcedure) {
89  case DEPART_LANE_GIVEN:
90  val = toString(departLane);
91  break;
92  case DEPART_LANE_RANDOM:
93  val = "random";
94  break;
95  case DEPART_LANE_FREE:
96  val = "free";
97  break;
99  val = "allowed";
100  break;
102  val = "best";
103  break;
105  val = "first";
106  break;
107  case DEPART_LANE_DEFAULT:
108  default:
109  break;
110  }
112  } else if (oc.isSet("departlane")) {
113  dev.writeNonEmptyAttr(SUMO_ATTR_DEPARTLANE, oc.getString("departlane"));
114  }
115  // departpos
116  if (wasSet(VEHPARS_DEPARTPOS_SET) && !defaultOptionOverrides(oc, "departpos")) {
117  std::string val;
118  switch (departPosProcedure) {
119  case DEPART_POS_GIVEN:
120  val = toString(departPos);
121  break;
122  case DEPART_POS_RANDOM:
123  val = "random";
124  break;
126  val = "random_free";
127  break;
128  case DEPART_POS_FREE:
129  val = "free";
130  break;
131  case DEPART_POS_LAST:
132  val = "last";
133  break;
134  case DEPART_POS_BASE:
135  val = "base";
136  break;
137  case DEPART_POS_DEFAULT:
138  default:
139  break;
140  }
142  } else if (oc.isSet("departpos")) {
143  dev.writeNonEmptyAttr(SUMO_ATTR_DEPARTPOS, oc.getString("departpos"));
144  }
145  // departPosLat
147  std::string val;
148  switch (departPosProcedure) {
149  case DEPART_POSLAT_GIVEN:
150  val = toString(departPos);
151  break;
153  val = "random";
154  break;
156  val = "random_free";
157  break;
158  case DEPART_POSLAT_FREE:
159  val = "free";
160  break;
161  case DEPART_POSLAT_RIGHT:
162  val = "right";
163  break;
165  val = "center";
166  break;
167  case DEPART_POSLAT_LEFT:
168  val = "left";
169  break;
171  default:
172  break;
173  }
175  }
176  // departspeed
177  if (wasSet(VEHPARS_DEPARTSPEED_SET) && !defaultOptionOverrides(oc, "departspeed")) {
178  std::string val;
179  switch (departSpeedProcedure) {
180  case DEPART_SPEED_GIVEN:
181  val = toString(departSpeed);
182  break;
183  case DEPART_SPEED_RANDOM:
184  val = "random";
185  break;
186  case DEPART_SPEED_MAX:
187  val = "max";
188  break;
190  default:
191  break;
192  }
194  } else if (oc.isSet("departspeed")) {
195  dev.writeNonEmptyAttr(SUMO_ATTR_DEPARTSPEED, oc.getString("departspeed"));
196  }
197 
198  // arrivallane
199  if (wasSet(VEHPARS_ARRIVALLANE_SET) && !defaultOptionOverrides(oc, "arrivallane")) {
200  std::string val;
201  switch (arrivalLaneProcedure) {
202  case ARRIVAL_LANE_GIVEN:
203  val = toString(arrivalLane);
204  break;
206  val = "current";
207  break;
209  default:
210  break;
211  }
213  } else if (oc.isSet("arrivallane")) {
214  dev.writeNonEmptyAttr(SUMO_ATTR_ARRIVALLANE, oc.getString("arrivallane"));
215  }
216  // arrivalpos
217  if (wasSet(VEHPARS_ARRIVALPOS_SET) && !defaultOptionOverrides(oc, "arrivalpos")) {
218  std::string val;
219  switch (arrivalPosProcedure) {
220  case ARRIVAL_POS_GIVEN:
221  val = toString(arrivalPos);
222  break;
223  case ARRIVAL_POS_RANDOM:
224  val = "random";
225  break;
226  case ARRIVAL_POS_MAX:
227  val = "max";
228  break;
229  case ARRIVAL_POS_DEFAULT:
230  default:
231  break;
232  }
234  } else if (oc.isSet("arrivalpos")) {
235  dev.writeNonEmptyAttr(SUMO_ATTR_ARRIVALPOS, oc.getString("arrivalpos"));
236  }
237  // arrivalPosLat
239  std::string val;
240  switch (arrivalPosProcedure) {
242  val = toString(arrivalPos);
243  break;
245  val = "right";
246  break;
248  val = "center";
249  break;
250  case ARRIVAL_POSLAT_LEFT:
251  val = "left";
252  break;
254  default:
255  break;
256  }
258  }
259  // arrivalspeed
260  if (wasSet(VEHPARS_ARRIVALSPEED_SET) && !defaultOptionOverrides(oc, "arrivalspeed")) {
261  std::string val;
262  switch (arrivalSpeedProcedure) {
263  case ARRIVAL_SPEED_GIVEN:
264  val = toString(arrivalSpeed);
265  break;
267  val = "current";
268  break;
270  default:
271  break;
272  }
274  } else if (oc.isSet("arrivalspeed")) {
275  dev.writeNonEmptyAttr(SUMO_ATTR_ARRIVALSPEED, oc.getString("arrivalspeed"));
276  }
277 
278  // color
279  if (wasSet(VEHPARS_COLOR_SET)) {
281  }
282  if (wasSet(VEHPARS_LINE_SET)) {
284  }
287  }
288  if (wasSet(VEHPARS_TO_TAZ_SET)) {
290  }
293  }
296  }
297 }
298 
299 
300 void
302  dev.openTag(SUMO_TAG_STOP);
303  if (busstop != "") {
304  dev.writeAttr(SUMO_ATTR_BUS_STOP, busstop);
305  }
306  if (containerstop != "") {
307  dev.writeAttr(SUMO_ATTR_CONTAINER_STOP, containerstop);
308  }
309  if (busstop == "" && containerstop == "") {
310  dev.writeAttr(SUMO_ATTR_LANE, lane);
311  if ((setParameter & STOP_START_SET) != 0) {
312  dev.writeAttr(SUMO_ATTR_STARTPOS, startPos);
313  }
314  if ((setParameter & STOP_END_SET) != 0) {
315  dev.writeAttr(SUMO_ATTR_ENDPOS, endPos);
316  }
317  }
318  if (duration >= 0) {
319  dev.writeAttr(SUMO_ATTR_DURATION, STEPS2TIME(duration));
320  }
321  if (until >= 0) {
322  dev.writeAttr(SUMO_ATTR_UNTIL, STEPS2TIME(until));
323  }
324  if ((setParameter & STOP_TRIGGER_SET) != 0) {
325  dev.writeAttr(SUMO_ATTR_TRIGGERED, triggered);
326  }
328  dev.writeAttr(SUMO_ATTR_CONTAINER_TRIGGERED, containerTriggered);
329  }
330  if ((setParameter & STOP_PARKING_SET) != 0) {
331  dev.writeAttr(SUMO_ATTR_PARKING, parking);
332  }
333  // look, we are writing the set of expected persons in its current state...
334  // if this method is used somewhere in the simulation output,
335  // one should consider keeping the original values additionally,
336  // as the ones we write may hev changed.
337  if ((setParameter & STOP_EXPECTED_SET) != 0) {
338  dev.writeAttr(SUMO_ATTR_EXPECTED, awaitedPersons);
339  }
341  dev.writeAttr(SUMO_ATTR_EXPECTED_CONTAINERS, awaitedContainers);
342  }
343  dev.closeTag();
344 }
345 
346 
347 bool
348 SUMOVehicleParameter::parseDepart(const std::string& val, const std::string& element, const std::string& id,
349  SUMOTime& depart, DepartDefinition& dd, std::string& error) {
350  if (val == "triggered") {
351  dd = DEPART_TRIGGERED;
352  } else if (val == "containerTriggered") {
354  } else if (val == "now") {
355  dd = DEPART_NOW;
356  } else {
357  try {
358  depart = string2time(val);
359  dd = DEPART_GIVEN;
360  if (depart < 0) {
361  error = "Negative departure time in the definition of '" + id + "'.";
362  return false;
363  }
364  } catch (...) {
365  error = "Invalid departure time for " + element + " '" + id + "';\n must be one of (\"triggered\", \"containerTriggered\", \"now\", or a float >= 0)";
366  return false;
367  }
368  }
369  return true;
370 }
371 
372 
373 bool
374 SUMOVehicleParameter::parseDepartLane(const std::string& val, const std::string& element, const std::string& id,
375  int& lane, DepartLaneDefinition& dld, std::string& error) {
376  bool ok = true;
377  if (val == "random") {
378  dld = DEPART_LANE_RANDOM;
379  } else if (val == "free") {
380  dld = DEPART_LANE_FREE;
381  } else if (val == "allowed") {
383  } else if (val == "best") {
384  dld = DEPART_LANE_BEST_FREE;
385  } else if (val == "first") {
387  } else {
388  try {
389  lane = TplConvert::_2int(val.c_str());
390  dld = DEPART_LANE_GIVEN;
391  if (lane < 0) {
392  ok = false;
393  }
394  } catch (...) {
395  ok = false;
396  }
397  }
398  if (!ok) {
399  error = "Invalid departLane definition for " + element + " '" + id + "';\n must be one of (\"random\", \"free\", \"allowed\", \"best\", \"first\", or an int>=0)";
400  }
401  return ok;
402 }
403 
404 
405 bool
406 SUMOVehicleParameter::parseDepartPos(const std::string& val, const std::string& element, const std::string& id,
407  SUMOReal& pos, DepartPosDefinition& dpd, std::string& error) {
408  bool ok = true;
409  if (val == "random") {
410  dpd = DEPART_POS_RANDOM;
411  } else if (val == "random_free") {
413  } else if (val == "free") {
414  dpd = DEPART_POS_FREE;
415  } else if (val == "base") {
416  dpd = DEPART_POS_BASE;
417  } else if (val == "last") {
418  dpd = DEPART_POS_LAST;
419  } else {
420  try {
421  pos = TplConvert::_2SUMOReal(val.c_str());
422  dpd = DEPART_POS_GIVEN;
423  } catch (...) {
424  ok = false;
425  }
426  }
427  if (!ok) {
428  error = "Invalid departPos definition for " + element + " '" + id + "';\n must be one of (\"random\", \"random_free\", \"free\", \"base\", \"last\" or a float)";
429  }
430  return ok;
431 }
432 
433 
434 bool
435 SUMOVehicleParameter::parseDepartPosLat(const std::string& val, const std::string& element, const std::string& id,
436  SUMOReal& pos, DepartPosLatDefinition& dpd, std::string& error) {
437  bool ok = true;
438  if (val == "random") {
439  dpd = DEPART_POSLAT_RANDOM;
440  } else if (val == "random_free") {
442  } else if (val == "free") {
443  dpd = DEPART_POSLAT_FREE;
444  } else if (val == "right") {
445  dpd = DEPART_POSLAT_RIGHT;
446  } else if (val == "center") {
447  dpd = DEPART_POSLAT_CENTER;
448  } else if (val == "left") {
449  dpd = DEPART_POSLAT_LEFT;
450  } else {
451  try {
452  pos = TplConvert::_2SUMOReal(val.c_str());
453  dpd = DEPART_POSLAT_GIVEN;
454  } catch (...) {
455  ok = false;
456  }
457  }
458  if (!ok) {
459  error = "Invalid departPosLat definition for " + element + " '" + id + "';\n must be one of (\"random\", \"random_free\", \"free\", \"right\", \"center\", \"left\", or a float)";
460  }
461  return ok;
462 }
463 
464 
465 bool
466 SUMOVehicleParameter::parseDepartSpeed(const std::string& val, const std::string& element, const std::string& id,
467  SUMOReal& speed, DepartSpeedDefinition& dsd, std::string& error) {
468  bool ok = true;
469  if (val == "random") {
470  dsd = DEPART_SPEED_RANDOM;
471  } else if (val == "max") {
472  dsd = DEPART_SPEED_MAX;
473  } else {
474  try {
475  speed = TplConvert::_2SUMOReal(val.c_str());
476  dsd = DEPART_SPEED_GIVEN;
477  if (speed < 0) {
478  ok = false;
479  }
480  } catch (...) {
481  ok = false;
482  }
483  }
484  if (!ok) {
485  error = "Invalid departSpeed definition for " + element + " '" + id + "';\n must be one of (\"random\", \"max\", or a float>=0)";
486  }
487  return ok;
488 }
489 
490 
491 bool
492 SUMOVehicleParameter::parseArrivalLane(const std::string& val, const std::string& element, const std::string& id,
493  int& lane, ArrivalLaneDefinition& ald, std::string& error) {
494  bool ok = true;
495  if (val == "current") {
496  ald = ARRIVAL_LANE_CURRENT;
497  } else {
498  try {
499  lane = TplConvert::_2int(val.c_str());
500  ald = ARRIVAL_LANE_GIVEN;
501  if (lane < 0) {
502  ok = false;
503  }
504  } catch (...) {
505  ok = false;
506  }
507  }
508  if (!ok) {
509  error = "Invalid arrivalLane definition for " + element + " '" + id + "';\n must be one of (\"current\", or an int>=0)";
510  }
511  return ok;
512 }
513 
514 
515 bool
516 SUMOVehicleParameter::parseArrivalPos(const std::string& val, const std::string& element, const std::string& id,
517  SUMOReal& pos, ArrivalPosDefinition& apd, std::string& error) {
518  bool ok = true;
519  if (val == "random") {
520  apd = ARRIVAL_POS_RANDOM;
521  } else if (val == "max") {
522  apd = ARRIVAL_POS_MAX;
523  } else {
524  try {
525  pos = TplConvert::_2SUMOReal(val.c_str());
526  apd = ARRIVAL_POS_GIVEN;
527  } catch (...) {
528  ok = false;
529  }
530  }
531  if (!ok) {
532  error = "Invalid arrivalPos definition for " + element + " '" + id + "';\n must be one of (\"random\", \"max\", or a float)";
533  }
534  return ok;
535 }
536 
537 
538 bool
539 SUMOVehicleParameter::parseArrivalPosLat(const std::string& val, const std::string& element, const std::string& id,
540  SUMOReal& pos, ArrivalPosLatDefinition& apd, std::string& error) {
541  bool ok = true;
542  if (val == "right") {
543  apd = ARRIVAL_POSLAT_RIGHT;
544  } else if (val == "center") {
545  apd = ARRIVAL_POSLAT_CENTER;
546  } else if (val == "left") {
547  apd = ARRIVAL_POSLAT_LEFT;
548  } else {
549  try {
550  pos = TplConvert::_2SUMOReal(val.c_str());
551  apd = ARRIVAL_POSLAT_GIVEN;
552  } catch (...) {
553  ok = false;
554  }
555  }
556  if (!ok) {
557  error = "Invalid arrivalPosLat definition for " + element + " '" + id + "';\n must be one of (\"right\", \"center\", \"left\", or a float)";
558  }
559  return ok;
560 }
561 
562 
563 bool
564 SUMOVehicleParameter::parseArrivalSpeed(const std::string& val, const std::string& element, const std::string& id,
565  SUMOReal& speed, ArrivalSpeedDefinition& asd, std::string& error) {
566  bool ok = true;
567  if (val == "current") {
568  asd = ARRIVAL_SPEED_CURRENT;
569  } else {
570  try {
571  speed = TplConvert::_2SUMOReal(val.c_str());
572  if (speed < 0) {
573  ok = false;
574  }
575  asd = ARRIVAL_SPEED_GIVEN;
576  } catch (...) {
577  ok = false;
578  }
579  }
580  if (!ok) {
581  error = "Invalid arrivalSpeed definition for " + element + " '" + id + "';\n must be one of (\"current\", or a float>=0)";
582  }
583  return ok;
584 }
585 
586 
587 SUMOReal
588 SUMOVehicleParameter::interpretEdgePos(SUMOReal pos, SUMOReal maximumValue, SumoXMLAttr attr, const std::string& id) {
589  if (pos < 0) {
590  pos = maximumValue + pos;
591  }
592  if (pos > maximumValue) {
593  WRITE_WARNING("Invalid " + toString(attr) + " " + toString(pos) + " given for " + id + ". Using edge end instead.");
594  pos = maximumValue;
595  }
596  return pos;
597 }
598 
599 
600 /****************************************************************************/
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)
bool defaultOptionOverrides(const OptionsCont &oc, const std::string &optionName) const
Returns whether the defaults shall be used.
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.
At the leftmost side of the lane.
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.
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
The position is given.
const int VEHPARS_ARRIVALLANE_SET
The speed is chosen randomly.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
The lane is chosen randomly.
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
ArrivalSpeedDefinition arrivalSpeedProcedure
Information how the vehicle&#39;s end speed shall be chosen.
The arrival position is given.
DepartPosLatDefinition
ArrivalPosLatDefinition
Possible ways to choose the departure position.
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.
SUMOVehicleParameter()
Constructor.
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
No information given; use default.
const int STOP_START_SET
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
At the center of the lane.
DepartPosDefinition departPosProcedure
Information how the vehicle shall choose the departure position.
The least occupied lane from lanes which allow the continuation.
const int VEHPARS_DEPARTSPEED_SET
void write(OutputDevice &dev, const OptionsCont &oc, const SumoXMLTag tag=SUMO_TAG_VEHICLE) const
Writes the parameters as a beginning element.
The current speed is used.
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
At the rightmost side of the lane.
int arrivalLane
(optional) The lane the vehicle shall arrive on (not used yet)
const int VEHPARS_DEPARTPOSLAT_SET
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
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_ARRIVALPOSLAT_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
void write(OutputDevice &dev) const
Writes the stop as XML.
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.
No information given; use default.
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.
bool wasSet(int what) const
Returns whether the given parameter was set.
static bool parseArrivalPosLat(const std::string &val, const std::string &element, const std::string &id, SUMOReal &pos, ArrivalPosLatDefinition &apd, std::string &error)
Validates a given arrivalPosLat 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.
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.