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-2020 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials are made available under the
5 // terms of the Eclipse Public License 2.0 which is available at
6 // https://www.eclipse.org/legal/epl-2.0/
7 // This Source Code may also be made available under the following Secondary
8 // Licenses when the conditions for such availability set forth in the Eclipse
9 // Public License 2.0 are satisfied: GNU General Public License, version 2
10 // or later which is available at
11 // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12 // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13 /****************************************************************************/
20 // A base class for vehicle implementations
21 /****************************************************************************/
22 #pragma once
23 #include <config.h>
24 
25 #include <iostream>
26 #include <vector>
27 #include <set>
29 #include <utils/common/StdDefs.h>
30 #include "MSRoute.h"
31 #include "MSMoveReminder.h"
32 #include "MSVehicleType.h"
33 
34 // ===========================================================================
35 // class declarations
36 // ===========================================================================
37 class MSLane;
38 class MSStop;
40 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 
68  ROUTE_UNCHECKED = 1 << 0,
70  ROUTE_INVALID = 1 << 1,
71  // starting edge permissions invalid (could change)
73  // insertion lane does not exist
75  };
76 
84  MSBaseVehicle(SUMOVehicleParameter* pars, const MSRoute* route,
85  MSVehicleType* type, const double speedFactor);
86 
87 
89  virtual ~MSBaseVehicle();
90 
91  virtual void initDevices();
92 
93  bool isVehicle() const {
94  return true;
95  }
96 
98  void setID(const std::string& newID);
99 
104  const SUMOVehicleParameter& getParameter() const;
105 
107  std::string getPrefixedParameter(const std::string& key, std::string& error) const;
108 
113  const std::map<int, double>* getEmissionParameters() const;
114 
116  void replaceParameter(const SUMOVehicleParameter* newParameter);
117 
119  bool hasDevice(const std::string& deviceName) const;
120 
122  void createDevice(const std::string& deviceName);
123 
125  std::string getDeviceParameter(const std::string& deviceName, const std::string& key) const;
126 
128  void setDeviceParameter(const std::string& deviceName, const std::string& key, const std::string& value);
129 
133  inline const MSRoute& getRoute() const {
134  return *myRoute;
135  }
136 
137 
141  inline const MSVehicleType& getVehicleType() const {
142  return *myType;
143  }
144 
145 
149  inline SUMOVehicleClass getVClass() const {
150  return myType->getParameter().vehicleClass;
151  }
152 
156  double getMaxSpeed() const;
157 
158 
166  const MSEdge* succEdge(int nSuccs) const;
167 
172  const MSEdge* getEdge() const;
173 
174 
178  virtual bool isOnRoad() const {
179  return true;
180  }
181 
186  virtual bool isRemoteControlled() const {
187  return false;
188  }
189 
190  virtual bool wasRemoteControlled(SUMOTime lookBack = DELTA_T) const {
191  UNUSED_PARAMETER(lookBack);
192  return false;
193  }
194 
198  virtual bool isFrontOnLane(const MSLane*) const {
199  return true;
200  }
201 
206  virtual double getLateralPositionOnLane() const {
207  return 0;
208  }
209 
215  virtual const MSEdge* getRerouteOrigin() const {
216  return *myCurrEdge;
217  }
218 
219 
224  return myCurrEdge;
225  }
226 
227 
237  void reroute(SUMOTime t, const std::string& info, SUMOAbstractRouter<MSEdge, SUMOVehicle>& router, const bool onInit = false, const bool withTaz = false, const bool silent = false);
238 
239 
252  bool replaceRouteEdges(ConstMSEdgeVector& edges, double cost, double savings, const std::string& info, bool onInit = false, bool check = false, bool removeStops = true);
253 
264  virtual bool replaceRoute(const MSRoute* route, const std::string& info, bool onInit = false, int offset = 0, bool addStops = true, bool removeStops = true);
265 
271  virtual double getAcceleration() const;
272 
278  void onDepart();
279 
283  inline SUMOTime getDeparture() const {
284  return myDeparture;
285  }
286 
289  return getDeparture() - getParameter().depart;
290  }
291 
294  virtual double getStopDelay() const {
296  return -1;
297  }
298 
301  virtual double getStopArrivalDelay() const {
303  return INVALID_DOUBLE;
304  }
305 
309  inline double getDepartPos() const {
310  return myDepartPos;
311  }
312 
317  virtual double getArrivalPos() const {
318  return myArrivalPos;
319  }
320 
323  virtual void setArrivalPos(double arrivalPos) {
324  myArrivalPos = arrivalPos;
325  }
326 
334  virtual void onRemovalFromNet(const MSMoveReminder::Notification /*reason*/) {}
335 
338  bool hasDeparted() const;
339 
343  virtual bool hasArrived() const;
344 
346  int getRoutePosition() const;
347 
349  void resetRoutePosition(int index, DepartLaneDefinition departLaneProcedure);
350 
354  double getOdometer() const;
355 
359  inline int getNumberReroutes() const {
360  return myNumberReroutes;
361  }
362 
364  double getImpatience() const;
365 
369  int getPersonNumber() const;
370 
374  std::vector<std::string> getPersonIDList() const;
375 
379  int getContainerNumber() const;
380 
381 
385  inline const std::vector<MSVehicleDevice*>& getDevices() const {
386  return myDevices;
387  }
388 
390  bool allowsBoarding(MSTransportable* t) const;
391 
396  virtual void addTransportable(MSTransportable* transportable);
397 
400 
402  const std::vector<MSTransportable*>& getPersons() const;
403 
405  const std::vector<MSTransportable*>& getContainers() const;
406 
408  bool isLineStop(double position) const;
409 
415  bool hasValidRoute(std::string& msg, const MSRoute* route = 0) const;
416 
418  virtual bool hasValidRouteStart(std::string& msg);
419 
421  int getRouteValidity(bool update = true, bool silent = false);
422 
428  void addReminder(MSMoveReminder* rem);
429 
435  void removeReminder(MSMoveReminder* rem);
436 
448  virtual void activateReminders(const MSMoveReminder::Notification reason, const MSLane* enteredLane = 0);
449 
450 
454  inline double getLength() const {
455  return myType->getLength();
456  }
457 
458 
462  inline double getWidth() const {
463  return myType->getWidth();
464  }
465 
466 
470  inline double getChosenSpeedFactor() const {
471  return myChosenSpeedFactor;
472  }
473 
477  inline void setChosenSpeedFactor(const double factor) {
478  myChosenSpeedFactor = factor;
479  }
480 
482  MSVehicleDevice* getDevice(const std::type_info& type) const;
483 
484 
493  void replaceVehicleType(MSVehicleType* type);
494 
495 
504 
506 
507 
509  virtual void saveState(OutputDevice& out);
510 
512 
513  virtual bool handleCollisionStop(MSStop& stop, const bool collision, const double distToStop, const std::string& errorMsgStart, std::string& errorMsg);
514 
518  bool isStopped() const;
519 
523  bool isParking() const;
524 
528  bool isStoppedTriggered() const;
529 
532  bool isStoppedInRange(const double pos, const double tolerance) const;
533 
537  bool hasStops() const {
538  return !myStops.empty();
539  }
540 
542  double basePos(const MSEdge* edge) const;
543 
550  bool addStop(const SUMOVehicleParameter::Stop& stopPar, std::string& errorMsg, SUMOTime untilOffset = 0, bool collision = false,
551  MSRouteIterator* searchStart = nullptr);
552 
560  void addStops(const bool ignoreStopErrors, MSRouteIterator* searchStart = nullptr);
561 
563  bool haveValidStopEdges() const;
564 
568  const ConstMSEdgeVector getStopEdges(double& firstPos, double& lastPos) const;
569 
571  std::vector<std::pair<int, double> > getStopIndices() const;
572 
577  inline const std::list<MSStop>& getStops() const {
578  return myStops;
579  }
580 
581  inline const std::vector<SUMOVehicleParameter::Stop>& getPastStops() const {
582  return myPastStops;
583  }
584 
589  virtual bool resumeFromStopping() {
590  return false;
591  }
592 
594  bool abortNextStop(int nextStopIndex = 0);
595 
597  virtual bool isSelected() const {
598  return false;
599  }
600 
602  int getRNGIndex() const;
603 
605  std::mt19937* getRNG() const;
606 
607  inline NumericalID getNumericalID() const {
608  return myNumericalID;
609  }
610 
612  return myPersonDevice;
613  }
614 
616  return myContainerDevice;
617  }
618 
619 
621 
622 
626  double getCO2Emissions() const;
627 
628 
632  double getCOEmissions() const;
633 
634 
638  double getHCEmissions() const;
639 
640 
644  double getNOxEmissions() const;
645 
646 
650  double getPMxEmissions() const;
651 
652 
656  double getFuelConsumption() const;
657 
658 
662  double getElectricityConsumption() const;
663 
668  double getStateOfCharge() const;
669 
674  double getElecHybridCurrent() const;
675 
679  double getHarmonoise_NoiseEmissions() const;
681 
695  public:
697  BaseInfluencer();
698 
700  virtual ~BaseInfluencer() {}
701 
703  static void init();
705  static void cleanup();
706 
707 
709  int getRoutingMode() const {
710  return myRoutingMode;
711  }
712 
716  void setRoutingMode(int value) {
717  myRoutingMode = value;
718  }
719 
720 
722 
723  protected:
726 
727  };
728 
729 
730 
737 
738  virtual const BaseInfluencer* getBaseInfluencer() const = 0;
739 
740  virtual bool hasInfluencer() const = 0;
741 
742 
750 
758  virtual std::pair<const MSVehicle* const, double> getLeader(double dist = 0) const {
759  UNUSED_PARAMETER(dist);
760  WRITE_WARNING("getLeader not yet implemented for meso");
761  return std::make_pair(nullptr, -1);
762  }
763 
772  virtual std::pair<const MSVehicle* const, double> getFollower(double dist = 0) const {
773  UNUSED_PARAMETER(dist);
774  WRITE_WARNING("getFollwer not yet implemented for meso");
775  return std::make_pair(nullptr, -1);
776  }
777 
780  void calculateArrivalParams();
781 
782 protected:
785 
787  const MSRoute* myRoute;
788 
791 
794 
797 
799  std::list<MSStop> myStops;
800 
802  std::vector<SUMOVehicleParameter::Stop> myPastStops;
803 
804 
807 
809  // The double value holds the relative position offset, i.e.,
810  // offset + vehicle-position - moveReminder-position = distance,
811  // i.e. the offset is counted up when the vehicle continues to a
812  // succeeding lane.
813  typedef std::vector< std::pair<MSMoveReminder*, double> > MoveReminderCont;
814 
818 
820  std::vector<MSVehicleDevice*> myDevices;
821 
824 
827 
830 
832  double myDepartPos;
833 
835  double myArrivalPos;
836 
839 
842 
845 
847  double myOdometer;
848 
851 
852  /* @brief magic value for undeparted vehicles
853  * @note: in previous versions this was -1
854  */
856 
857  static std::vector<MSTransportable*> myEmptyTransportableVector;
858 
859 private:
861 
862  /* @brief The vehicle's knowledge about edge efforts/travel times; @see MSEdgeWeightsStorage
863  * @note member is initialized on first access */
865 
867 
869 
870 private:
872  MSBaseVehicle& operator=(const MSBaseVehicle& s) = delete;
873 
874 #ifdef _DEBUG
875 public:
876  static void initMoveReminderOutput(const OptionsCont& oc);
877 
878 protected:
880  void traceMoveReminder(const std::string& type, MSMoveReminder* rem, double pos, bool keep) const;
881 
883  const bool myTraceMoveReminders;
884 private:
886  static std::set<std::string> myShallTraceMoveReminders;
887 #endif
888 
889 
890 };
std::vector< const MSEdge * > ConstMSEdgeVector
Definition: MSEdge.h:74
ConstMSEdgeVector::const_iterator MSRouteIterator
Definition: MSRoute.h:54
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:276
SUMOTime DELTA_T
Definition: SUMOTime.cpp:37
long long int SUMOTime
Definition: SUMOTime.h:31
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
DepartLaneDefinition
Possible ways to choose a lane on depart.
const double INVALID_DOUBLE
Definition: StdDefs.h:62
#define UNUSED_PARAMETER(x)
Definition: StdDefs.h:29
A MSVehicle extended by some values for usage within the gui.
static void cleanup()
Static cleanup.
int myRoutingMode
routing mode (see TraCIConstants.h)
static void init()
Static initalization.
virtual ~BaseInfluencer()
Destructor.
SUMOAbstractRouter< MSEdge, SUMOVehicle > & getRouterTT(const int rngIndex, SUMOVehicleClass svc) const
void setRoutingMode(int value)
Sets routing behavior.
int getRoutingMode() const
return the current routing mode
The base class for microscopic and mesoscopic vehicles.
Definition: MSBaseVehicle.h:51
double getMaxSpeed() const
Returns the maximum speed.
MSVehicleDevice * getDevice(const std::type_info &type) const
Returns a device of the given type if it exists or 0.
void addStops(const bool ignoreStopErrors, MSRouteIterator *searchStart=nullptr)
Adds stops to the built vehicle.
double getDepartPos() const
Returns this vehicle's real departure position.
virtual bool isSelected() const
whether this vehicle is selected in the GUI
const MSDevice_Transportable * getPersonDevice() const
virtual bool isRemoteControlled() const
Returns the information whether the vehicle is fully controlled via TraCI.
std::list< MSStop > myStops
The vehicle's list of stops.
double getImpatience() const
Returns this vehicles impatience.
const std::vector< MSTransportable * > & getPersons() const
retrieve riding persons
virtual void initDevices()
const MSEdge * succEdge(int nSuccs) const
Returns the nSuccs'th successor of edge the vehicle is currently at.
void resetRoutePosition(int index, DepartLaneDefinition departLaneProcedure)
reset index of edge within route
virtual double getLateralPositionOnLane() const
Get the vehicle's lateral position on the lane.
virtual BaseInfluencer & getBaseInfluencer()=0
Returns the velocity/lane influencer.
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...
void setChosenSpeedFactor(const double factor)
Returns the precomputed factor by which the driver wants to be faster than the speed limit.
virtual double getArrivalPos() const
Returns this vehicle's desired arrivalPos for its current route (may change on reroute)
MSVehicleType * myType
This vehicle's type.
virtual double getStopDelay() const
Returns the estimated public transport stop (departure) delay in seconds.
MoveReminderCont myMoveReminders
Currently relevant move reminders.
bool allowsBoarding(MSTransportable *t) const
whether the given transportable is allowed to board this vehicle
double myDepartPos
The real depart position.
const std::list< MSStop > & getStops() const
const SUMOVehicleParameter & getParameter() const
Returns the vehicle's parameter (including departure definition)
void addReminder(MSMoveReminder *rem)
Adds a MoveReminder dynamically.
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.
double getFuelConsumption() const
Returns fuel consumption of the current state.
void replaceParameter(const SUMOVehicleParameter *newParameter)
replace the vehicle parameter (deleting the old one)
double getCO2Emissions() const
Returns CO2 emission of the current state.
virtual std::pair< const MSVehicle *const, double > getFollower(double dist=0) const
Returns the follower of the vehicle looking for a fixed distance.
double getChosenSpeedFactor() const
Returns the precomputed factor by which the driver wants to be faster than the speed limit.
std::vector< MSVehicleDevice * > myDevices
The devices this vehicle has.
virtual bool replaceRoute(const MSRoute *route, const std::string &info, bool onInit=false, int offset=0, bool addStops=true, bool removeStops=true)
Replaces the current route by the given one.
double getPreviousSpeed() const
Returns the vehicle's previous speed.
virtual void addTransportable(MSTransportable *transportable)
Adds a person or container to this vehicle.
double getElectricityConsumption() const
Returns electricity consumption of the current state.
int getRouteValidity(bool update=true, bool silent=false)
check for route validity at first insertion attempt
std::vector< std::pair< MSMoveReminder *, double > > MoveReminderCont
Definition of a move reminder container.
double getOdometer() const
Returns the distance that was already driven by this vehicle.
virtual bool hasArrived() const
Returns whether this vehicle has already arived (by default this is true if the vehicle has reached i...
const NumericalID myNumericalID
static NumericalID myCurrentNumericalIndex
MSVehicleType & getSingularType()
Replaces the current vehicle type with a new one used by this vehicle only.
void replaceVehicleType(MSVehicleType *type)
Replaces the current vehicle type by the one given.
virtual bool wasRemoteControlled(SUMOTime lookBack=DELTA_T) const
Returns the information whether the vehicle is fully controlled via TraCI.
virtual void onRemovalFromNet(const MSMoveReminder::Notification)
Called when the vehicle is removed from the network.
double getLength() const
Returns the vehicle's length.
bool isParking() const
Returns whether the vehicle is parking.
const MSEdge * getEdge() const
Returns the edge the vehicle is currently at.
double getHarmonoise_NoiseEmissions() const
Returns noise emissions of the current state.
const std::map< int, double > * getEmissionParameters() const
Returns the vehicle's emission model parameter.
bool hasValidRoute(std::string &msg, const MSRoute *route=0) const
Validates the current or given route.
bool isStoppedInRange(const double pos, const double tolerance) const
return whether the given position is within range of the current stop
int getPersonNumber() const
Returns the number of persons.
virtual std::pair< const MSVehicle *const, double > getLeader(double dist=0) const
Returns the leader of the vehicle looking for a fixed distance.
const MSDevice_Transportable * getContainerDevice() const
double getNOxEmissions() const
Returns NOx emission of the current state.
void setID(const std::string &newID)
set the id (inherited from Named but forbidden for vehicles)
std::mt19937 * getRNG() const
double getPMxEmissions() const
Returns PMx emission of the current state.
MSRouteIterator myCurrEdge
Iterator to current route-edge.
static std::vector< MSTransportable * > myEmptyTransportableVector
bool hasDeparted() const
Returns whether this vehicle has already departed.
double getWidth() const
Returns the vehicle's width.
double getCOEmissions() const
Returns CO emission of the current state.
MSDevice_Transportable * myContainerDevice
The containers this vehicle may have.
MSBaseVehicle(SUMOVehicleParameter *pars, const MSRoute *route, MSVehicleType *type, const double speedFactor)
Constructor.
double getStateOfCharge() const
Returns actual state of charge of battery (Wh) RICE_CHECK: This may be a misnomer,...
MSEdgeWeightsStorage & _getWeightsStorage() const
bool isVehicle() const
Whether it is a vehicle.
Definition: MSBaseVehicle.h:93
bool hasDevice(const std::string &deviceName) const
check whether the vehicle is equiped with a device of the given type
virtual const MSEdge * getRerouteOrigin() const
Returns the starting point for reroutes (usually the current edge)
SUMOTime getDeparture() const
Returns this vehicle's real departure time.
void calculateArrivalParams()
(Re-)Calculates the arrival position and lane from the vehicle parameters
double basePos(const MSEdge *edge) const
departure position where the vehicle fits fully onto the edge (if possible)
const MSRouteIterator & getCurrentRouteEdge() const
Returns an iterator pointing to the current edge in this vehicles route.
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...
MSDevice_Transportable * myPersonDevice
The passengers this vehicle may have.
const MSRoute * myRoute
This vehicle's route.
const MSVehicleType & getVehicleType() const
Returns the vehicle's type definition.
bool hasStops() const
Returns whether the vehicle has to stop somewhere.
virtual void activateReminders(const MSMoveReminder::Notification reason, const MSLane *enteredLane=0)
"Activates" all current move reminder
bool isLineStop(double position) const
returns whether the vehicle serves a public transport line that serves the given stop
double myChosenSpeedFactor
A precomputed factor by which the driver wants to be faster than the speed limit.
@ ROUTE_INVALID
route was checked and is valid
Definition: MSBaseVehicle.h:70
@ ROUTE_START_INVALID_LANE
Definition: MSBaseVehicle.h:74
@ ROUTE_START_INVALID_PERMISSIONS
Definition: MSBaseVehicle.h:72
std::string getPrefixedParameter(const std::string &key, std::string &error) const
retrieve parameters of devices, models and the vehicle itself
void removeTransportable(MSTransportable *t)
removes a person or container
SUMOVehicleClass getVClass() const
Returns the vehicle's access class.
virtual double getStopArrivalDelay() const
Returns the estimated public transport stop arrival delay in seconds.
int myArrivalLane
The destination lane where the vehicle stops.
virtual ~MSBaseVehicle()
Destructor.
SUMOTime myDeparture
The real departure time.
virtual void setArrivalPos(double arrivalPos)
Sets this vehicle's desired arrivalPos for its current route.
std::vector< std::string > getPersonIDList() const
Returns the list of persons.
const MSEdgeWeightsStorage & getWeightsStorage() const
Returns the vehicle's internal edge travel times/efforts container.
bool isStoppedTriggered() const
Returns whether the vehicle is on a triggered stop.
const std::vector< MSVehicleDevice * > & getDevices() const
Returns this vehicle's devices.
virtual bool hasInfluencer() const =0
bool addStop(const SUMOVehicleParameter::Stop &stopPar, std::string &errorMsg, SUMOTime untilOffset=0, bool collision=false, MSRouteIterator *searchStart=nullptr)
Adds a stop.
double getHCEmissions() const
Returns HC emission of the current state.
NumericalID getNumericalID() const
return the numerical ID which is only for internal usage
virtual bool resumeFromStopping()
std::vector< SUMOVehicleParameter::Stop > myPastStops
The list of stops that the vehicle has already reached.
void onDepart()
Called when the vehicle is inserted into the network.
void removeReminder(MSMoveReminder *rem)
Removes a MoveReminder dynamically.
bool haveValidStopEdges() const
check whether all stop.edge MSRouteIterators are valid and in order
virtual double getAcceleration() const
Returns the vehicle's acceleration.
virtual bool handleCollisionStop(MSStop &stop, const bool collision, const double distToStop, const std::string &errorMsgStart, std::string &errorMsg)
virtual const BaseInfluencer * getBaseInfluencer() const =0
int getRoutePosition() const
return index of edge within route
static const SUMOTime NOT_YET_DEPARTED
SUMOTime getDepartDelay() const
Returns the depart delay.
double getElecHybridCurrent() const
Returns actual current (A) of ElecHybrid device RICE_CHECK: Is this the current consumed from the ove...
const SUMOVehicleParameter * myParameter
This vehicle's parameter.
virtual bool hasValidRouteStart(std::string &msg)
checks wether the vehicle can depart on the first edge
int myRouteValidity
status of the current vehicle route
std::vector< std::pair< int, double > > getStopIndices() const
return list of route indices for the remaining stops
virtual bool isFrontOnLane(const MSLane *) const
Returns the information whether the front of the vehhicle is on the given lane.
const ConstMSEdgeVector getStopEdges(double &firstPos, double &lastPos) const
Returns the list of still pending stop edges also returns the first and last stop position.
SUMOTime myStopUntilOffset
The offset when adding route stops with 'until' on route replacement.
int getNumberReroutes() const
Returns the number of new routes this vehicle got.
virtual bool isOnRoad() const
Returns the information whether the vehicle is on a road (is simulated)
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.
const std::vector< SUMOVehicleParameter::Stop > & getPastStops() const
const std::vector< MSTransportable * > & getContainers() const
retrieve riding containers
const MSRoute & getRoute() const
Returns the current route.
int getRNGIndex() const
MSEdgeWeightsStorage * myEdgeWeights
MSBaseVehicle & operator=(const MSBaseVehicle &s)=delete
invalidated assignment operator
void createDevice(const std::string &deviceName)
create device of the given type
bool isStopped() const
Returns whether the vehicle is at a stop.
bool abortNextStop(int nextStopIndex=0)
deletes the next stop at the given index if it exists
int myNumberReroutes
The number of reroutings.
double myArrivalPos
The position on the destination lane where the vehicle stops.
virtual void saveState(OutputDevice &out)
Saves the (common) state of a vehicle.
double myOdometer
A simple odometer to keep track of the length of the route already driven.
int getContainerNumber() const
Returns the number of containers.
A road/street connecting two junctions.
Definition: MSEdge.h:77
A storage for edge travel times and efforts.
Representation of a lane in the micro simulation.
Definition: MSLane.h:82
Something on a lane to be noticed about vehicle movement.
Notification
Definition of a vehicle state.
Definition: MSStop.h:44
Abstract in-vehicle device.
The car-following model and parameter.
Definition: MSVehicleType.h:62
double getWidth() const
Get the width which vehicles of this class shall have when being drawn.
double getLength() const
Get vehicle's length [m].
const SUMOVTypeParameter & getParameter() const
A storage for options typed value containers)
Definition: OptionsCont.h:89
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:60
SUMOVehicleClass vehicleClass
The vehicle's class.
Representation of a vehicle.
Definition: SUMOVehicle.h:58
long long int NumericalID
Definition: SUMOVehicle.h:60
Definition of vehicle stop (position and duration)
Structure representing possible vehicle parameter.