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-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
19 // Structure representing possible vehicle parameter
20 /****************************************************************************/
21 
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #ifdef _MSC_VER
27 #include <windows_config.h>
28 #else
29 #include <config.h>
30 #endif
31 
32 #include "SUMOVehicleParameter.h"
33 #include <utils/common/ToString.h>
38 
39 
40 // ===========================================================================
41 // member method definitions
42 // ===========================================================================
44  : vtypeid(DEFAULT_VTYPE_ID), color(RGBColor::DEFAULT_COLOR),
45  depart(-1), departProcedure(DEPART_GIVEN),
46  departLane(0), departLaneProcedure(DEPART_LANE_DEFAULT),
47  departPos(0), departPosProcedure(DEPART_POS_DEFAULT),
48  departPosLat(0), departPosLatProcedure(DEPART_POSLAT_DEFAULT),
49  departSpeed(-1), departSpeedProcedure(DEPART_SPEED_DEFAULT),
50  arrivalLane(0), arrivalLaneProcedure(ARRIVAL_LANE_DEFAULT),
51  arrivalPos(0), arrivalPosProcedure(ARRIVAL_POS_DEFAULT),
52  arrivalPosLat(0), arrivalPosLatProcedure(ARRIVAL_POSLAT_DEFAULT),
53  arrivalSpeed(-1), arrivalSpeedProcedure(ARRIVAL_SPEED_DEFAULT),
54  repetitionNumber(-1), repetitionsDone(-1), repetitionOffset(-1), repetitionProbability(-1), repetitionEnd(-1),
55  line(), fromTaz(), toTaz(), personNumber(0), containerNumber(0), parametersSet(0) {
56 }
57 
59 }
60 
61 bool
62 SUMOVehicleParameter::defaultOptionOverrides(const OptionsCont& oc, const std::string& optionName) const {
63  return oc.exists(optionName) && oc.isSet(optionName) && oc.getBool("defaults-override");
64 }
65 
66 
67 void
68 SUMOVehicleParameter::write(OutputDevice& dev, const OptionsCont& oc, const SumoXMLTag tag, const std::string& typeID) const {
69  dev.openTag(tag).writeAttr(SUMO_ATTR_ID, id);
70  if (typeID == "") {
73  }
74  } else {
75  dev.writeAttr(SUMO_ATTR_TYPE, typeID);
76  }
78  dev.writeAttr(SUMO_ATTR_DEPART, "triggered");
80  dev.writeAttr(SUMO_ATTR_DEPART, "containerTriggered");
81  } else {
83  }
84 
85  // optional parameter
86  // departlane
87  if (wasSet(VEHPARS_DEPARTLANE_SET) && !defaultOptionOverrides(oc, "departlane")) {
88  std::string val;
89  switch (departLaneProcedure) {
90  case DEPART_LANE_GIVEN:
91  val = toString(departLane);
92  break;
93  case DEPART_LANE_RANDOM:
94  val = "random";
95  break;
96  case DEPART_LANE_FREE:
97  val = "free";
98  break;
100  val = "allowed";
101  break;
103  val = "best";
104  break;
106  val = "first";
107  break;
108  case DEPART_LANE_DEFAULT:
109  default:
110  break;
111  }
113  } else if (oc.exists("departlane") && oc.isSet("departlane")) {
114  dev.writeNonEmptyAttr(SUMO_ATTR_DEPARTLANE, oc.getString("departlane"));
115  }
116  // departpos
117  if (wasSet(VEHPARS_DEPARTPOS_SET) && !defaultOptionOverrides(oc, "departpos")) {
118  std::string val;
119  switch (departPosProcedure) {
120  case DEPART_POS_GIVEN:
121  val = toString(departPos);
122  break;
123  case DEPART_POS_RANDOM:
124  val = "random";
125  break;
127  val = "random_free";
128  break;
129  case DEPART_POS_FREE:
130  val = "free";
131  break;
132  case DEPART_POS_LAST:
133  val = "last";
134  break;
135  case DEPART_POS_BASE:
136  val = "base";
137  break;
138  case DEPART_POS_DEFAULT:
139  default:
140  break;
141  }
143  } else if (oc.exists("departpos") && oc.isSet("departpos")) {
144  dev.writeNonEmptyAttr(SUMO_ATTR_DEPARTPOS, oc.getString("departpos"));
145  }
146  // departPosLat
148  std::string val;
149  switch (departPosProcedure) {
150  case DEPART_POSLAT_GIVEN:
151  val = toString(departPos);
152  break;
154  val = "random";
155  break;
157  val = "random_free";
158  break;
159  case DEPART_POSLAT_FREE:
160  val = "free";
161  break;
162  case DEPART_POSLAT_RIGHT:
163  val = "right";
164  break;
166  val = "center";
167  break;
168  case DEPART_POSLAT_LEFT:
169  val = "left";
170  break;
172  default:
173  break;
174  }
176  }
177  // departspeed
178  if (wasSet(VEHPARS_DEPARTSPEED_SET) && !defaultOptionOverrides(oc, "departspeed")) {
179  std::string val;
180  switch (departSpeedProcedure) {
181  case DEPART_SPEED_GIVEN:
182  val = toString(departSpeed);
183  break;
184  case DEPART_SPEED_RANDOM:
185  val = "random";
186  break;
187  case DEPART_SPEED_MAX:
188  val = "max";
189  break;
191  default:
192  break;
193  }
195  } else if (oc.exists("departspeed") && oc.isSet("departspeed")) {
196  dev.writeNonEmptyAttr(SUMO_ATTR_DEPARTSPEED, oc.getString("departspeed"));
197  }
198 
199  // arrivallane
200  if (wasSet(VEHPARS_ARRIVALLANE_SET) && !defaultOptionOverrides(oc, "arrivallane")) {
201  std::string val;
202  switch (arrivalLaneProcedure) {
203  case ARRIVAL_LANE_GIVEN:
204  val = toString(arrivalLane);
205  break;
207  val = "current";
208  break;
210  default:
211  break;
212  }
214  } else if (oc.exists("arrivallane") && oc.isSet("arrivallane")) {
215  dev.writeNonEmptyAttr(SUMO_ATTR_ARRIVALLANE, oc.getString("arrivallane"));
216  }
217  // arrivalpos
218  if (wasSet(VEHPARS_ARRIVALPOS_SET) && !defaultOptionOverrides(oc, "arrivalpos")) {
219  std::string val;
220  switch (arrivalPosProcedure) {
221  case ARRIVAL_POS_GIVEN:
222  val = toString(arrivalPos);
223  break;
224  case ARRIVAL_POS_RANDOM:
225  val = "random";
226  break;
227  case ARRIVAL_POS_MAX:
228  val = "max";
229  break;
230  case ARRIVAL_POS_DEFAULT:
231  default:
232  break;
233  }
235  } else if (oc.exists("arrivalpos") && oc.isSet("arrivalpos")) {
236  dev.writeNonEmptyAttr(SUMO_ATTR_ARRIVALPOS, oc.getString("arrivalpos"));
237  }
238  // arrivalPosLat
240  std::string val;
241  switch (arrivalPosProcedure) {
243  val = toString(arrivalPos);
244  break;
246  val = "right";
247  break;
249  val = "center";
250  break;
251  case ARRIVAL_POSLAT_LEFT:
252  val = "left";
253  break;
255  default:
256  break;
257  }
259  }
260  // arrivalspeed
261  if (wasSet(VEHPARS_ARRIVALSPEED_SET) && !defaultOptionOverrides(oc, "arrivalspeed")) {
262  std::string val;
263  switch (arrivalSpeedProcedure) {
264  case ARRIVAL_SPEED_GIVEN:
265  val = toString(arrivalSpeed);
266  break;
268  val = "current";
269  break;
271  default:
272  break;
273  }
275  } else if (oc.exists("arrivalspeed") && oc.isSet("arrivalspeed")) {
276  dev.writeNonEmptyAttr(SUMO_ATTR_ARRIVALSPEED, oc.getString("arrivalspeed"));
277  }
278 
279  // color
280  if (wasSet(VEHPARS_COLOR_SET)) {
282  }
283  if (wasSet(VEHPARS_LINE_SET)) {
285  }
288  }
289  if (wasSet(VEHPARS_TO_TAZ_SET)) {
291  }
294  }
297  }
298 }
299 
300 
301 void
303  dev.openTag(SUMO_TAG_STOP);
304  if (busstop != "") {
305  dev.writeAttr(SUMO_ATTR_BUS_STOP, busstop);
306  }
307  if (containerstop != "") {
308  dev.writeAttr(SUMO_ATTR_CONTAINER_STOP, containerstop);
309  }
310  if (parkingarea != "") {
311  dev.writeAttr(SUMO_ATTR_PARKING_AREA, parkingarea);
312  }
313  if (busstop == "" && containerstop == "" && parkingarea == "") {
314  dev.writeAttr(SUMO_ATTR_LANE, lane);
315  if ((parametersSet & STOP_START_SET) != 0) {
316  dev.writeAttr(SUMO_ATTR_STARTPOS, startPos);
317  }
318  if ((parametersSet & STOP_END_SET) != 0) {
319  dev.writeAttr(SUMO_ATTR_ENDPOS, endPos);
320  }
321  }
322  if (duration >= 0) {
323  dev.writeAttr(SUMO_ATTR_DURATION, STEPS2TIME(duration));
324  }
325  if (until >= 0) {
326  dev.writeAttr(SUMO_ATTR_UNTIL, STEPS2TIME(until));
327  }
328  if ((parametersSet & STOP_TRIGGER_SET) != 0) {
329  dev.writeAttr(SUMO_ATTR_TRIGGERED, triggered);
330  }
332  dev.writeAttr(SUMO_ATTR_CONTAINER_TRIGGERED, containerTriggered);
333  }
334  if ((parametersSet & STOP_PARKING_SET) != 0) {
335  dev.writeAttr(SUMO_ATTR_PARKING, parking);
336  }
337  if ((parametersSet & 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  double& 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::_2double(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  double& 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::_2double(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  double& 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::_2double(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  double& 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::_2double(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  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 = TplConvert::_2double(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  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 = TplConvert::_2double(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 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:260
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.
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:59
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:199
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.
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: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:293
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
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:64
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:46
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.
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.
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
static int _2int(const E *const data)
converts a char-type array into the integer value described by it
Definition: TplConvert.h:155
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:98
const int VEHPARS_DEPARTLANE_SET
static double _2double(const E *const data)
converts a char-type array into the double value described by it
Definition: TplConvert.h:311
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:70
bool closeTag()
Closes the most recently opened tag.
ArrivalPosDefinition
Possible ways to choose the arrival position.
long long int SUMOTime
Definition: TraCIDefs.h:51
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.