SUMO - Simulation of Urban MObility
MSBaseVehicle.cpp
Go to the documentation of this file.
1 /****************************************************************************/
9 // A base class for vehicle implementations
10 /****************************************************************************/
11 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
12 // Copyright (C) 2001-2016 DLR (http://www.dlr.de/) and contributors
13 /****************************************************************************/
14 //
15 // This file is part of SUMO.
16 // SUMO is free software: you can redistribute it and/or modify
17 // it under the terms of the GNU General Public License as published by
18 // the Free Software Foundation, either version 3 of the License, or
19 // (at your option) any later version.
20 //
21 /****************************************************************************/
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #ifdef _MSC_VER
28 #include <windows_config.h>
29 #else
30 #include <config.h>
31 #endif
32 
33 #include <iostream>
34 #include <cassert>
35 #include <utils/common/StdDefs.h>
39 #include "MSGlobals.h"
40 #include "MSVehicleType.h"
41 #include "MSEdge.h"
42 #include "MSLane.h"
43 #include "MSMoveReminder.h"
44 #include "MSBaseVehicle.h"
45 #include "MSNet.h"
46 #include "devices/MSDevice.h"
47 
48 #ifdef CHECK_MEMORY_LEAKS
49 #include <foreign/nvwa/debug_new.h>
50 #endif // CHECK_MEMORY_LEAKS
51 
52 // ===========================================================================
53 // static members
54 // ===========================================================================
56 #ifdef _DEBUG
57 std::set<std::string> MSBaseVehicle::myShallTraceMoveReminders;
58 #endif
59 
60 // ===========================================================================
61 // method definitions
62 // ===========================================================================
64  const MSVehicleType* type, const SUMOReal speedFactor) :
65  myParameter(pars),
66  myRoute(route),
67  myType(type),
68  myCurrEdge(route->begin()),
69  myChosenSpeedFactor(speedFactor),
70  myMoveReminders(0),
71  myDeparture(NOT_YET_DEPARTED),
72  myDepartPos(NOT_YET_DEPARTED),
73  myArrivalPos(-1),
74  myArrivalLane(-1),
75  myNumberReroutes(0)
76 #ifdef _DEBUG
77  , myTraceMoveReminders(myShallTraceMoveReminders.count(pars->id) > 0)
78 #endif
79 {
80  // init devices
82  //
83  for (std::vector< MSDevice* >::iterator dev = myDevices.begin(); dev != myDevices.end(); ++dev) {
84  myMoveReminders.push_back(std::make_pair(*dev, 0.));
85  }
87  if (!pars->wasSet(VEHPARS_FORCE_REROUTE)) {
89  }
90 }
91 
93  myRoute->release();
94  if (myParameter->repetitionNumber == 0) {
96  }
97  for (std::vector< MSDevice* >::iterator dev = myDevices.begin(); dev != myDevices.end(); ++dev) {
98  delete *dev;
99  }
100  delete myParameter;
101 }
102 
103 
104 const std::string&
106  return myParameter->id;
107 }
108 
109 
112  return *myParameter;
113 }
114 
115 
116 SUMOReal
118  return myType->getMaxSpeed();
119 }
120 
121 
122 const MSEdge*
123 MSBaseVehicle::succEdge(int nSuccs) const {
124  if (myCurrEdge + nSuccs < myRoute->end() && std::distance(myCurrEdge, myRoute->begin()) <= nSuccs) {
125  return *(myCurrEdge + nSuccs);
126  } else {
127  return 0;
128  }
129 }
130 
131 
132 const MSEdge*
134  return *myCurrEdge;
135 }
136 
137 
138 void
139 MSBaseVehicle::reroute(SUMOTime t, SUMOAbstractRouter<MSEdge, SUMOVehicle>& router, const bool onInit, const bool withTaz) {
140  // check whether to reroute
141  const MSEdge* source = withTaz && onInit ? MSEdge::dictionary(myParameter->fromTaz + "-source") : getRerouteOrigin();
142  if (source == 0) {
143  source = getRerouteOrigin();
144  }
145  const MSEdge* sink = withTaz ? MSEdge::dictionary(myParameter->toTaz + "-sink") : myRoute->getLastEdge();
146  if (sink == 0) {
147  sink = myRoute->getLastEdge();
148  }
149  ConstMSEdgeVector edges;
150  ConstMSEdgeVector stops;
151  if (myParameter->via.size() == 0) {
152  stops = getStopEdges();
153  } else {
154  // via takes precedence over stop edges
155  // XXX check for inconsistencies #2275
156  for (std::vector<std::string>::const_iterator it = myParameter->via.begin(); it != myParameter->via.end(); ++it) {
157  MSEdge* viaEdge = MSEdge::dictionary(*it);
158  assert(viaEdge != 0);
159  if (viaEdge->allowedLanes(getVClass()) == 0) {
160  throw ProcessError("Vehicle '" + getID() + "' is not allowed on any lane of via edge '" + viaEdge->getID() + "'.");
161  }
162  stops.push_back(viaEdge);
163  }
164  }
165 
166  for (MSRouteIterator s = stops.begin(); s != stops.end(); ++s) {
167  if (*s != source) {
168  // !!! need to adapt t here
169  router.compute(source, *s, this, t, edges);
170  source = *s;
171  edges.pop_back();
172  }
173  }
174  router.compute(source, sink, this, t, edges);
175  if (!edges.empty() && edges.front()->getPurpose() == MSEdge::EDGEFUNCTION_DISTRICT) {
176  edges.erase(edges.begin());
177  }
178  if (!edges.empty() && edges.back()->getPurpose() == MSEdge::EDGEFUNCTION_DISTRICT) {
179  edges.pop_back();
180  }
181  replaceRouteEdges(edges, onInit);
182 }
183 
184 
185 bool
186 MSBaseVehicle::replaceRouteEdges(ConstMSEdgeVector& edges, bool onInit, bool check) {
187  if (edges.empty()) {
188  WRITE_WARNING("No route for vehicle '" + getID() + "' found.");
189  return false;
190  }
191  // build a new id, first
192  std::string id = getID();
193  if (id[0] != '!') {
194  id = "!" + id;
195  }
196  if (myRoute->getID().find("!var#") != std::string::npos) {
197  id = myRoute->getID().substr(0, myRoute->getID().rfind("!var#") + 5) + toString(getNumberReroutes() + 1);
198  } else {
199  id = id + "!var#1";
200  }
201  int oldSize = (int)edges.size();
202  if (!onInit) {
203  const MSEdge* const origin = getRerouteOrigin();
204  if (origin != *myCurrEdge && edges.front() == origin) {
205  edges.insert(edges.begin(), *myCurrEdge);
206  oldSize = (int)edges.size();
207  }
208  edges.insert(edges.begin(), myRoute->begin(), myCurrEdge);
209  }
210  if (edges == myRoute->getEdges()) {
211  if (onInit) {
212  // if edges = 'from to' we still need to calculate the arrivalPos once
214  }
215  return true;
216  }
217  const RGBColor& c = myRoute->getColor();
218  MSRoute* newRoute = new MSRoute(id, edges, false, &c == &RGBColor::DEFAULT_COLOR ? 0 : new RGBColor(c), myRoute->getStops());
219  if (!MSRoute::dictionary(id, newRoute)) {
220  delete newRoute;
221  return false;
222  }
223 
224  std::string msg;
225  if (check && !hasValidRoute(msg, newRoute)) {
226  WRITE_WARNING("Invalid route replacement for vehicle '" + getID() + "'. " + msg);
228  newRoute->addReference();
229  newRoute->release();
230  return false;
231  }
232  }
233 
234  if (!replaceRoute(newRoute, onInit, (int)edges.size() - oldSize)) {
235  newRoute->addReference();
236  newRoute->release();
237  return false;
238  }
240  return true;
241 }
242 
243 
244 SUMOReal
246  return 0;
247 }
248 
249 
250 SUMOReal
252  return 0;
253 }
254 
255 
256 void
261 }
262 
263 
264 bool
266  return myDeparture != NOT_YET_DEPARTED;
267 }
268 
269 
270 bool
272  return succEdge(1) == 0;
273 }
274 
275 void
277 }
278 
279 void
281 }
282 
283 bool
284 MSBaseVehicle::hasValidRoute(std::string& msg, const MSRoute* route) const {
285  MSRouteIterator start = myCurrEdge;
286  if (route == 0) {
287  route = myRoute;
288  } else {
289  start = route->begin();
290  }
291  MSRouteIterator last = route->end() - 1;
292  // check connectivity, first
293  for (MSRouteIterator e = start; e != last; ++e) {
294  if ((*e)->allowedLanes(**(e + 1), myType->getVehicleClass()) == 0) {
295  msg = "No connection between edge '" + (*e)->getID() + "' and edge '" + (*(e + 1))->getID() + "'.";
296  return false;
297  }
298  }
299  last = route->end();
300  // check usable lanes, then
301  for (MSRouteIterator e = start; e != last; ++e) {
302  if ((*e)->prohibits(this)) {
303  msg = "Edge '" + (*e)->getID() + "' prohibits.";
304  return false;
305  }
306  }
307  return true;
308 }
309 
310 
311 void
313 #ifdef _DEBUG
314  if (myTraceMoveReminders) {
315  traceMoveReminder("add", rem, 0, true);
316  }
317 #endif
318  myMoveReminders.push_back(std::make_pair(rem, 0.));
319 }
320 
321 
322 void
324  for (MoveReminderCont::iterator r = myMoveReminders.begin(); r != myMoveReminders.end(); ++r) {
325  if (r->first == rem) {
326 #ifdef _DEBUG
327  if (myTraceMoveReminders) {
328  traceMoveReminder("remove", rem, 0, false);
329  }
330 #endif
331  myMoveReminders.erase(r);
332  return;
333  }
334  }
335 }
336 
337 
338 void
340  for (MoveReminderCont::iterator rem = myMoveReminders.begin(); rem != myMoveReminders.end();) {
341  if (rem->first->notifyEnter(*this, reason)) {
342 #ifdef _DEBUG
343  if (myTraceMoveReminders) {
344  traceMoveReminder("notifyEnter", rem->first, rem->second, true);
345  }
346 #endif
347  ++rem;
348  } else {
349 #ifdef _DEBUG
350  if (myTraceMoveReminders) {
351  traceMoveReminder("notifyEnter", rem->first, rem->second, false);
352  }
353 #endif
354  rem = myMoveReminders.erase(rem);
355  }
356  }
357 }
358 
359 
360 void
362  const std::vector<MSLane*>& lanes = myRoute->getLastEdge()->getLanes();
363  const SUMOReal lastLaneLength = lanes[0]->getLength();
364  switch (myParameter->arrivalPosProcedure) {
365  case ARRIVAL_POS_GIVEN:
366  if (fabs(myParameter->arrivalPos) > lastLaneLength) {
367  WRITE_WARNING("Vehicle '" + getID() + "' will not be able to arrive at the given position!");
368  }
369  // Maybe we should warn the user about invalid inputs!
370  myArrivalPos = MIN2(myParameter->arrivalPos, lastLaneLength);
371  if (myArrivalPos < 0) {
372  myArrivalPos = MAX2(myArrivalPos + lastLaneLength, static_cast<SUMOReal>(0));
373  }
374  break;
375  case ARRIVAL_POS_RANDOM:
376  myArrivalPos = RandHelper::rand(static_cast<SUMOReal>(0), lastLaneLength);
377  break;
378  default:
379  myArrivalPos = lastLaneLength;
380  break;
381  }
383  if (myParameter->arrivalLane >= (int)lanes.size() || !lanes[myParameter->arrivalLane]->allowsVehicleClass(myType->getVehicleClass())) {
384  WRITE_WARNING("Vehicle '" + getID() + "' will not be able to arrive at the given lane '" + myRoute->getLastEdge()->getID() + "_" + toString(myParameter->arrivalLane) + "'!");
385  }
386  myArrivalLane = MIN2(myParameter->arrivalLane, (int)(lanes.size() - 1));
387  }
389  for (std::vector<MSLane*>::const_iterator l = lanes.begin(); l != lanes.end(); ++l) {
390  if (myParameter->arrivalSpeed <= (*l)->getVehicleMaxSpeed(this)) {
391  return;
392  }
393  }
394  WRITE_WARNING("Vehicle '" + getID() + "' will not be able to arrive with the given speed!");
395  }
396 }
397 
398 
399 SUMOReal
403 // Alternavite to avoid time to teleport effect on the simulation. No effect if time to teleport is -1
404 // return MAX2((SUMOReal)0, MIN2((SUMOReal)1, getVehicleType().getImpatience()));
405 }
406 
407 
408 MSDevice*
409 MSBaseVehicle::getDevice(const std::type_info& type) const {
410  for (std::vector<MSDevice*>::const_iterator dev = myDevices.begin(); dev != myDevices.end(); ++dev) {
411  if (typeid(**dev) == type) {
412  return *dev;
413  }
414  }
415  return 0;
416 }
417 
418 
419 void
425  // here starts the vehicle internal part (see loading)
426  // @note: remember to close the vehicle tag when calling this in a subclass!
427 }
428 
429 
430 void
431 MSBaseVehicle::addStops(const bool ignoreStopErrors) {
432  for (std::vector<SUMOVehicleParameter::Stop>::const_iterator i = myParameter->stops.begin(); i != myParameter->stops.end(); ++i) {
433  std::string errorMsg;
434  if (!addStop(*i, errorMsg) && !ignoreStopErrors) {
435  throw ProcessError(errorMsg);
436  }
437  if (errorMsg != "") {
438  WRITE_WARNING(errorMsg);
439  }
440  }
441  for (std::vector<SUMOVehicleParameter::Stop>::const_iterator i = myRoute->getStops().begin(); i != myRoute->getStops().end(); ++i) {
442  std::string errorMsg;
443  if (!addStop(*i, errorMsg) && !ignoreStopErrors) {
444  throw ProcessError(errorMsg);
445  }
446  if (errorMsg != "") {
447  WRITE_WARNING(errorMsg);
448  }
449  }
450 }
451 
452 
453 #ifdef _DEBUG
454 void
455 MSBaseVehicle::initMoveReminderOutput(const OptionsCont& oc) {
456  if (oc.isSet("movereminder-output.vehicles")) {
457  const std::vector<std::string> vehicles = oc.getStringVector("movereminder-output.vehicles");
458  myShallTraceMoveReminders.insert(vehicles.begin(), vehicles.end());
459  }
460 }
461 
462 
463 void
464 MSBaseVehicle::traceMoveReminder(const std::string& type, MSMoveReminder* rem, SUMOReal pos, bool keep) const {
465  OutputDevice& od = OutputDevice::getDeviceByOption("movereminder-output");
466  od.openTag("movereminder");
467  od.writeAttr(SUMO_ATTR_TIME, STEPS2TIME(MSNet::getInstance()->getCurrentTimeStep()));
468  od.writeAttr("veh", getID());
470  od.writeAttr("type", type);
471  od.writeAttr("pos", toString(pos));
472  od.writeAttr("keep", toString(keep));
473  od.closeTag();
474 }
475 #endif
476 
477 /****************************************************************************/
478 
void removeReminder(MSMoveReminder *rem)
Removes a MoveReminder dynamically.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
Definition: OutputDevice.h:257
const MSVehicleType * myType
This Vehicle&#39;s type.
std::vector< std::string > getStringVector(const std::string &name) const
Returns the list of string-vector-value of the named option (only for Option_String) ...
MSDevice * getDevice(const std::type_info &type) const
Returns a device of the given type if it exists or 0.
SUMOReal getMaxSpeed() const
Get vehicle&#39;s maximum speed [m/s].
long long int SUMOTime
Definition: SUMOTime.h:43
const int VEHPARS_FORCE_REROUTE
SUMOVehicleClass getVehicleClass() const
Get this vehicle type&#39;s vehicle class.
const std::string & getDescription() const
SUMOReal myArrivalPos
The position on the destination lane where the vehicle stops.
MoveReminderCont myMoveReminders
Current lane&#39;s move reminder.
int repetitionNumber
The number of times the vehicle shall be repeatedly inserted.
SUMOReal getMaxSpeed() const
Returns the maximum speed.
const std::vector< MSLane * > & getLanes() const
Returns this edge&#39;s lanes.
Definition: MSEdge.h:192
ArrivalLaneDefinition arrivalLaneProcedure
Information how the vehicle shall choose the lane to arrive on.
SUMOVehicleClass getVClass() const
Returns the vehicle&#39;s access class.
The speed is given.
SUMOReal getImpatience() const
Returns this vehicles impatience.
const MSEdge * getLastEdge() const
returns the destination edge
Definition: MSRoute.cpp:96
virtual SUMOReal getPositionOnLane() const =0
Get the vehicle&#39;s position along the lane.
SUMOReal arrivalSpeed
(optional) The final speed of the vehicle (not used yet)
Notification
Definition of a vehicle state.
static SUMOReal rand()
Returns a random real number in [0, 1)
Definition: RandHelper.h:62
std::string time2string(SUMOTime t)
Definition: SUMOTime.cpp:59
int getNumberReroutes() const
Returns the number of new routes this vehicle got.
SUMOReal arrivalPos
(optional) The position the vehicle shall arrive on
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
Definition: MSNet.cpp:159
T MAX2(T a, T b)
Definition: StdDefs.h:75
virtual bool compute(const E *from, const E *to, const V *const vehicle, SUMOTime msTime, std::vector< const E * > &into)=0
Builds the route between the given edges using the minimum effort at the given time The definition of...
virtual ~MSBaseVehicle()
Destructor.
const MSRoute * myRoute
This Vehicle&#39;s route.
bool hasDeparted() const
Returns whether this vehicle has already departed.
static bool dictionary(const std::string &id, MSEdge *edge)
Inserts edge into the static dictionary Returns true if the key id isn&#39;t already in the dictionary...
Definition: MSEdge.cpp:666
std::vector< const MSEdge * > ConstMSEdgeVector
Definition: MSEdge.h:78
ArrivalSpeedDefinition arrivalSpeedProcedure
Information how the vehicle&#39;s end speed shall be chosen.
int myArrivalLane
The destination lane where the vehicle stops.
const SUMOVehicleParameter * myParameter
This Vehicle&#39;s parameter.
The arrival position is given.
const std::vector< SUMOVehicleParameter::Stop > & getStops() const
Returns the stops.
Definition: MSRoute.cpp:358
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
Definition: MSNet.h:254
bool hasValidRoute(std::string &msg, const MSRoute *route=0) const
Validates the current or given route.
MSBaseVehicle(SUMOVehicleParameter *pars, const MSRoute *route, const MSVehicleType *type, const SUMOReal speedFactor)
Constructor.
static void buildVehicleDevices(SUMOVehicle &v, std::vector< MSDevice * > &into)
Build devices for the given vehicle, if needed.
Definition: MSDevice.cpp:81
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:200
The car-following model and parameter.
Definition: MSVehicleType.h:74
virtual void saveState(OutputDevice &out)
Saves the (common) state of a vehicle.
virtual bool addStop(const SUMOVehicleParameter::Stop &stopPar, std::string &errorMsg, SUMOTime untilOffset=0)=0
Adds a stop.
std::string toTaz
The vehicle&#39;s destination zone (district)
std::vector< Stop > stops
List of the stops the vehicle will make.
void calculateArrivalParams()
(Re-)Calculates the arrival position and lane from the vehicle parameters
const std::string & getID() const
Returns the id.
Definition: Named.h:66
A road/street connecting two junctions.
Definition: MSEdge.h:80
virtual void addPerson(MSTransportable *person)
Adds a person to this vehicle.
The edge is a district edge.
Definition: MSEdge.h:99
std::string routeid
The vehicle&#39;s route id.
static bool gCheckRoutes
Definition: MSGlobals.h:78
virtual SUMOReal getAcceleration() const
Returns the vehicle&#39;s acceleration.
bool wasSet(int what) const
Returns whether the given parameter was set.
static const RGBColor DEFAULT_COLOR
The default color (for vehicle types and vehicles)
Definition: RGBColor.h:200
MSVehicleControl & getVehicleControl()
Returns the vehicle control.
Definition: MSNet.h:307
int size() const
Returns the number of edges to pass.
Definition: MSRoute.cpp:90
ConstMSEdgeVector::const_iterator MSRouteIterator
Definition: MSRoute.h:65
int arrivalLane
(optional) The lane the vehicle shall arrive on (not used yet)
SUMOTime depart
The vehicle&#39;s departure time.
#define STEPS2TIME(x)
Definition: SUMOTime.h:65
const ConstMSEdgeVector & getEdges() const
Definition: MSRoute.h:128
T MIN2(T a, T b)
Definition: StdDefs.h:69
std::string fromTaz
The vehicle&#39;s origin zone (district)
virtual const ConstMSEdgeVector getStopEdges() const =0
Returns the list of still pending stop edges.
Something on a lane to be noticed about vehicle movement.
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
Definition: ToString.h:55
void addReference() const
increments the reference counter for the route
Definition: MSRoute.cpp:103
std::vector< std::string > via
List of the via-edges the vehicle must visit.
Abstract in-vehicle device.
Definition: MSDevice.h:69
void addStops(const bool ignoreStopErrors)
Adds stops to the built vehicle.
Structure representing possible vehicle parameter.
const MSEdge * succEdge(int nSuccs) const
Returns the nSuccs&#39;th successor of edge the vehicle is currently at.
MSRouteIterator end() const
Returns the end of the list of edges to pass.
Definition: MSRoute.cpp:84
#define SUMOTime_MAX
Definition: SUMOTime.h:44
static OutputDevice & getDeviceByOption(const std::string &name)
Returns the device described by the option.
virtual void activateReminders(const MSMoveReminder::Notification reason)
"Activates" all current move reminder
const std::vector< MSLane * > * allowedLanes(const MSEdge &destination, SUMOVehicleClass vclass=SVC_IGNORING) const
Get the allowed lanes to reach the destination-edge.
Definition: MSEdge.cpp:301
void onDepart()
Called when the vehicle is inserted into the network.
A storage for options typed value containers)
Definition: OptionsCont.h:99
virtual bool replaceRoute(const MSRoute *route, bool onInit=false, int offset=0)=0
Replaces the current route by the given one.
const MSVehicleType & getVehicleType() const
Returns the vehicle&#39;s type definition.
Definition: MSBaseVehicle.h:97
bool replaceRouteEdges(ConstMSEdgeVector &edges, bool onInit=false, bool check=false)
Replaces the current route by the given edges.
virtual bool hasArrived() const
Returns whether this vehicle has already arived (by default this is true if the vehicle has reached i...
virtual const MSEdge * getRerouteOrigin() const
Returns the starting point for reroutes (usually the current edge)
The arrival lane is given.
const std::string & getID() const
Returns the name of the vehicle type.
static SUMOTime gTimeToGridlock
Definition: MSGlobals.h:63
const SUMOVehicleParameter & getParameter() const
Returns the vehicle&#39;s parameter (including departure definition)
virtual SUMOTime getWaitingTime() const =0
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:71
const RGBColor & getColor() const
Returns the color.
Definition: MSRoute.cpp:349
bool closeTag()
Closes the most recently opened tag.
#define SUMOReal
Definition: config.h:213
MSRouteIterator myCurrEdge
Iterator to current route-edge.
void reroute(SUMOTime t, SUMOAbstractRouter< MSEdge, SUMOVehicle > &router, const bool onInit=false, const bool withTaz=false)
Performs a rerouting using the given router.
const MSEdge * getEdge() const
Returns the edge the vehicle is currently at.
void vehicleDeparted(const SUMOVehicle &v)
Informs this control about a vehicle&#39;s departure.
void release() const
deletes the route if there are no further references to it
Definition: MSRoute.cpp:109
virtual SUMOReal getSlope() const
Returns the slope of the road at vehicle&#39;s position.
SUMOReal myDepartPos
The real depart position.
void addReminder(MSMoveReminder *rem)
Adds a MoveReminder dynamically.
std::vector< MSDevice * > myDevices
The devices this vehicle has.
virtual void addContainer(MSTransportable *container)
Adds a container to this vehicle.
static void checkDist(const std::string &id)
Checks the distribution whether it is permanent and deletes it if not.
Definition: MSRoute.cpp:194
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
SUMOTime myDeparture
The real departure time.
MSRouteIterator begin() const
Returns the begin of the list of edges to pass.
Definition: MSRoute.cpp:78
ArrivalPosDefinition arrivalPosProcedure
Information how the vehicle shall choose the arrival position.
static const SUMOTime NOT_YET_DEPARTED
std::string id
The vehicle&#39;s id.
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
const std::string & getID() const
Returns the name of the vehicle.
static bool dictionary(const std::string &id, const MSRoute *route)
Adds a route to the dictionary.
Definition: MSRoute.cpp:122
The arrival position is chosen randomly.