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