SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 // ===========================================================================
63 
66  throw ProcessError("getPreviousSpeed() is not available for non-MSVehicles.");
67 }
68 
70  const MSVehicleType* type, const SUMOReal speedFactor) :
71  myParameter(pars),
72  myRoute(route),
73  myType(type),
74  myCurrEdge(route->begin()),
75  myChosenSpeedFactor(speedFactor),
76  myMoveReminders(0),
77  myDeparture(NOT_YET_DEPARTED),
78  myDepartPos(-1),
79  myArrivalPos(-1),
80  myArrivalLane(-1),
81  myNumberReroutes(0)
82 #ifdef _DEBUG
83  , myTraceMoveReminders(myShallTraceMoveReminders.count(pars->id) > 0)
84 #endif
85 {
86  if ((*myRoute->begin())->isTaz() || myRoute->getLastEdge()->isTaz()) {
88  }
89  // init devices
91  //
92  for (std::vector< MSDevice* >::iterator dev = myDevices.begin(); dev != myDevices.end(); ++dev) {
93  myMoveReminders.push_back(std::make_pair(*dev, 0.));
94  }
96  if (!pars->wasSet(VEHPARS_FORCE_REROUTE)) {
98  }
99 }
100 
102  myRoute->release();
103  if (myParameter->repetitionNumber == 0) {
105  }
106  for (std::vector< MSDevice* >::iterator dev = myDevices.begin(); dev != myDevices.end(); ++dev) {
107  delete *dev;
108  }
109  delete myParameter;
110 }
111 
112 
113 const std::string&
115  return myParameter->id;
116 }
117 
118 
121  return *myParameter;
122 }
123 
124 
125 SUMOReal
127  return myType->getMaxSpeed();
128 }
129 
130 
131 const MSEdge*
132 MSBaseVehicle::succEdge(int nSuccs) const {
133  if (myCurrEdge + nSuccs < myRoute->end() && std::distance(myCurrEdge, myRoute->begin()) <= nSuccs) {
134  return *(myCurrEdge + nSuccs);
135  } else {
136  return 0;
137  }
138 }
139 
140 
141 const MSEdge*
143  return *myCurrEdge;
144 }
145 
146 
147 void
148 MSBaseVehicle::reroute(SUMOTime t, SUMOAbstractRouter<MSEdge, SUMOVehicle>& router, const bool onInit, const bool withTaz) {
149  // check whether to reroute
150  const MSEdge* source = withTaz && onInit ? MSEdge::dictionary(myParameter->fromTaz + "-source") : getRerouteOrigin();
151  if (source == 0) {
152  source = getRerouteOrigin();
153  }
154  const MSEdge* sink = withTaz ? MSEdge::dictionary(myParameter->toTaz + "-sink") : myRoute->getLastEdge();
155  if (sink == 0) {
156  sink = myRoute->getLastEdge();
157  }
158  ConstMSEdgeVector edges;
159  ConstMSEdgeVector stops;
160  if (myParameter->via.size() == 0) {
161  stops = getStopEdges();
162  } else {
163  // via takes precedence over stop edges
164  // XXX check for inconsistencies #2275
165  for (std::vector<std::string>::const_iterator it = myParameter->via.begin(); it != myParameter->via.end(); ++it) {
166  MSEdge* viaEdge = MSEdge::dictionary(*it);
167  assert(viaEdge != 0);
168  if (viaEdge->allowedLanes(getVClass()) == 0) {
169  throw ProcessError("Vehicle '" + getID() + "' is not allowed on any lane of via edge '" + viaEdge->getID() + "'.");
170  }
171  stops.push_back(viaEdge);
172  }
173  }
174 
175  for (MSRouteIterator s = stops.begin(); s != stops.end(); ++s) {
176  if (*s != source) {
177  // !!! need to adapt t here
178  router.compute(source, *s, this, t, edges);
179  source = *s;
180  edges.pop_back();
181  }
182  }
183  router.compute(source, sink, this, t, edges);
184  if (!edges.empty() && edges.front()->getPurpose() == MSEdge::EDGEFUNCTION_DISTRICT) {
185  edges.erase(edges.begin());
186  }
187  if (!edges.empty() && edges.back()->getPurpose() == MSEdge::EDGEFUNCTION_DISTRICT) {
188  edges.pop_back();
189  }
190  replaceRouteEdges(edges, onInit);
191  // this must be called even if the route could not be replaced
192  if (onInit) {
194  }
195 }
196 
197 
198 bool
199 MSBaseVehicle::replaceRouteEdges(ConstMSEdgeVector& edges, bool onInit, bool check) {
200  if (edges.empty()) {
201  WRITE_WARNING("No route for vehicle '" + getID() + "' found.");
202  return false;
203  }
204  // build a new id, first
205  std::string id = getID();
206  if (id[0] != '!') {
207  id = "!" + id;
208  }
209  if (myRoute->getID().find("!var#") != std::string::npos) {
210  id = myRoute->getID().substr(0, myRoute->getID().rfind("!var#") + 5) + toString(getNumberReroutes() + 1);
211  } else {
212  id = id + "!var#1";
213  }
214  int oldSize = (int)edges.size();
215  if (!onInit) {
216  const MSEdge* const origin = getRerouteOrigin();
217  if (origin != *myCurrEdge && edges.front() == origin) {
218  edges.insert(edges.begin(), *myCurrEdge);
219  oldSize = (int)edges.size();
220  }
221  edges.insert(edges.begin(), myRoute->begin(), myCurrEdge);
222  }
223  if (edges == myRoute->getEdges()) {
224  return true;
225  }
226  const RGBColor& c = myRoute->getColor();
227  MSRoute* newRoute = new MSRoute(id, edges, false, &c == &RGBColor::DEFAULT_COLOR ? 0 : new RGBColor(c), myRoute->getStops());
228  if (!MSRoute::dictionary(id, newRoute)) {
229  delete newRoute;
230  return false;
231  }
232 
233  std::string msg;
234  if (check && !hasValidRoute(msg, newRoute)) {
235  WRITE_WARNING("Invalid route replacement for vehicle '" + getID() + "'. " + msg);
237  newRoute->addReference();
238  newRoute->release();
239  return false;
240  }
241  }
242 
243  if (!replaceRoute(newRoute, onInit, (int)edges.size() - oldSize)) {
244  newRoute->addReference();
245  newRoute->release();
246  return false;
247  }
248  return true;
249 }
250 
251 
252 SUMOReal
254  return 0;
255 }
256 
257 
258 SUMOReal
260  return 0;
261 }
262 
263 
264 void
269 }
270 
271 
272 bool
274  return myDeparture != NOT_YET_DEPARTED;
275 }
276 
277 
278 bool
280  return succEdge(1) == 0;
281 }
282 
283 void
285 }
286 
287 void
289 }
290 
291 bool
292 MSBaseVehicle::hasValidRoute(std::string& msg, const MSRoute* route) const {
293  MSRouteIterator start = myCurrEdge;
294  if (route == 0) {
295  route = myRoute;
296  } else {
297  start = route->begin();
298  }
299  MSRouteIterator last = route->end() - 1;
300  // check connectivity, first
301  for (MSRouteIterator e = start; e != last; ++e) {
302  if ((*e)->allowedLanes(**(e + 1), myType->getVehicleClass()) == 0) {
303  msg = "No connection between edge '" + (*e)->getID() + "' and edge '" + (*(e + 1))->getID() + "'.";
304  return false;
305  }
306  }
307  last = route->end();
308  // check usable lanes, then
309  for (MSRouteIterator e = start; e != last; ++e) {
310  if ((*e)->prohibits(this)) {
311  msg = "Edge '" + (*e)->getID() + "' prohibits.";
312  return false;
313  }
314  }
315  return true;
316 }
317 
318 
319 void
321 #ifdef _DEBUG
322  if (myTraceMoveReminders) {
323  traceMoveReminder("add", rem, 0, true);
324  }
325 #endif
326  myMoveReminders.push_back(std::make_pair(rem, 0.));
327 }
328 
329 
330 void
332  for (MoveReminderCont::iterator r = myMoveReminders.begin(); r != myMoveReminders.end(); ++r) {
333  if (r->first == rem) {
334 #ifdef _DEBUG
335  if (myTraceMoveReminders) {
336  traceMoveReminder("remove", rem, 0, false);
337  }
338 #endif
339  myMoveReminders.erase(r);
340  return;
341  }
342  }
343 }
344 
345 
346 void
348  for (MoveReminderCont::iterator rem = myMoveReminders.begin(); rem != myMoveReminders.end();) {
349  if (rem->first->notifyEnter(*this, reason)) {
350 #ifdef _DEBUG
351  if (myTraceMoveReminders) {
352  traceMoveReminder("notifyEnter", rem->first, rem->second, true);
353  }
354 #endif
355  ++rem;
356  } else {
357 #ifdef _DEBUG
358  if (myTraceMoveReminders) {
359  traceMoveReminder("notifyEnter", rem->first, rem->second, false);
360  }
361 #endif
362  rem = myMoveReminders.erase(rem);
363  }
364  }
365 }
366 
367 
368 void
370  if (myRoute->getLastEdge()->isTaz()) {
371  return;
372  }
373  const std::vector<MSLane*>& lanes = myRoute->getLastEdge()->getLanes();
374  const SUMOReal lastLaneLength = lanes[0]->getLength();
375  switch (myParameter->arrivalPosProcedure) {
376  case ARRIVAL_POS_GIVEN:
377  if (fabs(myParameter->arrivalPos) > lastLaneLength) {
378  WRITE_WARNING("Vehicle '" + getID() + "' will not be able to arrive at the given position!");
379  }
380  // Maybe we should warn the user about invalid inputs!
381  myArrivalPos = MIN2(myParameter->arrivalPos, lastLaneLength);
382  if (myArrivalPos < 0) {
383  myArrivalPos = MAX2(myArrivalPos + lastLaneLength, static_cast<SUMOReal>(0));
384  }
385  break;
386  case ARRIVAL_POS_RANDOM:
387  myArrivalPos = RandHelper::rand(static_cast<SUMOReal>(0), lastLaneLength);
388  break;
389  default:
390  myArrivalPos = lastLaneLength;
391  break;
392  }
394  if (myParameter->arrivalLane >= (int)lanes.size() || !lanes[myParameter->arrivalLane]->allowsVehicleClass(myType->getVehicleClass())) {
395  WRITE_WARNING("Vehicle '" + getID() + "' will not be able to arrive at the given lane '" + myRoute->getLastEdge()->getID() + "_" + toString(myParameter->arrivalLane) + "'!");
396  }
397  myArrivalLane = MIN2(myParameter->arrivalLane, (int)(lanes.size() - 1));
398  }
400  for (std::vector<MSLane*>::const_iterator l = lanes.begin(); l != lanes.end(); ++l) {
401  if (myParameter->arrivalSpeed <= (*l)->getVehicleMaxSpeed(this)) {
402  return;
403  }
404  }
405  WRITE_WARNING("Vehicle '" + getID() + "' will not be able to arrive with the given speed!");
406  }
407 }
408 
409 
410 SUMOReal
414 // Alternavite to avoid time to teleport effect on the simulation. No effect if time to teleport is -1
415 // return MAX2((SUMOReal)0, MIN2((SUMOReal)1, getVehicleType().getImpatience()));
416 }
417 
418 
419 MSDevice*
420 MSBaseVehicle::getDevice(const std::type_info& type) const {
421  for (std::vector<MSDevice*>::const_iterator dev = myDevices.begin(); dev != myDevices.end(); ++dev) {
422  if (typeid(**dev) == type) {
423  return *dev;
424  }
425  }
426  return 0;
427 }
428 
429 
430 void
436  // here starts the vehicle internal part (see loading)
437  // @note: remember to close the vehicle tag when calling this in a subclass!
438 }
439 
440 
441 void
442 MSBaseVehicle::addStops(const bool ignoreStopErrors) {
443  for (std::vector<SUMOVehicleParameter::Stop>::const_iterator i = myParameter->stops.begin(); i != myParameter->stops.end(); ++i) {
444  std::string errorMsg;
445  if (!addStop(*i, errorMsg) && !ignoreStopErrors) {
446  throw ProcessError(errorMsg);
447  }
448  if (errorMsg != "") {
449  WRITE_WARNING(errorMsg);
450  }
451  }
452  for (std::vector<SUMOVehicleParameter::Stop>::const_iterator i = myRoute->getStops().begin(); i != myRoute->getStops().end(); ++i) {
453  std::string errorMsg;
454  if (!addStop(*i, errorMsg) && !ignoreStopErrors) {
455  throw ProcessError(errorMsg);
456  }
457  if (errorMsg != "") {
458  WRITE_WARNING(errorMsg);
459  }
460  }
461 }
462 
463 #ifdef _DEBUG
464 void
465 MSBaseVehicle::initMoveReminderOutput(const OptionsCont& oc) {
466  if (oc.isSet("movereminder-output.vehicles")) {
467  const std::vector<std::string> vehicles = oc.getStringVector("movereminder-output.vehicles");
468  myShallTraceMoveReminders.insert(vehicles.begin(), vehicles.end());
469  }
470 }
471 
472 
473 void
474 MSBaseVehicle::traceMoveReminder(const std::string& type, MSMoveReminder* rem, SUMOReal pos, bool keep) const {
475  OutputDevice& od = OutputDevice::getDeviceByOption("movereminder-output");
476  od.openTag("movereminder");
477  od.writeAttr(SUMO_ATTR_TIME, STEPS2TIME(MSNet::getInstance()->getCurrentTimeStep()));
478  od.writeAttr("veh", getID());
480  od.writeAttr("type", type);
481  od.writeAttr("pos", toString(pos));
482  od.writeAttr("keep", toString(keep));
483  od.closeTag();
484 }
485 #endif
486 
487 /****************************************************************************/
488 
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'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'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's vehicle class.
const std::string & getDescription() const
SUMOReal myArrivalPos
The position on the destination lane where the vehicle stops.
MoveReminderCont myMoveReminders
Currently relevant move reminders.
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'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'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'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'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't already in the dictionary...
Definition: MSEdge.cpp:673
std::vector< const MSEdge * > ConstMSEdgeVector
Definition: MSEdge.h:78
ArrivalSpeedDefinition arrivalSpeedProcedure
Information how the vehicle's end speed shall be chosen.
int myArrivalLane
The destination lane where the vehicle stops.
const SUMOVehicleParameter * myParameter
This Vehicle'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's destination zone (district)
std::vector< Stop > stops
List of the stops the vehicle will make.
SUMOReal getPreviousSpeed() const
Returns the vehicle's previous speed.
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.
bool isTaz() const
Definition: MSEdge.h:268
The edge is a district edge.
Definition: MSEdge.h:99
std::string routeid
The vehicle's route id.
static bool gCheckRoutes
Definition: MSGlobals.h:83
virtual SUMOReal getAcceleration() const
Returns the vehicle'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'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'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'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
int setParameter
Information for the router which parameter were set.
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:300
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's type definition.
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:67
const SUMOVehicleParameter & getParameter() const
Returns the vehicle'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:214
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'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'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'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.