Eclipse SUMO - Simulation of Urban MObility
MSBaseVehicle.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2010-2019 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 /****************************************************************************/
16 // A base class for vehicle implementations
17 /****************************************************************************/
18 #ifndef MSBaseVehicle_h
19 #define MSBaseVehicle_h
20 
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #include <config.h>
26 
27 #include <iostream>
28 #include <vector>
29 #include <set>
31 #include <utils/common/StdDefs.h>
32 #include "MSRoute.h"
33 #include "MSMoveReminder.h"
34 #include "MSVehicleType.h"
35 
36 // ===========================================================================
37 // class declarations
38 // ===========================================================================
39 class MSLane;
41 class MSVehicleDevice;
42 
43 
44 // ===========================================================================
45 // class definitions
46 // ===========================================================================
51 class MSBaseVehicle : public SUMOVehicle {
52 public:
53  // XXX: This definition was introduced to make the MSVehicle's previousSpeed
54  // available in the context of MSMoveReminder::notifyMove(). Another solution
55  // would be to modify notifyMove()'s interface to work with MSVehicle instead
56  // of SUMOVehicle (it is only called with MSVehicles!). Refs. #2579
60  double getPreviousSpeed() const;
61 
62  friend class GUIBaseVehicle;
63 
71  MSBaseVehicle(SUMOVehicleParameter* pars, const MSRoute* route,
72  MSVehicleType* type, const double speedFactor);
73 
74 
76  virtual ~MSBaseVehicle();
77 
78  bool isVehicle() const {
79  return true;
80  }
81 
83  const std::string& getID() const;
84 
89  const SUMOVehicleParameter& getParameter() const;
90 
95  const std::map<int, double>* getEmissionParameters() const;
96 
98  void replaceParameter(const SUMOVehicleParameter* newParameter);
99 
101  bool hasDevice(const std::string& deviceName) const;
102 
104  void createDevice(const std::string& deviceName);
105 
107  std::string getDeviceParameter(const std::string& deviceName, const std::string& key) const;
108 
110  void setDeviceParameter(const std::string& deviceName, const std::string& key, const std::string& value);
111 
115  inline const MSRoute& getRoute() const {
116  return *myRoute;
117  }
118 
119 
123  inline const MSVehicleType& getVehicleType() const {
124  return *myType;
125  }
126 
127 
131  inline SUMOVehicleClass getVClass() const {
132  return myType->getParameter().vehicleClass;
133  }
134 
138  double getMaxSpeed() const;
139 
140 
148  const MSEdge* succEdge(int nSuccs) const;
149 
154  const MSEdge* getEdge() const;
155 
156 
160  virtual bool isOnRoad() const {
161  return true;
162  }
163 
168  virtual bool isRemoteControlled() const {
169  return false;
170  }
171 
172  virtual bool wasRemoteControlled(SUMOTime lookBack = DELTA_T) const {
173  UNUSED_PARAMETER(lookBack);
174  return false;
175  }
176 
180  virtual bool isFrontOnLane(const MSLane*) const {
181  return true;
182  }
183 
188  virtual double getLateralPositionOnLane() const {
189  return 0;
190  }
191 
197  virtual const MSEdge* getRerouteOrigin() const {
198  return *myCurrEdge;
199  }
200 
201 
206  return myCurrEdge;
207  }
208 
209 
219  void reroute(SUMOTime t, const std::string& info, SUMOAbstractRouter<MSEdge, SUMOVehicle>& router, const bool onInit = false, const bool withTaz = false, const bool silent = false);
220 
221 
234  bool replaceRouteEdges(ConstMSEdgeVector& edges, double cost, double savings, const std::string& info, bool onInit = false, bool check = false, bool removeStops = true);
235 
236 
242  virtual double getAcceleration() const;
243 
249  virtual double getSlope() const;
250 
256  void onDepart();
257 
261  inline SUMOTime getDeparture() const {
262  return myDeparture;
263  }
264 
267  return getDeparture() - getParameter().depart;
268  }
269 
270 
274  inline double getDepartPos() const {
275  return myDepartPos;
276  }
277 
282  virtual double getArrivalPos() const {
283  return myArrivalPos;
284  }
285 
288  virtual void setArrivalPos(double arrivalPos) {
289  myArrivalPos = arrivalPos;
290  }
291 
294  bool hasDeparted() const;
295 
299  virtual bool hasArrived() const;
300 
302  int getRoutePosition() const;
303 
305  void resetRoutePosition(int index, DepartLaneDefinition departLaneProcedure);
306 
310  double getOdometer() const;
311 
315  inline int getNumberReroutes() const {
316  return myNumberReroutes;
317  }
318 
320  double getImpatience() const;
321 
325  int getPersonNumber() const;
326 
330  std::vector<std::string> getPersonIDList() const;
331 
335  int getContainerNumber() const;
336 
337 
341  inline const std::vector<MSVehicleDevice*>& getDevices() const {
342  return myDevices;
343  }
344 
351  virtual void addPerson(MSTransportable* person);
352 
353 
360  virtual void addContainer(MSTransportable* container);
361 
364 
366  const std::vector<MSTransportable*>& getPersons() const;
367 
369  const std::vector<MSTransportable*>& getContainers() const;
370 
371 
377  bool hasValidRoute(std::string& msg, const MSRoute* route = 0) const;
378 
384  void addReminder(MSMoveReminder* rem);
385 
391  void removeReminder(MSMoveReminder* rem);
392 
404  virtual void activateReminders(const MSMoveReminder::Notification reason, const MSLane* enteredLane = 0);
405 
406 
410  inline double getLength() const {
411  return myType->getLength();
412  }
413 
414 
418  inline double getWidth() const {
419  return myType->getWidth();
420  }
421 
422 
426  inline double getChosenSpeedFactor() const {
427  return myChosenSpeedFactor;
428  }
429 
433  inline void setChosenSpeedFactor(const double factor) {
434  myChosenSpeedFactor = factor;
435  }
436 
438  MSVehicleDevice* getDevice(const std::type_info& type) const;
439 
440 
449  void replaceVehicleType(MSVehicleType* type);
450 
451 
460 
462 
463 
465  virtual void saveState(OutputDevice& out);
466 
468 
476  void addStops(const bool ignoreStopErrors);
477 
479  virtual bool isSelected() const {
480  return false;
481  }
482 
484  int getRNGIndex() const;
485 
487  std::mt19937* getRNG() const;
488 
489  inline NumericalID getNumericalID() const {
490  return myNumericalID;
491  }
492 
494  return myPersonDevice;
495  }
496 
498  return myContainerDevice;
499  }
500 
501 protected:
504  void calculateArrivalParams();
505 
508  virtual const ConstMSEdgeVector getStopEdges(double& firstPos, double& lastPos) const = 0;
509 
510 protected:
513 
515  const MSRoute* myRoute;
516 
519 
522 
525 
526 
529 
531  // The double value holds the relative position offset, i.e.,
532  // offset + vehicle-position - moveReminder-position = distance,
533  // i.e. the offset is counted up when the vehicle continues to a
534  // succeeding lane.
535  typedef std::vector< std::pair<MSMoveReminder*, double> > MoveReminderCont;
536 
540 
542  std::vector<MSVehicleDevice*> myDevices;
543 
546 
549 
552 
554  double myDepartPos;
555 
557  double myArrivalPos;
558 
561 
564 
566  double myOdometer;
567 
568  /* @brief magic value for undeparted vehicles
569  * @note: in previous versions this was -1
570  */
572 
573  static std::vector<MSTransportable*> myEmptyTransportableVector;
574 
575 private:
577 
579 
580 private:
583 
584 #ifdef _DEBUG
585 public:
586  static void initMoveReminderOutput(const OptionsCont& oc);
587 
588 protected:
590  void traceMoveReminder(const std::string& type, MSMoveReminder* rem, double pos, bool keep) const;
591 
593  const bool myTraceMoveReminders;
594 private:
596  static std::set<std::string> myShallTraceMoveReminders;
597 #endif
598 
599 
600 };
601 
602 #endif
603 
604 /****************************************************************************/
MSVehicleType
The car-following model and parameter.
Definition: MSVehicleType.h:65
UNUSED_PARAMETER
#define UNUSED_PARAMETER(x)
Definition: StdDefs.h:31
SUMOVehicleClass
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
Definition: SUMOVehicleClass.h:133
MSBaseVehicle::getParameter
const SUMOVehicleParameter & getParameter() const
Returns the vehicle's parameter (including departure definition)
Definition: MSBaseVehicle.cpp:144
MSBaseVehicle::hasDeparted
bool hasDeparted() const
Returns whether this vehicle has already departed.
Definition: MSBaseVehicle.cpp:379
MSBaseVehicle::getArrivalPos
virtual double getArrivalPos() const
Returns this vehicle's desired arrivalPos for its current route (may change on reroute)
Definition: MSBaseVehicle.h:282
GUIBaseVehicle
A MSVehicle extended by some values for usage within the gui.
Definition: GUIBaseVehicle.h:61
MSBaseVehicle::getContainerNumber
int getContainerNumber() const
Returns the number of containers.
Definition: MSBaseVehicle.cpp:633
MSBaseVehicle::getRNGIndex
int getRNGIndex() const
Definition: MSBaseVehicle.cpp:747
MSLane
Representation of a lane in the micro simulation.
Definition: MSLane.h:82
MSBaseVehicle::setDeviceParameter
void setDeviceParameter(const std::string &deviceName, const std::string &key, const std::string &value)
try to set the given parameter from any of the vehicles devices, raise InvalidArgument if no device p...
Definition: MSBaseVehicle.cpp:714
MSBaseVehicle::~MSBaseVehicle
virtual ~MSBaseVehicle()
Destructor.
Definition: MSBaseVehicle.cpp:125
MSBaseVehicle::MSBaseVehicle
MSBaseVehicle(SUMOVehicleParameter *pars, const MSRoute *route, MSVehicleType *type, const double speedFactor)
Constructor.
Definition: MSBaseVehicle.cpp:73
MSBaseVehicle::wasRemoteControlled
virtual bool wasRemoteControlled(SUMOTime lookBack=DELTA_T) const
Returns the information whether the vehicle is fully controlled via TraCI.
Definition: MSBaseVehicle.h:172
OutputDevice
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:63
MSBaseVehicle::myDeparture
SUMOTime myDeparture
The real departure time.
Definition: MSBaseVehicle.h:551
DELTA_T
SUMOTime DELTA_T
Definition: SUMOTime.cpp:36
MSBaseVehicle::getLateralPositionOnLane
virtual double getLateralPositionOnLane() const
Get the vehicle's lateral position on the lane.
Definition: MSBaseVehicle.h:188
MSRouteIterator
ConstMSEdgeVector::const_iterator MSRouteIterator
Definition: MSRoute.h:57
MSDevice_Transportable
Definition: MSDevice_Transportable.h:43
MSBaseVehicle::myChosenSpeedFactor
double myChosenSpeedFactor
A precomputed factor by which the driver wants to be faster than the speed limit.
Definition: MSBaseVehicle.h:524
MSBaseVehicle::myDevices
std::vector< MSVehicleDevice * > myDevices
The devices this vehicle has.
Definition: MSBaseVehicle.h:542
MSBaseVehicle::getNumberReroutes
int getNumberReroutes() const
Returns the number of new routes this vehicle got.
Definition: MSBaseVehicle.h:315
MSBaseVehicle::getLength
double getLength() const
Returns the vehicle's length.
Definition: MSBaseVehicle.h:410
MSBaseVehicle::getDepartDelay
SUMOTime getDepartDelay() const
Returns the depart delay.
Definition: MSBaseVehicle.h:266
MSBaseVehicle::getDeparture
SUMOTime getDeparture() const
Returns this vehicle's real departure time.
Definition: MSBaseVehicle.h:261
SUMOTime
long long int SUMOTime
Definition: SUMOTime.h:34
SUMOVehicle
Representation of a vehicle.
Definition: SUMOVehicle.h:60
MSBaseVehicle::myRoute
const MSRoute * myRoute
This vehicle's route.
Definition: MSBaseVehicle.h:515
MSBaseVehicle::getRoute
const MSRoute & getRoute() const
Returns the current route.
Definition: MSBaseVehicle.h:115
ConstMSEdgeVector
std::vector< const MSEdge * > ConstMSEdgeVector
Definition: MSEdge.h:75
MSBaseVehicle::hasValidRoute
bool hasValidRoute(std::string &msg, const MSRoute *route=0) const
Validates the current or given route.
Definition: MSBaseVehicle.cpp:435
MSBaseVehicle::replaceParameter
void replaceParameter(const SUMOVehicleParameter *newParameter)
replace the vehicle parameter (deleting the old one)
Definition: MSBaseVehicle.cpp:159
MSBaseVehicle::myArrivalLane
int myArrivalLane
The destination lane where the vehicle stops.
Definition: MSBaseVehicle.h:560
MSBaseVehicle::getPersonDevice
const MSDevice_Transportable * getPersonDevice() const
Definition: MSBaseVehicle.h:493
MSBaseVehicle::getRoutePosition
int getRoutePosition() const
return index of edge within route
Definition: MSBaseVehicle.cpp:391
MSBaseVehicle::getRerouteOrigin
virtual const MSEdge * getRerouteOrigin() const
Returns the starting point for reroutes (usually the current edge)
Definition: MSBaseVehicle.h:197
SUMOVehicleParameter
Structure representing possible vehicle parameter.
Definition: SUMOVehicleParameter.h:297
SUMOVehicle::NumericalID
long long int NumericalID
Definition: SUMOVehicle.h:62
MSTransportable
Definition: MSTransportable.h:58
MSBaseVehicle::isRemoteControlled
virtual bool isRemoteControlled() const
Returns the information whether the vehicle is fully controlled via TraCI.
Definition: MSBaseVehicle.h:168
MSRoute
Definition: MSRoute.h:66
MSBaseVehicle::resetRoutePosition
void resetRoutePosition(int index, DepartLaneDefinition departLaneProcedure)
reset index of edge within route
Definition: MSBaseVehicle.cpp:397
SUMOVehicleParameter::depart
SUMOTime depart
Definition: SUMOVehicleParameter.h:482
MSBaseVehicle::getMaxSpeed
double getMaxSpeed() const
Returns the maximum speed.
Definition: MSBaseVehicle.cpp:165
MSBaseVehicle::isSelected
virtual bool isSelected() const
whether this vehicle is selected in the GUI
Definition: MSBaseVehicle.h:479
MSBaseVehicle::calculateArrivalParams
void calculateArrivalParams()
(Re-)Calculates the arrival position and lane from the vehicle parameters
Definition: MSBaseVehicle.cpp:512
MSMoveReminder
Something on a lane to be noticed about vehicle movement.
Definition: MSMoveReminder.h:66
MSBaseVehicle::getChosenSpeedFactor
double getChosenSpeedFactor() const
Returns the precomputed factor by which the driver wants to be faster than the speed limit.
Definition: MSBaseVehicle.h:426
MSBaseVehicle::getStopEdges
virtual const ConstMSEdgeVector getStopEdges(double &firstPos, double &lastPos) const =0
Returns the list of still pending stop edges.
MSVehicleType.h
MSBaseVehicle::myParameter
const SUMOVehicleParameter * myParameter
This vehicle's parameter.
Definition: MSBaseVehicle.h:512
MSBaseVehicle::myArrivalPos
double myArrivalPos
The position on the destination lane where the vehicle stops.
Definition: MSBaseVehicle.h:557
MSBaseVehicle::getEdge
const MSEdge * getEdge() const
Returns the edge the vehicle is currently at.
Definition: MSBaseVehicle.cpp:181
SUMOVehicle.h
MSMoveReminder.h
MSBaseVehicle::createDevice
void createDevice(const std::string &deviceName)
create device of the given type
Definition: MSBaseVehicle.cpp:684
MSBaseVehicle::getOdometer
double getOdometer() const
Returns the distance that was already driven by this vehicle.
Definition: MSBaseVehicle.cpp:405
MSBaseVehicle::saveState
virtual void saveState(OutputDevice &out)
Saves the (common) state of a vehicle.
Definition: MSBaseVehicle.cpp:575
MSBaseVehicle::getDepartPos
double getDepartPos() const
Returns this vehicle's real departure position.
Definition: MSBaseVehicle.h:274
MSBaseVehicle::myPersonDevice
MSDevice_Transportable * myPersonDevice
The passengers this vehicle may have.
Definition: MSBaseVehicle.h:545
MSBaseVehicle::getDeviceParameter
std::string getDeviceParameter(const std::string &deviceName, const std::string &key) const
try to retrieve the given parameter from any of the vehicles devices, raise InvalidArgument if no dev...
Definition: MSBaseVehicle.cpp:703
MSBaseVehicle::getContainers
const std::vector< MSTransportable * > & getContainers() const
retrieve riding containers
Definition: MSBaseVehicle.cpp:662
MSBaseVehicle::getDevices
const std::vector< MSVehicleDevice * > & getDevices() const
Returns this vehicle's devices.
Definition: MSBaseVehicle.h:341
MSBaseVehicle::getImpatience
double getImpatience() const
Returns this vehicles impatience.
Definition: MSBaseVehicle.cpp:557
MSVehicleType::getWidth
double getWidth() const
Get the width which vehicles of this class shall have when being drawn.
Definition: MSVehicleType.h:246
MSBaseVehicle::getEmissionParameters
const std::map< int, double > * getEmissionParameters() const
Returns the vehicle's emission model parameter.
Definition: MSBaseVehicle.cpp:149
MSBaseVehicle::setChosenSpeedFactor
void setChosenSpeedFactor(const double factor)
Returns the precomputed factor by which the driver wants to be faster than the speed limit.
Definition: MSBaseVehicle.h:433
MSBaseVehicle::addPerson
virtual void addPerson(MSTransportable *person)
Adds a person to this vehicle.
Definition: MSBaseVehicle.cpp:411
MSBaseVehicle::myDepartPos
double myDepartPos
The real depart position.
Definition: MSBaseVehicle.h:554
MSBaseVehicle::operator=
MSBaseVehicle & operator=(const MSBaseVehicle &s)
invalidated assignment operator
OptionsCont
A storage for options typed value containers)
Definition: OptionsCont.h:89
MSEdge
A road/street connecting two junctions.
Definition: MSEdge.h:78
MSBaseVehicle::isOnRoad
virtual bool isOnRoad() const
Returns the information whether the vehicle is on a road (is simulated)
Definition: MSBaseVehicle.h:160
MSBaseVehicle::getAcceleration
virtual double getAcceleration() const
Returns the vehicle's acceleration.
Definition: MSBaseVehicle.cpp:359
MSBaseVehicle::getVehicleType
const MSVehicleType & getVehicleType() const
Returns the vehicle's type definition.
Definition: MSBaseVehicle.h:123
MSBaseVehicle::isFrontOnLane
virtual bool isFrontOnLane(const MSLane *) const
Returns the information whether the front of the vehhicle is on the given lane.
Definition: MSBaseVehicle.h:180
MSBaseVehicle::replaceRouteEdges
bool replaceRouteEdges(ConstMSEdgeVector &edges, double cost, double savings, const std::string &info, bool onInit=false, bool check=false, bool removeStops=true)
Replaces the current route by the given edges.
Definition: MSBaseVehicle.cpp:303
MSBaseVehicle::getSlope
virtual double getSlope() const
Returns the slope of the road at vehicle's position.
Definition: MSBaseVehicle.cpp:365
MSBaseVehicle::myNumberReroutes
int myNumberReroutes
The number of reroutings.
Definition: MSBaseVehicle.h:563
SUMOAbstractRouter< MSEdge, SUMOVehicle >
DepartLaneDefinition
DepartLaneDefinition
Possible ways to choose a lane on depart.
Definition: SUMOVehicleParameter.h:116
MSBaseVehicle::addStops
void addStops(const bool ignoreStopErrors)
Adds stops to the built vehicle.
Definition: MSBaseVehicle.cpp:593
MSBaseVehicle::getContainerDevice
const MSDevice_Transportable * getContainerDevice() const
Definition: MSBaseVehicle.h:497
MSBaseVehicle::getPersonIDList
std::vector< std::string > getPersonIDList() const
Returns the list of persons.
Definition: MSBaseVehicle.cpp:623
MSBaseVehicle::myCurrEdge
MSRouteIterator myCurrEdge
Iterator to current route-edge.
Definition: MSBaseVehicle.h:521
MSBaseVehicle::myEmptyTransportableVector
static std::vector< MSTransportable * > myEmptyTransportableVector
Definition: MSBaseVehicle.h:573
MSBaseVehicle::hasDevice
bool hasDevice(const std::string &deviceName) const
check whether the vehicle is equiped with a device of the given type
Definition: MSBaseVehicle.cpp:673
MSVehicleType::getLength
double getLength() const
Get vehicle's length [m].
Definition: MSVehicleType.h:109
MSBaseVehicle::getPersons
const std::vector< MSTransportable * > & getPersons() const
retrieve riding persons
Definition: MSBaseVehicle.cpp:652
MSBaseVehicle::MoveReminderCont
std::vector< std::pair< MSMoveReminder *, double > > MoveReminderCont
Definition of a move reminder container.
Definition: MSBaseVehicle.h:535
MSBaseVehicle::succEdge
const MSEdge * succEdge(int nSuccs) const
Returns the nSuccs'th successor of edge the vehicle is currently at.
Definition: MSBaseVehicle.cpp:171
MSRoute.h
MSBaseVehicle::getVClass
SUMOVehicleClass getVClass() const
Returns the vehicle's access class.
Definition: MSBaseVehicle.h:131
MSBaseVehicle::getNumericalID
NumericalID getNumericalID() const
return the numerical ID which is only for internal usage
Definition: MSBaseVehicle.h:489
MSBaseVehicle::getSingularType
MSVehicleType & getSingularType()
Replaces the current vehicle type with a new one used by this vehicle only.
Definition: MSBaseVehicle.cpp:736
MSBaseVehicle::getPersonNumber
int getPersonNumber() const
Returns the number of persons.
Definition: MSBaseVehicle.cpp:617
MSBaseVehicle::getCurrentRouteEdge
const MSRouteIterator & getCurrentRouteEdge() const
Returns an iterator pointing to the current edge in this vehicles route.
Definition: MSBaseVehicle.h:205
MSVehicleType::getParameter
const SUMOVTypeParameter & getParameter() const
Definition: MSVehicleType.h:560
MSBaseVehicle
The base class for microscopic and mesoscopic vehicles.
Definition: MSBaseVehicle.h:51
MSBaseVehicle::getID
const std::string & getID() const
Returns the name of the vehicle.
Definition: MSBaseVehicle.cpp:138
MSBaseVehicle::hasArrived
virtual bool hasArrived() const
Returns whether this vehicle has already arived (by default this is true if the vehicle has reached i...
Definition: MSBaseVehicle.cpp:385
MSBaseVehicle::addReminder
void addReminder(MSMoveReminder *rem)
Adds a MoveReminder dynamically.
Definition: MSBaseVehicle.cpp:463
MSBaseVehicle::setArrivalPos
virtual void setArrivalPos(double arrivalPos)
Sets this vehicle's desired arrivalPos for its current route.
Definition: MSBaseVehicle.h:288
MSBaseVehicle::getWidth
double getWidth() const
Returns the vehicle's width.
Definition: MSBaseVehicle.h:418
MSBaseVehicle::onDepart
void onDepart()
Called when the vehicle is inserted into the network.
Definition: MSBaseVehicle.cpp:371
MSBaseVehicle::getPreviousSpeed
double getPreviousSpeed() const
Returns the vehicle's previous speed.
Definition: MSBaseVehicle.cpp:68
config.h
MSBaseVehicle::myCurrentNumericalIndex
static NumericalID myCurrentNumericalIndex
Definition: MSBaseVehicle.h:578
StdDefs.h
MSBaseVehicle::myNumericalID
const NumericalID myNumericalID
Definition: MSBaseVehicle.h:576
MSBaseVehicle::removeReminder
void removeReminder(MSMoveReminder *rem)
Removes a MoveReminder dynamically.
Definition: MSBaseVehicle.cpp:474
MSBaseVehicle::removeTransportable
void removeTransportable(MSTransportable *t)
removes a person or container
Definition: MSBaseVehicle.cpp:640
MSBaseVehicle::isVehicle
bool isVehicle() const
Get the vehicle's ID.
Definition: MSBaseVehicle.h:78
MSBaseVehicle::reroute
void reroute(SUMOTime t, const std::string &info, SUMOAbstractRouter< MSEdge, SUMOVehicle > &router, const bool onInit=false, const bool withTaz=false, const bool silent=false)
Performs a rerouting using the given router.
Definition: MSBaseVehicle.cpp:187
MSBaseVehicle::myType
MSVehicleType * myType
This vehicle's type.
Definition: MSBaseVehicle.h:518
MSBaseVehicle::myOdometer
double myOdometer
A simple odometer to keep track of the length of the route already driven.
Definition: MSBaseVehicle.h:566
MSBaseVehicle::getDevice
MSVehicleDevice * getDevice(const std::type_info &type) const
Returns a device of the given type if it exists or 0.
Definition: MSBaseVehicle.cpp:564
MSBaseVehicle::NOT_YET_DEPARTED
static const SUMOTime NOT_YET_DEPARTED
Definition: MSBaseVehicle.h:571
MSBaseVehicle::myContainerDevice
MSDevice_Transportable * myContainerDevice
The containers this vehicle may have.
Definition: MSBaseVehicle.h:548
MSBaseVehicle::myMoveReminders
MoveReminderCont myMoveReminders
Currently relevant move reminders.
Definition: MSBaseVehicle.h:538
MSBaseVehicle::activateReminders
virtual void activateReminders(const MSMoveReminder::Notification reason, const MSLane *enteredLane=0)
"Activates" all current move reminder
Definition: MSBaseVehicle.cpp:490
SUMOVTypeParameter::vehicleClass
SUMOVehicleClass vehicleClass
The vehicle's class.
Definition: SUMOVTypeParameter.h:240
MSMoveReminder::Notification
Notification
Definition of a vehicle state.
Definition: MSMoveReminder.h:91
MSBaseVehicle::replaceVehicleType
void replaceVehicleType(MSVehicleType *type)
Replaces the current vehicle type by the one given.
Definition: MSBaseVehicle.cpp:726
MSBaseVehicle::getRNG
std::mt19937 * getRNG() const
Definition: MSBaseVehicle.cpp:758
MSVehicleDevice
Abstract in-vehicle device.
Definition: MSVehicleDevice.h:54
MSBaseVehicle::addContainer
virtual void addContainer(MSTransportable *container)
Adds a container to this vehicle.
Definition: MSBaseVehicle.cpp:423