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 
41 // ===========================================================================
42 // member method definitions
43 // ===========================================================================
45  : vtypeid(DEFAULT_VTYPE_ID), color(RGBColor::DEFAULT_COLOR),
46  depart(-1), departProcedure(DEPART_GIVEN),
47  departLane(0), departLaneProcedure(DEPART_LANE_DEFAULT),
48  departPos(0), departPosProcedure(DEPART_POS_DEFAULT),
49  departPosLat(0), departPosLatProcedure(DEPART_POSLAT_DEFAULT),
50  departSpeed(-1), departSpeedProcedure(DEPART_SPEED_DEFAULT),
51  arrivalLane(0), arrivalLaneProcedure(ARRIVAL_LANE_DEFAULT),
52  arrivalPos(0), arrivalPosProcedure(ARRIVAL_POS_DEFAULT),
53  arrivalPosLat(0), arrivalPosLatProcedure(ARRIVAL_POSLAT_DEFAULT),
54  arrivalSpeed(-1), arrivalSpeedProcedure(ARRIVAL_SPEED_DEFAULT),
55  repetitionNumber(-1), repetitionsDone(-1), repetitionOffset(-1), repetitionProbability(-1), repetitionEnd(-1),
56  line(), fromTaz(), toTaz(), personNumber(0), containerNumber(0), setParameter(0) {
57 }
58 
60 }
61 
62 bool
63 SUMOVehicleParameter::defaultOptionOverrides(const OptionsCont& oc, const std::string& optionName) const {
64  return oc.exists(optionName) && oc.isSet(optionName) && oc.getBool("defaults-override");
65 }
66 
67 
68 void
69 SUMOVehicleParameter::write(OutputDevice& dev, const OptionsCont& oc, const SumoXMLTag tag, const std::string& typeID) const {
70  dev.openTag(tag).writeAttr(SUMO_ATTR_ID, id);
71  if (typeID == "") {
74  }
75  } else {
76  dev.writeAttr(SUMO_ATTR_TYPE, typeID);
77  }
79  dev.writeAttr(SUMO_ATTR_DEPART, "triggered");
81  dev.writeAttr(SUMO_ATTR_DEPART, "containerTriggered");
82  } else {
84  }
85 
86  // optional parameter
87  // departlane
88  if (wasSet(VEHPARS_DEPARTLANE_SET) && !defaultOptionOverrides(oc, "departlane")) {
89  std::string val;
90  switch (departLaneProcedure) {
91  case DEPART_LANE_GIVEN:
92  val = toString(departLane);
93  break;
94  case DEPART_LANE_RANDOM:
95  val = "random";
96  break;
97  case DEPART_LANE_FREE:
98  val = "free";
99  break;
101  val = "allowed";
102  break;
104  val = "best";
105  break;
107  val = "first";
108  break;
109  case DEPART_LANE_DEFAULT:
110  default:
111  break;
112  }
114  } else if (oc.exists("departlane") && oc.isSet("departlane")) {
115  dev.writeNonEmptyAttr(SUMO_ATTR_DEPARTLANE, oc.getString("departlane"));
116  }
117  // departpos
118  if (wasSet(VEHPARS_DEPARTPOS_SET) && !defaultOptionOverrides(oc, "departpos")) {
119  std::string val;
120  switch (departPosProcedure) {
121  case DEPART_POS_GIVEN:
122  val = toString(departPos);
123  break;
124  case DEPART_POS_RANDOM:
125  val = "random";
126  break;
128  val = "random_free";
129  break;
130  case DEPART_POS_FREE:
131  val = "free";
132  break;
133  case DEPART_POS_LAST:
134  val = "last";
135  break;
136  case DEPART_POS_BASE:
137  val = "base";
138  break;
139  case DEPART_POS_DEFAULT:
140  default:
141  break;
142  }
144  } else if (oc.exists("departpos") && oc.isSet("departpos")) {
145  dev.writeNonEmptyAttr(SUMO_ATTR_DEPARTPOS, oc.getString("departpos"));
146  }
147  // departPosLat
149  std::string val;
150  switch (departPosProcedure) {
151  case DEPART_POSLAT_GIVEN:
152  val = toString(departPos);
153  break;
155  val = "random";
156  break;
158  val = "random_free";
159  break;
160  case DEPART_POSLAT_FREE:
161  val = "free";
162  break;
163  case DEPART_POSLAT_RIGHT:
164  val = "right";
165  break;
167  val = "center";
168  break;
169  case DEPART_POSLAT_LEFT:
170  val = "left";
171  break;
173  default:
174  break;
175  }
177  }
178  // departspeed
179  if (wasSet(VEHPARS_DEPARTSPEED_SET) && !defaultOptionOverrides(oc, "departspeed")) {
180  std::string val;
181  switch (departSpeedProcedure) {
182  case DEPART_SPEED_GIVEN:
183  val = toString(departSpeed);
184  break;
185  case DEPART_SPEED_RANDOM:
186  val = "random";
187  break;
188  case DEPART_SPEED_MAX:
189  val = "max";
190  break;
192  default:
193  break;
194  }
196  } else if (oc.exists("departspeed") && oc.isSet("departspeed")) {
197  dev.writeNonEmptyAttr(SUMO_ATTR_DEPARTSPEED, oc.getString("departspeed"));
198  }
199 
200  // arrivallane
201  if (wasSet(VEHPARS_ARRIVALLANE_SET) && !defaultOptionOverrides(oc, "arrivallane")) {
202  std::string val;
203  switch (arrivalLaneProcedure) {
204  case ARRIVAL_LANE_GIVEN:
205  val = toString(arrivalLane);
206  break;
208  val = "current";
209  break;
211  default:
212  break;
213  }
215  } else if (oc.exists("arrivallane") && oc.isSet("arrivallane")) {
216  dev.writeNonEmptyAttr(SUMO_ATTR_ARRIVALLANE, oc.getString("arrivallane"));
217  }
218  // arrivalpos
219  if (wasSet(VEHPARS_ARRIVALPOS_SET) && !defaultOptionOverrides(oc, "arrivalpos")) {
220  std::string val;
221  switch (arrivalPosProcedure) {
222  case ARRIVAL_POS_GIVEN:
223  val = toString(arrivalPos);
224  break;
225  case ARRIVAL_POS_RANDOM:
226  val = "random";
227  break;
228  case ARRIVAL_POS_MAX:
229  val = "max";
230  break;
231  case ARRIVAL_POS_DEFAULT:
232  default:
233  break;
234  }
236  } else if (oc.exists("arrivalpos") && oc.isSet("arrivalpos")) {
237  dev.writeNonEmptyAttr(SUMO_ATTR_ARRIVALPOS, oc.getString("arrivalpos"));
238  }
239  // arrivalPosLat
241  std::string val;
242  switch (arrivalPosProcedure) {
244  val = toString(arrivalPos);
245  break;
247  val = "right";
248  break;
250  val = "center";
251  break;
252  case ARRIVAL_POSLAT_LEFT:
253  val = "left";
254  break;
256  default:
257  break;
258  }
260  }
261  // arrivalspeed
262  if (wasSet(VEHPARS_ARRIVALSPEED_SET) && !defaultOptionOverrides(oc, "arrivalspeed")) {
263  std::string val;
264  switch (arrivalSpeedProcedure) {
265  case ARRIVAL_SPEED_GIVEN:
266  val = toString(arrivalSpeed);
267  break;
269  val = "current";
270  break;
272  default:
273  break;
274  }
276  } else if (oc.exists("arrivalspeed") && oc.isSet("arrivalspeed")) {
277  dev.writeNonEmptyAttr(SUMO_ATTR_ARRIVALSPEED, oc.getString("arrivalspeed"));
278  }
279 
280  // color
281  if (wasSet(VEHPARS_COLOR_SET)) {
283  }
284  if (wasSet(VEHPARS_LINE_SET)) {
286  }
289  }
290  if (wasSet(VEHPARS_TO_TAZ_SET)) {
292  }
295  }
298  }
299 }
300 
301 
302 void
304  dev.openTag(SUMO_TAG_STOP);
305  if (busstop != "") {
306  dev.writeAttr(SUMO_ATTR_BUS_STOP, busstop);
307  }
308  if (containerstop != "") {
309  dev.writeAttr(SUMO_ATTR_CONTAINER_STOP, containerstop);
310  }
311  if (parkingarea != "") {
312  dev.writeAttr(SUMO_ATTR_PARKING_AREA, parkingarea);
313  }
314  if (busstop == "" && containerstop == "" && parkingarea == "") {
315  dev.writeAttr(SUMO_ATTR_LANE, lane);
316  if ((setParameter & STOP_START_SET) != 0) {
317  dev.writeAttr(SUMO_ATTR_STARTPOS, startPos);
318  }
319  if ((setParameter & STOP_END_SET) != 0) {
320  dev.writeAttr(SUMO_ATTR_ENDPOS, endPos);
321  }
322  }
323  if (duration >= 0) {
324  dev.writeAttr(SUMO_ATTR_DURATION, STEPS2TIME(duration));
325  }
326  if (until >= 0) {
327  dev.writeAttr(SUMO_ATTR_UNTIL, STEPS2TIME(until));
328  }
329  if ((setParameter & STOP_TRIGGER_SET) != 0) {
330  dev.writeAttr(SUMO_ATTR_TRIGGERED, triggered);
331  }
333  dev.writeAttr(SUMO_ATTR_CONTAINER_TRIGGERED, containerTriggered);
334  }
335  if ((setParameter & STOP_PARKING_SET) != 0) {
336  dev.writeAttr(SUMO_ATTR_PARKING, parking);
337  }
338  // look, we are writing the set of expected persons in its current state...
339  // if this method is used somewhere in the simulation output,
340  // one should consider keeping the original values additionally,
341  // as the ones we write may hev changed.
342  if ((setParameter & STOP_EXPECTED_SET) != 0) {
343  dev.writeAttr(SUMO_ATTR_EXPECTED, awaitedPersons);
344  }
346  dev.writeAttr(SUMO_ATTR_EXPECTED_CONTAINERS, awaitedContainers);
347  }
348  dev.closeTag();
349 }
350 
351 
352 bool
353 SUMOVehicleParameter::parseDepart(const std::string& val, const std::string& element, const std::string& id,
354  SUMOTime& depart, DepartDefinition& dd, std::string& error) {
355  if (val == "triggered") {
356  dd = DEPART_TRIGGERED;
357  } else if (val == "containerTriggered") {
359  } else if (val == "now") {
360  dd = DEPART_NOW;
361  } else {
362  try {
363  depart = string2time(val);
364  dd = DEPART_GIVEN;
365  if (depart < 0) {
366  error = "Negative departure time in the definition of '" + id + "'.";
367  return false;
368  }
369  } catch (...) {
370  error = "Invalid departure time for " + element + " '" + id + "';\n must be one of (\"triggered\", \"containerTriggered\", \"now\", or a float >= 0)";
371  return false;
372  }
373  }
374  return true;
375 }
376 
377 
378 bool
379 SUMOVehicleParameter::parseDepartLane(const std::string& val, const std::string& element, const std::string& id,
380  int& lane, DepartLaneDefinition& dld, std::string& error) {
381  bool ok = true;
382  if (val == "random") {
383  dld = DEPART_LANE_RANDOM;
384  } else if (val == "free") {
385  dld = DEPART_LANE_FREE;
386  } else if (val == "allowed") {
388  } else if (val == "best") {
389  dld = DEPART_LANE_BEST_FREE;
390  } else if (val == "first") {
392  } else {
393  try {
394  lane = TplConvert::_2int(val.c_str());
395  dld = DEPART_LANE_GIVEN;
396  if (lane < 0) {
397  ok = false;
398  }
399  } catch (...) {
400  ok = false;
401  }
402  }
403  if (!ok) {
404  error = "Invalid departLane definition for " + element + " '" + id + "';\n must be one of (\"random\", \"free\", \"allowed\", \"best\", \"first\", or an int>=0)";
405  }
406  return ok;
407 }
408 
409 
410 bool
411 SUMOVehicleParameter::parseDepartPos(const std::string& val, const std::string& element, const std::string& id,
412  double& pos, DepartPosDefinition& dpd, std::string& error) {
413  bool ok = true;
414  if (val == "random") {
415  dpd = DEPART_POS_RANDOM;
416  } else if (val == "random_free") {
418  } else if (val == "free") {
419  dpd = DEPART_POS_FREE;
420  } else if (val == "base") {
421  dpd = DEPART_POS_BASE;
422  } else if (val == "last") {
423  dpd = DEPART_POS_LAST;
424  } else {
425  try {
426  pos = TplConvert::_2double(val.c_str());
427  dpd = DEPART_POS_GIVEN;
428  } catch (...) {
429  ok = false;
430  }
431  }
432  if (!ok) {
433  error = "Invalid departPos definition for " + element + " '" + id + "';\n must be one of (\"random\", \"random_free\", \"free\", \"base\", \"last\" or a float)";
434  }
435  return ok;
436 }
437 
438 
439 bool
440 SUMOVehicleParameter::parseDepartPosLat(const std::string& val, const std::string& element, const std::string& id,
441  double& pos, DepartPosLatDefinition& dpd, std::string& error) {
442  bool ok = true;
443  if (val == "random") {
444  dpd = DEPART_POSLAT_RANDOM;
445  } else if (val == "random_free") {
447  } else if (val == "free") {
448  dpd = DEPART_POSLAT_FREE;
449  } else if (val == "right") {
450  dpd = DEPART_POSLAT_RIGHT;
451  } else if (val == "center") {
452  dpd = DEPART_POSLAT_CENTER;
453  } else if (val == "left") {
454  dpd = DEPART_POSLAT_LEFT;
455  } else {
456  try {
457  pos = TplConvert::_2double(val.c_str());
458  dpd = DEPART_POSLAT_GIVEN;
459  } catch (...) {
460  ok = false;
461  }
462  }
463  if (!ok) {
464  error = "Invalid departPosLat definition for " + element + " '" + id + "';\n must be one of (\"random\", \"random_free\", \"free\", \"right\", \"center\", \"left\", or a float)";
465  }
466  return ok;
467 }
468 
469 
470 bool
471 SUMOVehicleParameter::parseDepartSpeed(const std::string& val, const std::string& element, const std::string& id,
472  double& speed, DepartSpeedDefinition& dsd, std::string& error) {
473  bool ok = true;
474  if (val == "random") {
475  dsd = DEPART_SPEED_RANDOM;
476  } else if (val == "max") {
477  dsd = DEPART_SPEED_MAX;
478  } else {
479  try {
480  speed = TplConvert::_2double(val.c_str());
481  dsd = DEPART_SPEED_GIVEN;
482  if (speed < 0) {
483  ok = false;
484  }
485  } catch (...) {
486  ok = false;
487  }
488  }
489  if (!ok) {
490  error = "Invalid departSpeed definition for " + element + " '" + id + "';\n must be one of (\"random\", \"max\", or a float>=0)";
491  }
492  return ok;
493 }
494 
495 
496 bool
497 SUMOVehicleParameter::parseArrivalLane(const std::string& val, const std::string& element, const std::string& id,
498  int& lane, ArrivalLaneDefinition& ald, std::string& error) {
499  bool ok = true;
500  if (val == "current") {
501  ald = ARRIVAL_LANE_CURRENT;
502  } else {
503  try {
504  lane = TplConvert::_2int(val.c_str());
505  ald = ARRIVAL_LANE_GIVEN;
506  if (lane < 0) {
507  ok = false;
508  }
509  } catch (...) {
510  ok = false;
511  }
512  }
513  if (!ok) {
514  error = "Invalid arrivalLane definition for " + element + " '" + id + "';\n must be one of (\"current\", or an int>=0)";
515  }
516  return ok;
517 }
518 
519 
520 bool
521 SUMOVehicleParameter::parseArrivalPos(const std::string& val, const std::string& element, const std::string& id,
522  double& pos, ArrivalPosDefinition& apd, std::string& error) {
523  bool ok = true;
524  if (val == "random") {
525  apd = ARRIVAL_POS_RANDOM;
526  } else if (val == "max") {
527  apd = ARRIVAL_POS_MAX;
528  } else {
529  try {
530  pos = TplConvert::_2double(val.c_str());
531  apd = ARRIVAL_POS_GIVEN;
532  } catch (...) {
533  ok = false;
534  }
535  }
536  if (!ok) {
537  error = "Invalid arrivalPos definition for " + element + " '" + id + "';\n must be one of (\"random\", \"max\", or a float)";
538  }
539  return ok;
540 }
541 
542 
543 bool
544 SUMOVehicleParameter::parseArrivalPosLat(const std::string& val, const std::string& element, const std::string& id,
545  double& pos, ArrivalPosLatDefinition& apd, std::string& error) {
546  bool ok = true;
547  if (val == "right") {
548  apd = ARRIVAL_POSLAT_RIGHT;
549  } else if (val == "center") {
550  apd = ARRIVAL_POSLAT_CENTER;
551  } else if (val == "left") {
552  apd = ARRIVAL_POSLAT_LEFT;
553  } else {
554  try {
555  pos = TplConvert::_2double(val.c_str());
556  apd = ARRIVAL_POSLAT_GIVEN;
557  } catch (...) {
558  ok = false;
559  }
560  }
561  if (!ok) {
562  error = "Invalid arrivalPosLat definition for " + element + " '" + id + "';\n must be one of (\"right\", \"center\", \"left\", or a float)";
563  }
564  return ok;
565 }
566 
567 
568 bool
569 SUMOVehicleParameter::parseArrivalSpeed(const std::string& val, const std::string& element, const std::string& id,
570  double& speed, ArrivalSpeedDefinition& asd, std::string& error) {
571  bool ok = true;
572  if (val == "current") {
573  asd = ARRIVAL_SPEED_CURRENT;
574  } else {
575  try {
576  speed = TplConvert::_2double(val.c_str());
577  if (speed < 0) {
578  ok = false;
579  }
580  asd = ARRIVAL_SPEED_GIVEN;
581  } catch (...) {
582  ok = false;
583  }
584  }
585  if (!ok) {
586  error = "Invalid arrivalSpeed definition for " + element + " '" + id + "';\n must be one of (\"current\", or a float>=0)";
587  }
588  return ok;
589 }
590 
591 
592 double
593 SUMOVehicleParameter::interpretEdgePos(double pos, double maximumValue, SumoXMLAttr attr, const std::string& id) {
594  if (pos < 0) {
595  pos = maximumValue + pos;
596  }
597  if (pos > maximumValue) {
598  WRITE_WARNING("Invalid " + toString(attr) + " " + toString(pos) + " given for " + id + ". Using edge end instead.");
599  pos = maximumValue;
600  }
601  return pos;
602 }
603 
604 
605 /****************************************************************************/
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.
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.
std::string time2string(SUMOTime t)
Definition: SUMOTime.cpp:60
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 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:56
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
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
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:47
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: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) ...
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:99
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:297
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:71
bool closeTag()
Closes the most recently opened tag.
ArrivalPosDefinition
Possible ways to choose the arrival position.
long long int SUMOTime
Definition: TraCIDefs.h:52
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.