SUMO - Simulation of Urban MObility
MSDevice_Tripinfo.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2009-2018 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
18 // A device which collects info on the vehicle trip
19 /****************************************************************************/
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #include <config.h>
25 
26 #include <microsim/MSGlobals.h>
27 #include <microsim/MSNet.h>
28 #include <microsim/MSLane.h>
29 #include <microsim/MSEdge.h>
30 #include <microsim/MSVehicle.h>
31 #include <mesosim/MEVehicle.h>
35 #include "MSDevice_Tripinfo.h"
36 
37 #define NOT_ARRIVED TIME2STEPS(-1)
38 
39 
40 // ===========================================================================
41 // static members
42 // ===========================================================================
44 
52 
57 
66 
67 // ===========================================================================
68 // method definitions
69 // ===========================================================================
70 // ---------------------------------------------------------------------------
71 // static initialisation methods
72 // ---------------------------------------------------------------------------
73 void
74 MSDevice_Tripinfo::buildVehicleDevices(SUMOVehicle& v, std::vector<MSDevice*>& into) {
75  if (OptionsCont::getOptions().isSet("tripinfo-output") || OptionsCont::getOptions().getBool("duration-log.statistics")) {
76  MSDevice_Tripinfo* device = new MSDevice_Tripinfo(v, "tripinfo_" + v.getID());
77  into.push_back(device);
78  myPendingOutput.insert(device);
79  }
80 }
81 
82 
83 // ---------------------------------------------------------------------------
84 // MSDevice_Tripinfo-methods
85 // ---------------------------------------------------------------------------
86 MSDevice_Tripinfo::MSDevice_Tripinfo(SUMOVehicle& holder, const std::string& id) :
87  MSDevice(holder, id),
88  myDepartLane(""),
89  myDepartSpeed(-1),
90  myDepartPosLat(0),
91  myWaitingTime(0),
92  myAmWaiting(false),
93  myWaitingCount(0),
94  myStoppingTime(0),
97  myArrivalLane(""),
98  myArrivalPos(-1),
99  myArrivalPosLat(0),
100  myArrivalSpeed(-1),
101  myMesoTimeLoss(0) {
102 }
103 
104 
106  // ensure clean up for vaporized vehicles which do not generate output
107  myPendingOutput.erase(this);
108 }
109 
110 void
112  myVehicleCount = 0;
113  myTotalRouteLength = 0;
114  myTotalDuration = 0;
115  myTotalWaitingTime = 0;
116  myTotalTimeLoss = 0;
117  myTotalDepartDelay = 0;
119 
120  myWalkCount = 0;
124 
125  myRideCount = 0;
126  myRideBusCount = 0;
127  myRideRailCount = 0;
128  myRideBikeCount = 0;
129  myRideAbortCount = 0;
133 }
134 
135 bool
137  double /*newPos*/, double newSpeed) {
138  if (veh.isStopped()) {
140  } else if (newSpeed <= SUMO_const_haltingSpeed) {
142  if (!myAmWaiting) {
143  myWaitingCount++;
144  myAmWaiting = true;
145  }
146  } else {
147  myAmWaiting = false;
148  }
149  return true;
150 }
151 
152 void
154  const double /* frontOnLane */,
155  const double timeOnLane,
156  const double /* meanSpeedFrontOnLane */,
157  const double meanSpeedVehicleOnLane,
158  const double /* travelledDistanceFrontOnLane */,
159  const double /* travelledDistanceVehicleOnLane */,
160  const double /* meanLengthOnLane */) {
161 
162  // called by meso
163  const MEVehicle* mesoVeh = dynamic_cast<const MEVehicle*>(&veh);
164  assert(mesoVeh);
165  const double vmax = veh.getEdge()->getVehicleMaxSpeed(&veh);
166  if (vmax > 0) {
167  myMesoTimeLoss += TIME2STEPS(timeOnLane * (vmax - meanSpeedVehicleOnLane) / vmax);
168  }
169  myWaitingTime += veh.getWaitingTime();
171 }
172 
173 bool
176  if (!MSGlobals::gUseMesoSim) {
177  myDepartLane = static_cast<MSVehicle&>(veh).getLane()->getID();
178  myDepartPosLat = static_cast<MSVehicle&>(veh).getLateralPositionOnLane();
179  }
180  myDepartSpeed = veh.getSpeed();
181  } else if (reason == MSMoveReminder::NOTIFICATION_PARKING) {
182  // notifyMove is not called while parking
183  // @note insertion delay when resuming after parking is included
185  }
186  return true;
187 }
188 
189 
190 bool
192  MSMoveReminder::Notification reason, const MSLane* /* enteredLane */) {
193  if (reason >= MSMoveReminder::NOTIFICATION_ARRIVED) {
195  if (!MSGlobals::gUseMesoSim) {
196  myArrivalLane = static_cast<MSVehicle&>(veh).getLane()->getID();
197  myArrivalPosLat = static_cast<MSVehicle&>(veh).getLateralPositionOnLane();
198  }
199  // @note vehicle may have moved past its arrivalPos during the last step
200  // due to non-zero arrivalspeed but we consider it as arrived at the desired position
201  // However, vaporization may happen anywhere (via TraCI)
204  } else {
206  }
207  myArrivalSpeed = veh.getSpeed();
208  } else if (reason == MSMoveReminder::NOTIFICATION_PARKING) {
210  }
211  return true;
212 }
213 
214 void
215 MSDevice_Tripinfo::computeLengthAndDuration(double& routeLength, SUMOTime& duration) const {
216  SUMOTime finalTime;
217  double finalPos;
218  double finalPosOnInternal = 0;
219  if (myArrivalTime == NOT_ARRIVED) {
220  finalTime = MSNet::getInstance()->getCurrentTimeStep();
221  finalPos = myHolder.getPositionOnLane();
222  if (!MSGlobals::gUseMesoSim) {
223  const MSLane* lane = static_cast<MSVehicle&>(myHolder).getLane();
224  if (lane->getEdge().isInternal()) {
225  finalPosOnInternal = finalPos;
226  finalPos = myHolder.getEdge()->getLength();
227  }
228  }
229  } else {
230  finalTime = myArrivalTime;
231  finalPos = myArrivalPos;
232  }
233  const bool includeInternalLengths = MSGlobals::gUsingInternalLanes && MSNet::getInstance()->hasInternalLinks();
234  routeLength = myHolder.getRoute().getDistanceBetween(myHolder.getDepartPos(), finalPos,
235  myHolder.getRoute().begin(), myHolder.getCurrentRouteEdge(), includeInternalLengths) + finalPosOnInternal;
236 
237  duration = finalTime - myHolder.getDeparture();
238 }
239 
240 
241 void
243  const SUMOTime timeLoss = MSGlobals::gUseMesoSim ? myMesoTimeLoss : static_cast<MSVehicle&>(myHolder).getTimeLoss();
244  updateStatistics(timeLoss);
245  if (!OptionsCont::getOptions().isSet("tripinfo-output")) {
246  return;
247  }
248  myPendingOutput.erase(this);
249  double routeLength;
250  SUMOTime duration;
251  computeLengthAndDuration(routeLength, duration);
252 
253  // write
254  OutputDevice& os = OutputDevice::getDeviceByOption("tripinfo-output");
255  os.openTag("tripinfo").writeAttr("id", myHolder.getID());
256  os.writeAttr("depart", time2string(myHolder.getDeparture()));
257  os.writeAttr("departLane", myDepartLane);
258  os.writeAttr("departPos", myHolder.getDepartPos());
260  os.writeAttr("departPosLat", myDepartPosLat);
261  }
262  os.writeAttr("departSpeed", myDepartSpeed);
263  os.writeAttr("departDelay", time2string(myHolder.getDepartDelay()));
264  os.writeAttr("arrival", time2string(myArrivalTime));
265  os.writeAttr("arrivalLane", myArrivalLane);
266  os.writeAttr("arrivalPos", myArrivalPos);
268  os.writeAttr("arrivalPosLat", myArrivalPosLat);
269  }
270  os.writeAttr("arrivalSpeed", myArrivalSpeed);
271  os.writeAttr("duration", time2string(duration));
272  os.writeAttr("routeLength", routeLength);
273  os.writeAttr("waitingTime", time2string(myWaitingTime));
274  os.writeAttr("waitingCount", myWaitingCount);
275  os.writeAttr("stopTime", time2string(myStoppingTime));
276  os.writeAttr("timeLoss", time2string(timeLoss));
277  os.writeAttr("rerouteNo", myHolder.getNumberReroutes());
278  const std::vector<MSDevice*>& devices = myHolder.getDevices();
279  std::ostringstream str;
280  for (std::vector<MSDevice*>::const_iterator i = devices.begin(); i != devices.end(); ++i) {
281  if (i != devices.begin()) {
282  str << ' ';
283  }
284  str << (*i)->getID();
285  }
286  os.writeAttr("devices", str.str());
287  os.writeAttr("vType", myHolder.getVehicleType().getID());
288  os.writeAttr("speedFactor", myHolder.getChosenSpeedFactor());
289  os.writeAttr("vaporized", (myHolder.getEdge() == *(myHolder.getRoute().end() - 1) ? "" : "0"));
290  // cannot close tag because emission device output might follow
291 }
292 
293 
294 void
296  const bool writeTripinfos = OptionsCont::getOptions().isSet("tripinfo-output");
298  int undeparted = 0;
299  int departed = 0;
301  while (myPendingOutput.size() > 0) {
302  const MSDevice_Tripinfo* d = *myPendingOutput.begin();
303  if (d->myHolder.hasDeparted()) {
304  departed++;
305  d->generateOutput();
306  if (writeTripinfos) {
307  // @todo also generate emission output if holder has a device
308  OutputDevice::getDeviceByOption("tripinfo-output").closeTag();
309  } else {
310  myPendingOutput.erase(d);
311  }
312  } else {
313  undeparted++;
315  myPendingOutput.erase(d);
316  }
317  }
318  if (myWaitingDepartDelay > 0) {
319  myWaitingDepartDelay /= undeparted;
320  }
321 }
322 
323 
324 void
326  double routeLength;
327  SUMOTime duration;
328  computeLengthAndDuration(routeLength, duration);
329 
330  myVehicleCount++;
331  myTotalRouteLength += routeLength;
332  myTotalDuration += duration;
334  myTotalTimeLoss += timeLoss;
336 }
337 
338 
339 void
340 MSDevice_Tripinfo::addPedestrianData(double walkLength, SUMOTime walkDuration, SUMOTime walkTimeLoss) {
341  myWalkCount++;
342  myTotalWalkRouteLength += walkLength;
343  myTotalWalkDuration += walkDuration;
344  myTotalWalkTimeLoss += walkTimeLoss;
345 }
346 
347 void
348 MSDevice_Tripinfo::addRideData(double rideLength, SUMOTime rideDuration, SUMOVehicleClass vClass, const std::string& line, SUMOTime waitingTime) {
349  myRideCount++;
350  if (rideDuration > 0) {
351  myTotalRideWaitingTime += waitingTime;
352  myTotalRideRouteLength += rideLength;
353  myTotalRideDuration += rideDuration;
354  if (vClass == SVC_BICYCLE) {
355  myRideBikeCount++;
356  } else if (!line.empty()) {
357  if (isRailway(vClass)) {
358  myRideRailCount++;
359  } else {
360  // some kind of road vehicle
361  myRideBusCount++;
362  }
363  }
364  } else {
366  }
367 }
368 
369 
370 std::string
372  std::ostringstream msg;
373  msg.setf(msg.fixed);
374  msg.precision(gPrecision);
375  msg << "Statistics (avg):\n"
376  << " RouteLength: " << getAvgRouteLength() << "\n"
377  << " Duration: " << getAvgDuration() << "\n"
378  << " WaitingTime: " << getAvgWaitingTime() << "\n"
379  << " TimeLoss: " << getAvgTimeLoss() << "\n"
380  << " DepartDelay: " << getAvgDepartDelay() << "\n";
381  if (myWaitingDepartDelay >= 0) {
382  msg << " DepartDelayWaiting: " << STEPS2TIME(myWaitingDepartDelay) << "\n";
383  }
384  if (myWalkCount > 0) {
385  msg << "Pedestrian Statistics (avg of " << myWalkCount << " walks):\n"
386  << " RouteLength: " << getAvgWalkRouteLength() << "\n"
387  << " Duration: " << getAvgWalkDuration() << "\n"
388  << " TimeLoss: " << getAvgWalkTimeLoss() << "\n";
389  }
390  if (myRideCount > 0) {
391  msg << "Ride Statistics (avg of " << myRideCount << " rides):\n"
392  << " WaitingTime: " << getAvgRideWaitingTime() << "\n"
393  << " RouteLength: " << getAvgRideRouteLength() << "\n"
394  << " Duration: " << getAvgRideDuration() << "\n"
395  << " Bus: " << myRideBusCount << "\n"
396  << " Train: " << myRideRailCount << "\n"
397  << " Bike: " << myRideBikeCount << "\n"
398  << " Aborted: " << myRideAbortCount << "\n";
399  }
400  return msg.str();
401 }
402 
403 
404 double
406  if (myVehicleCount > 0) {
408  } else {
409  return 0;
410  }
411 }
412 
413 double
415  if (myVehicleCount > 0) {
417  } else {
418  return 0;
419  }
420 }
421 
422 double
424  if (myVehicleCount > 0) {
426  } else {
427  return 0;
428  }
429 }
430 
431 
432 double
434  if (myVehicleCount > 0) {
436  } else {
437  return 0;
438  }
439 }
440 
441 
442 double
444  if (myVehicleCount > 0) {
446  } else {
447  return 0;
448  }
449 }
450 
451 
452 double
454  if (myWalkCount > 0) {
456  } else {
457  return 0;
458  }
459 }
460 
461 double
463  if (myWalkCount > 0) {
465  } else {
466  return 0;
467  }
468 }
469 
470 
471 double
473  if (myWalkCount > 0) {
475  } else {
476  return 0;
477  }
478 }
479 
480 
481 double
483  if (myRideCount > 0) {
485  } else {
486  return 0;
487  }
488 }
489 
490 double
492  if (myRideCount > 0) {
494  } else {
495  return 0;
496  }
497 }
498 
499 double
501  if (myRideCount > 0) {
503  } else {
504  return 0;
505  }
506 }
507 
508 
509 void
512  out.writeAttr(SUMO_ATTR_ID, getID());
513  std::vector<std::string> internals;
514  internals.push_back(myDepartLane);
515  internals.push_back(toString(myDepartPosLat));
516  internals.push_back(toString(myDepartSpeed));
517  out.writeAttr(SUMO_ATTR_STATE, toString(internals));
518  out.closeTag();
519 }
520 
521 
522 void
524  std::istringstream bis(attrs.getString(SUMO_ATTR_STATE));
525  bis >> myDepartLane;
526  bis >> myDepartPosLat;
527  bis >> myDepartSpeed;
528 }
529 
530 
531 /****************************************************************************/
static SUMOTime myTotalWalkDuration
static double getAvgRideRouteLength()
static int myRideBikeCount
static SUMOTime myTotalWalkTimeLoss
static double gLateralResolution
Definition: MSGlobals.h:85
const MSLane * getLane() const
Returns the lane the reminder works on.
SUMOTime myArrivalTime
The vehicle&#39;s arrival time.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
Definition: OutputDevice.h:256
void computeLengthAndDuration(double &routeLength, SUMOTime &duration) const
MSEdge & getEdge() const
Returns the lane&#39;s edge.
Definition: MSLane.h:617
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:79
long long int SUMOTime
Definition: SUMOTime.h:36
static void addPedestrianData(double walkLength, SUMOTime walkDuration, SUMOTime walkTimeLoss)
record tripinfo data for pedestrians
virtual bool hasDeparted() const =0
Returns whether this vehicle has departed.
virtual double getArrivalPos() const =0
Returns this vehicle&#39;s desired arrivalPos for its current route (may change on reroute) ...
A vehicle from the mesoscopic point of view.
Definition: MEVehicle.h:45
static SUMOTime myTotalWaitingTime
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
bool notifyEnter(SUMOVehicle &veh, MSMoveReminder::Notification reason, const MSLane *enteredLane=0)
Saves departure info on insertion.
virtual const MSRoute & getRoute() const =0
Returns the current route.
void updateStatistics(SUMOTime timeLoss) const
update tripinfo statistics
static double myTotalRouteLength
bool notifyLeave(SUMOVehicle &veh, double lastPos, MSMoveReminder::Notification reason, const MSLane *enteredLane=0)
Saves arrival info.
A device which collects info on the vehicle trip (mainly on departure and arrival) ...
SUMOVehicle & myHolder
The vehicle that stores the device.
Definition: MSDevice.h:195
int gPrecision
the precision for floating point outputs
Definition: StdDefs.cpp:27
static double getAvgTimeLoss()
vehicle is a bicycle
virtual const MSEdge * getEdge() const =0
Returns the edge the vehicle is currently at.
static void buildVehicleDevices(SUMOVehicle &v, std::vector< MSDevice *> &into)
Build devices for the given vehicle, if needed.
Notification
Definition of a vehicle state.
double getDistanceBetween(double fromPos, double toPos, const MSEdge *fromEdge, const MSEdge *toEdge, bool includeInternal=true) const
Compute the distance between 2 given edges on this route, including the length of internal lanes...
Definition: MSRoute.cpp:274
static void addRideData(double rideLength, SUMOTime rideDuration, SUMOVehicleClass vClass, const std::string &line, SUMOTime waitingTime)
record tripinfo data for rides
std::string time2string(SUMOTime t)
Definition: SUMOTime.cpp:67
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
Definition: MSNet.cpp:160
~MSDevice_Tripinfo()
Destructor.
SUMOTime DELTA_T
Definition: SUMOTime.cpp:35
The vehicle got vaporized.
static double myVehicleCount
global tripinfo statistics
const std::string & getID() const
Returns the id.
Definition: Named.h:69
#define TIME2STEPS(x)
Definition: SUMOTime.h:60
static SUMOTime myWaitingDepartDelay
bool isRailway(SVCPermissions permissions)
Returns whether an edge with the given permission is a railway edge.
SUMOTime myStoppingTime
The overall intentional stopping time.
double getLength() const
return the length of the edge
Definition: MSEdge.h:563
static double getAvgRideWaitingTime()
std::set< const MSDevice_Tripinfo *, ComparatorIdLess > DeviceSet
devices which may still need to produce output
double myArrivalSpeed
The speed when arriving.
static OptionsCont & getOptions()
Retrieves the options.
Definition: OptionsCont.cpp:58
static double getAvgDuration()
SUMOTime myWaitingTime
The overall waiting time.
virtual std::string getString(int id) const =0
Returns the string-value of the named (by its enum-value) attribute.
#define NOT_ARRIVED
The state of a link.
static DeviceSet myPendingOutput
static double getAvgWalkTimeLoss()
int myWaitingCount
The overall number of unintended stops.
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
double getCurrentStoppingTimeSeconds() const
Returns the delay that is accrued due to option –meso-tls-penalty or –meso-minor-penalty.
Definition: MEVehicle.cpp:271
virtual const std::vector< MSDevice * > & getDevices() const =0
Returns this vehicle&#39;s devices.
static void generateOutputForUnfinished()
generate output for vehicles which are still in the network
void notifyMoveInternal(const SUMOVehicle &veh, const double frontOnLane, const double timeOnLane, const double meanSpeedFrontOnLane, const double meanSpeedVehicleOnLane, const double travelledDistanceFrontOnLane, const double travelledDistanceVehicleOnLane, const double)
Internal notification about the vehicle moves, see MSMoveReminder::notifyMoveInternal() ...
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:49
static std::string printStatistics()
get statistics for printing to stdout
Representation of a vehicle.
Definition: SUMOVehicle.h:60
static double getAvgWalkRouteLength()
Encapsulated SAX-Attributes.
virtual int getNumberReroutes() const =0
Returns the number of new routes this vehicle got.
SUMOTime myParkingStarted
The time when parking started.
static SUMOTime myTotalDuration
The vehicle arrived at its destination (is deleted)
SUMOTime depart
The vehicle&#39;s departure time.
#define STEPS2TIME(x)
Definition: SUMOTime.h:58
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
Definition: MSNet.h:256
static double myTotalRideWaitingTime
bool hasInternalLinks() const
return whether the network contains internal links
Definition: MSNet.h:598
static bool gUsingInternalLanes
Information whether the simulation regards internal lanes.
Definition: MSGlobals.h:69
double myArrivalPosLat
The lateral position on the lane the vehicle arrived at.
static double getAvgWalkDuration()
bool isInternal() const
return whether this edge is an internal edge
Definition: MSEdge.h:224
virtual double getChosenSpeedFactor() const =0
std::string myDepartLane
The lane the vehicle departed at.
double getVehicleMaxSpeed(const SUMOVehicle *const veh) const
Returns the maximum speed the vehicle may use on this edge.
Definition: MSEdge.cpp:854
static void cleanup()
resets counters
static SUMOTime myTotalRideDuration
static double getAvgRideDuration()
Abstract in-vehicle device.
Definition: MSDevice.h:65
static double getAvgWaitingTime()
virtual double getDepartPos() const =0
Returns this vehicle&#39;s real departure position.
virtual SUMOTime getDepartDelay() const =0
The vehicle starts or ends parking.
The vehicle has departed (was inserted into the network)
bool notifyMove(SUMOVehicle &veh, double oldPos, double newPos, double newSpeed)
Checks for waiting steps when the vehicle moves.
static double myTotalWalkRouteLength
std::string myArrivalLane
The lane the vehicle arrived at.
virtual SUMOTime getDeparture() const =0
Returns this vehicle&#39;s real departure time.
virtual double getPositionOnLane() const =0
Get the vehicle&#39;s position along the lane.
static OutputDevice & getDeviceByOption(const std::string &name)
Returns the device described by the option.
double myDepartSpeed
The speed on departure.
virtual const SUMOVehicleParameter & getParameter() const =0
Returns the vehicle&#39;s parameter (including departure definition)
MSDevice_Tripinfo()
dummy constructor
static SUMOTime myTotalDepartDelay
const std::string & getID() const
Returns the name of the vehicle type.
Definition: MSVehicleType.h:94
virtual SUMOTime getWaitingTime() const =0
static double getAvgRouteLength()
accessors for GUINet-Parameters
static double myTotalRideRouteLength
const double SUMO_const_haltingSpeed
the speed threshold at which vehicles are considered as halting
Definition: StdDefs.h:52
static double getAvgDepartDelay()
static int myRideAbortCount
virtual bool isStopped() const =0
Returns whether the vehicle is at a stop.
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:64
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
static int myRideRailCount
MSRouteIterator begin() const
Returns the begin of the list of edges to pass.
Definition: MSRoute.cpp:67
void generateOutput() const
Called on writing tripinfo output.
static SUMOTime myTotalTimeLoss
SUMOTime myMesoTimeLoss
The time loss when compared to the desired and allowed speed.
virtual const ConstMSEdgeVector::const_iterator & getCurrentRouteEdge() const =0
Returns an iterator pointing to the current edge in this vehicles route.
double myDepartPosLat
The lateral depart position.
virtual double getSpeed() const =0
Returns the vehicle&#39;s current speed.
void loadState(const SUMOSAXAttributes &attrs)
Loads the state of the device from the given description.
static bool gUseMesoSim
Definition: MSGlobals.h:91
Representation of a lane in the micro simulation.
Definition: MSLane.h:71
double myArrivalPos
The position on the lane the vehicle arrived at.
MSRouteIterator end() const
Returns the end of the list of edges to pass.
Definition: MSRoute.cpp:73
virtual const std::string & getID() const =0
Get the vehicle&#39;s ID.
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
void saveState(OutputDevice &out) const
Saves the state of the device.
bool myAmWaiting
Whether the vehicle is currently waiting.
virtual const MSVehicleType & getVehicleType() const =0
Returns the vehicle&#39;s type.