SUMO - Simulation of Urban MObility
SUMOVehicleParameter.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2018 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
17 // Structure representing possible vehicle parameter
18 /****************************************************************************/
19 
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #include <config.h>
25 
26 #include "SUMOVehicleParameter.h"
27 #include <utils/common/ToString.h>
32 
33 
34 // ===========================================================================
35 // member method definitions
36 // ===========================================================================
38  : vtypeid(DEFAULT_VTYPE_ID), color(RGBColor::DEFAULT_COLOR),
39  depart(-1), departProcedure(DEPART_GIVEN),
40  departLane(0), departLaneProcedure(DEPART_LANE_DEFAULT),
41  departPos(0), departPosProcedure(DEPART_POS_DEFAULT),
42  departPosLat(0), departPosLatProcedure(DEPART_POSLAT_DEFAULT),
43  departSpeed(-1), departSpeedProcedure(DEPART_SPEED_DEFAULT),
44  arrivalLane(0), arrivalLaneProcedure(ARRIVAL_LANE_DEFAULT),
45  arrivalPos(0), arrivalPosProcedure(ARRIVAL_POS_DEFAULT),
46  arrivalPosLat(0), arrivalPosLatProcedure(ARRIVAL_POSLAT_DEFAULT),
47  arrivalSpeed(-1), arrivalSpeedProcedure(ARRIVAL_SPEED_DEFAULT),
48  repetitionNumber(-1), repetitionsDone(-1), repetitionOffset(-1), repetitionProbability(-1), repetitionEnd(-1),
49  line(), fromTaz(), toTaz(), personNumber(0), containerNumber(0), parametersSet(0) {
50 }
51 
53 }
54 
55 bool
56 SUMOVehicleParameter::defaultOptionOverrides(const OptionsCont& oc, const std::string& optionName) const {
57  return oc.exists(optionName) && oc.isSet(optionName) && oc.getBool("defaults-override");
58 }
59 
60 
61 void
62 SUMOVehicleParameter::write(OutputDevice& dev, const OptionsCont& oc, const SumoXMLTag tag, const std::string& typeID) const {
63  dev.openTag(tag).writeAttr(SUMO_ATTR_ID, id);
64  if (typeID == "") {
67  }
68  } else {
69  dev.writeAttr(SUMO_ATTR_TYPE, typeID);
70  }
72  dev.writeAttr(SUMO_ATTR_DEPART, "triggered");
74  dev.writeAttr(SUMO_ATTR_DEPART, "containerTriggered");
75  } else {
77  }
78 
79  // optional parameter
80  // departlane
81  if (wasSet(VEHPARS_DEPARTLANE_SET) && !defaultOptionOverrides(oc, "departlane")) {
82  std::string val;
83  switch (departLaneProcedure) {
84  case DEPART_LANE_GIVEN:
85  val = toString(departLane);
86  break;
87  case DEPART_LANE_RANDOM:
88  val = "random";
89  break;
90  case DEPART_LANE_FREE:
91  val = "free";
92  break;
94  val = "allowed";
95  break;
97  val = "best";
98  break;
100  val = "first";
101  break;
102  case DEPART_LANE_DEFAULT:
103  default:
104  break;
105  }
107  } else if (oc.exists("departlane") && oc.isSet("departlane")) {
108  dev.writeNonEmptyAttr(SUMO_ATTR_DEPARTLANE, oc.getString("departlane"));
109  }
110  // departpos
111  if (wasSet(VEHPARS_DEPARTPOS_SET) && !defaultOptionOverrides(oc, "departpos")) {
112  std::string val;
113  switch (departPosProcedure) {
114  case DEPART_POS_GIVEN:
115  val = toString(departPos);
116  break;
117  case DEPART_POS_RANDOM:
118  val = "random";
119  break;
121  val = "random_free";
122  break;
123  case DEPART_POS_FREE:
124  val = "free";
125  break;
126  case DEPART_POS_LAST:
127  val = "last";
128  break;
129  case DEPART_POS_BASE:
130  val = "base";
131  break;
132  case DEPART_POS_DEFAULT:
133  default:
134  break;
135  }
137  } else if (oc.exists("departpos") && oc.isSet("departpos")) {
138  dev.writeNonEmptyAttr(SUMO_ATTR_DEPARTPOS, oc.getString("departpos"));
139  }
140  // departPosLat
142  std::string val;
143  switch (departPosLatProcedure) {
144  case DEPART_POSLAT_GIVEN:
145  val = toString(departPos);
146  break;
148  val = "random";
149  break;
151  val = "random_free";
152  break;
153  case DEPART_POSLAT_FREE:
154  val = "free";
155  break;
156  case DEPART_POSLAT_RIGHT:
157  val = "right";
158  break;
160  val = "center";
161  break;
162  case DEPART_POSLAT_LEFT:
163  val = "left";
164  break;
166  default:
167  break;
168  }
170  }
171  // departspeed
172  if (wasSet(VEHPARS_DEPARTSPEED_SET) && !defaultOptionOverrides(oc, "departspeed")) {
173  std::string val;
174  switch (departSpeedProcedure) {
175  case DEPART_SPEED_GIVEN:
176  val = toString(departSpeed);
177  break;
178  case DEPART_SPEED_RANDOM:
179  val = "random";
180  break;
181  case DEPART_SPEED_MAX:
182  val = "max";
183  break;
185  default:
186  break;
187  }
189  } else if (oc.exists("departspeed") && oc.isSet("departspeed")) {
190  dev.writeNonEmptyAttr(SUMO_ATTR_DEPARTSPEED, oc.getString("departspeed"));
191  }
192 
193  // arrivallane
194  if (wasSet(VEHPARS_ARRIVALLANE_SET) && !defaultOptionOverrides(oc, "arrivallane")) {
195  std::string val;
196  switch (arrivalLaneProcedure) {
197  case ARRIVAL_LANE_GIVEN:
198  val = toString(arrivalLane);
199  break;
201  val = "current";
202  break;
204  default:
205  break;
206  }
208  } else if (oc.exists("arrivallane") && oc.isSet("arrivallane")) {
209  dev.writeNonEmptyAttr(SUMO_ATTR_ARRIVALLANE, oc.getString("arrivallane"));
210  }
211  // arrivalpos
212  if (wasSet(VEHPARS_ARRIVALPOS_SET) && !defaultOptionOverrides(oc, "arrivalpos")) {
213  std::string val;
214  switch (arrivalPosProcedure) {
215  case ARRIVAL_POS_GIVEN:
216  val = toString(arrivalPos);
217  break;
218  case ARRIVAL_POS_RANDOM:
219  val = "random";
220  break;
221  case ARRIVAL_POS_CENTER:
222  val = "center";
223  break;
224  case ARRIVAL_POS_MAX:
225  val = "max";
226  break;
227  case ARRIVAL_POS_DEFAULT:
228  default:
229  break;
230  }
232  } else if (oc.exists("arrivalpos") && oc.isSet("arrivalpos")) {
233  dev.writeNonEmptyAttr(SUMO_ATTR_ARRIVALPOS, oc.getString("arrivalpos"));
234  }
235  // arrivalPosLat
237  std::string val;
238  switch (arrivalPosLatProcedure) {
240  val = toString(arrivalPos);
241  break;
243  val = "right";
244  break;
246  val = "center";
247  break;
248  case ARRIVAL_POSLAT_LEFT:
249  val = "left";
250  break;
252  default:
253  break;
254  }
256  }
257  // arrivalspeed
258  if (wasSet(VEHPARS_ARRIVALSPEED_SET) && !defaultOptionOverrides(oc, "arrivalspeed")) {
259  std::string val;
260  switch (arrivalSpeedProcedure) {
261  case ARRIVAL_SPEED_GIVEN:
262  val = toString(arrivalSpeed);
263  break;
265  val = "current";
266  break;
268  default:
269  break;
270  }
272  } else if (oc.exists("arrivalspeed") && oc.isSet("arrivalspeed")) {
273  dev.writeNonEmptyAttr(SUMO_ATTR_ARRIVALSPEED, oc.getString("arrivalspeed"));
274  }
275 
276  // color
277  if (wasSet(VEHPARS_COLOR_SET)) {
279  }
280  if (wasSet(VEHPARS_LINE_SET)) {
282  }
285  }
286  if (wasSet(VEHPARS_TO_TAZ_SET)) {
288  }
291  }
294  }
295 }
296 
297 
298 void
300  dev.openTag(SUMO_TAG_STOP);
301  if (busstop != "") {
302  dev.writeAttr(SUMO_ATTR_BUS_STOP, busstop);
303  }
304  if (containerstop != "") {
305  dev.writeAttr(SUMO_ATTR_CONTAINER_STOP, containerstop);
306  }
307  if (parkingarea != "") {
308  dev.writeAttr(SUMO_ATTR_PARKING_AREA, parkingarea);
309  }
310  if (busstop == "" && containerstop == "" && parkingarea == "") {
311  dev.writeAttr(SUMO_ATTR_LANE, lane);
312  if ((parametersSet & STOP_START_SET) != 0) {
313  dev.writeAttr(SUMO_ATTR_STARTPOS, startPos);
314  }
315  if ((parametersSet & STOP_END_SET) != 0) {
316  dev.writeAttr(SUMO_ATTR_ENDPOS, endPos);
317  }
318  }
319  if (duration >= 0) {
320  dev.writeAttr(SUMO_ATTR_DURATION, time2string(duration));
321  }
322  if (until >= 0) {
324  }
325  if ((parametersSet & STOP_TRIGGER_SET) != 0) {
326  dev.writeAttr(SUMO_ATTR_TRIGGERED, triggered);
327  }
329  dev.writeAttr(SUMO_ATTR_CONTAINER_TRIGGERED, containerTriggered);
330  }
331  if ((parametersSet & STOP_PARKING_SET) != 0) {
332  dev.writeAttr(SUMO_ATTR_PARKING, parking);
333  }
334  if ((parametersSet & STOP_EXPECTED_SET) != 0) {
335  dev.writeAttr(SUMO_ATTR_EXPECTED, awaitedPersons);
336  }
338  dev.writeAttr(SUMO_ATTR_EXPECTED_CONTAINERS, awaitedContainers);
339  }
340  dev.closeTag();
341 }
342 
343 
344 bool
345 SUMOVehicleParameter::parseDepart(const std::string& val, const std::string& element, const std::string& id,
346  SUMOTime& depart, DepartDefinition& dd, std::string& error) {
347  if (val == "triggered") {
348  dd = DEPART_TRIGGERED;
349  } else if (val == "containerTriggered") {
351  } else if (val == "now") {
352  // only used via TraCI. depart must be set by the calling code
353  dd = DEPART_NOW;
354  } else {
355  try {
356  depart = string2time(val);
357  dd = DEPART_GIVEN;
358  if (depart < 0) {
359  error = "Negative departure time in the definition of '" + id + "'.";
360  return false;
361  }
362  } catch (...) {
363  error = "Invalid departure time for " + element + " '" + id + "';\n must be one of (\"triggered\", \"containerTriggered\", \"now\", or a float >= 0)";
364  return false;
365  }
366  }
367  return true;
368 }
369 
370 
371 bool
372 SUMOVehicleParameter::parseDepartLane(const std::string& val, const std::string& element, const std::string& id,
373  int& lane, DepartLaneDefinition& dld, std::string& error) {
374  bool ok = true;
375  if (val == "random") {
376  dld = DEPART_LANE_RANDOM;
377  } else if (val == "free") {
378  dld = DEPART_LANE_FREE;
379  } else if (val == "allowed") {
381  } else if (val == "best") {
382  dld = DEPART_LANE_BEST_FREE;
383  } else if (val == "first") {
385  } else {
386  try {
387  lane = StringUtils::toInt(val);
388  dld = DEPART_LANE_GIVEN;
389  if (lane < 0) {
390  ok = false;
391  }
392  } catch (...) {
393  ok = false;
394  }
395  }
396  if (!ok) {
397  error = "Invalid departLane definition for " + element + " '" + id + "';\n must be one of (\"random\", \"free\", \"allowed\", \"best\", \"first\", or an int>=0)";
398  }
399  return ok;
400 }
401 
402 
403 bool
404 SUMOVehicleParameter::parseDepartPos(const std::string& val, const std::string& element, const std::string& id,
405  double& pos, DepartPosDefinition& dpd, std::string& error) {
406  bool ok = true;
407  if (val == "random") {
408  dpd = DEPART_POS_RANDOM;
409  } else if (val == "random_free") {
411  } else if (val == "free") {
412  dpd = DEPART_POS_FREE;
413  } else if (val == "base") {
414  dpd = DEPART_POS_BASE;
415  } else if (val == "last") {
416  dpd = DEPART_POS_LAST;
417  } else {
418  try {
419  pos = StringUtils::toDouble(val);
420  dpd = DEPART_POS_GIVEN;
421  } catch (...) {
422  ok = false;
423  }
424  }
425  if (!ok) {
426  error = "Invalid departPos definition for " + element + " '" + id + "';\n must be one of (\"random\", \"random_free\", \"free\", \"base\", \"last\" or a float)";
427  }
428  return ok;
429 }
430 
431 
432 bool
433 SUMOVehicleParameter::parseDepartPosLat(const std::string& val, const std::string& element, const std::string& id,
434  double& pos, DepartPosLatDefinition& dpd, std::string& error) {
435  bool ok = true;
436  if (val == "random") {
437  dpd = DEPART_POSLAT_RANDOM;
438  } else if (val == "random_free") {
440  } else if (val == "free") {
441  dpd = DEPART_POSLAT_FREE;
442  } else if (val == "right") {
443  dpd = DEPART_POSLAT_RIGHT;
444  } else if (val == "center") {
445  dpd = DEPART_POSLAT_CENTER;
446  } else if (val == "left") {
447  dpd = DEPART_POSLAT_LEFT;
448  } else {
449  try {
450  pos = StringUtils::toDouble(val);
451  dpd = DEPART_POSLAT_GIVEN;
452  } catch (...) {
453  ok = false;
454  }
455  }
456  if (!ok) {
457  error = "Invalid departPosLat definition for " + element + " '" + id + "';\n must be one of (\"random\", \"random_free\", \"free\", \"right\", \"center\", \"left\", or a float)";
458  }
459  return ok;
460 }
461 
462 
463 bool
464 SUMOVehicleParameter::parseDepartSpeed(const std::string& val, const std::string& element, const std::string& id,
465  double& speed, DepartSpeedDefinition& dsd, std::string& error) {
466  bool ok = true;
467  if (val == "random") {
468  dsd = DEPART_SPEED_RANDOM;
469  } else if (val == "max") {
470  dsd = DEPART_SPEED_MAX;
471  } else {
472  try {
473  speed = StringUtils::toDouble(val);
474  dsd = DEPART_SPEED_GIVEN;
475  if (speed < 0) {
476  ok = false;
477  }
478  } catch (...) {
479  ok = false;
480  }
481  }
482  if (!ok) {
483  error = "Invalid departSpeed definition for " + element + " '" + id + "';\n must be one of (\"random\", \"max\", or a float>=0)";
484  }
485  return ok;
486 }
487 
488 
489 bool
490 SUMOVehicleParameter::parseArrivalLane(const std::string& val, const std::string& element, const std::string& id,
491  int& lane, ArrivalLaneDefinition& ald, std::string& error) {
492  bool ok = true;
493  if (val == "current") {
494  ald = ARRIVAL_LANE_CURRENT;
495  } else {
496  try {
497  lane = StringUtils::toInt(val);
498  ald = ARRIVAL_LANE_GIVEN;
499  if (lane < 0) {
500  ok = false;
501  }
502  } catch (...) {
503  ok = false;
504  }
505  }
506  if (!ok) {
507  error = "Invalid arrivalLane definition for " + element + " '" + id + "';\n must be one of (\"current\", or an int>=0)";
508  }
509  return ok;
510 }
511 
512 
513 bool
514 SUMOVehicleParameter::parseArrivalPos(const std::string& val, const std::string& element, const std::string& id,
515  double& pos, ArrivalPosDefinition& apd, std::string& error) {
516  bool ok = true;
517  if (val == "random") {
518  apd = ARRIVAL_POS_RANDOM;
519  } else if (val == "center") {
520  apd = ARRIVAL_POS_CENTER;
521  } else if (val == "max") {
522  apd = ARRIVAL_POS_MAX;
523  } else {
524  try {
525  pos = StringUtils::toDouble(val);
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  double& 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 = StringUtils::toDouble(val);
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  double& 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 = StringUtils::toDouble(val);
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 double
588 SUMOVehicleParameter::interpretEdgePos(double pos, double 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
~SUMOVehicleParameter()
Destructor.
No information given; use default.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
Definition: OutputDevice.h:256
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:36
At the leftmost side of the lane.
static bool parseArrivalPosLat(const std::string &val, const std::string &element, const std::string &id, double &pos, ArrivalPosLatDefinition &apd, std::string &error)
Validates a given arrivalPosLat value.
The time is given.
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.
ArrivalLaneDefinition
Possible ways to choose the arrival lane.
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.
The position is given.
The lateral position is chosen randomly.
The least occupied lane is used.
If a fixed number of random choices fails, a free lateral position is chosen.
int parametersSet
Information for the router which parameter were set, TraCI may modify this (whe changing color) ...
std::string time2string(SUMOTime t)
Definition: SUMOTime.cpp:65
ArrivalPosLatDefinition arrivalPosLatProcedure
Information how the vehicle shall choose the lateral arrival position.
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:241
The speed is given.
std::string toTaz
The vehicle&#39;s destination zone (district)
The lane is given.
const int VEHPARS_ARRIVALSPEED_SET
static double interpretEdgePos(double pos, double maximumValue, SumoXMLAttr attr, const std::string &id)
Interprets negative edge positions and fits them onto a given edge.
double departSpeed
(optional) The initial speed of the vehicle
SUMOVehicleParameter()
Constructor.
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
Half the road length.
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.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:49
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.
const int VEHPARS_DEPARTSPEED_SET
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter ...
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.
bool exists(const std::string &name) const
Returns the information whether the named option is known.
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:42
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.
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.
static int toInt(const std::string &sData)
converts a string into the integer value described by it by calling the char-type converter...
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.
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)
double arrivalPos
(optional) The position the vehicle shall arrive on
DepartSpeedDefinition
Possible ways to choose the departure speed.
const int STOP_END_SET
const int VEHPARS_ARRIVALPOSLAT_SET
const int VEHPARS_LINE_SET
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
stop for vehicles
double departPos
(optional) The position the vehicle shall depart from
const int STOP_TRIGGER_SET
const int STOP_EXPECTED_CONTAINERS_SET
static bool parseDepartPos(const std::string &val, const std::string &element, const std::string &id, double &pos, DepartPosDefinition &dpd, std::string &error)
Validates a given departPos value.
static bool parseDepartPosLat(const std::string &val, const std::string &element, const std::string &id, double &pos, DepartPosLatDefinition &dpd, std::string &error)
Validates a given departPosLat value.
static bool parseArrivalSpeed(const std::string &val, const std::string &element, const std::string &id, double &speed, ArrivalSpeedDefinition &asd, std::string &error)
Validates a given arrivalSpeed value.
At the rightmost side of the lane.
At the center of the lane.
A storage for options typed value containers)
Definition: OptionsCont.h:92
const int VEHPARS_DEPARTLANE_SET
static bool parseArrivalPos(const std::string &val, const std::string &element, const std::string &id, double &pos, ArrivalPosDefinition &apd, std::string &error)
Validates a given arrivalPos value.
No information given; use default.
The arrival lane is given.
int containerNumber
The static number of containers in the vehicle when it departs.
static bool parseDepartSpeed(const std::string &val, const std::string &element, const std::string &id, double &speed, DepartSpeedDefinition &dsd, std::string &error)
Validates a given departSpeed value.
No information given; use default.
bool wasSet(int what) const
Returns whether the given parameter was set.
const int VEHPARS_VTYPE_SET
No information given; use default.
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:64
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
ArrivalPosDefinition
Possible ways to choose the arrival position.
double arrivalSpeed
(optional) The final speed of the vehicle (not used yet)
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.
DepartPosLatDefinition departPosLatProcedure
Information how the vehicle shall choose the lateral departure position.