SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MSVehicle.h
Go to the documentation of this file.
1 /****************************************************************************/
15 // Representation of a vehicle in the micro simulation
16 /****************************************************************************/
17 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
18 // Copyright (C) 2001-2013 DLR (http://www.dlr.de/) and contributors
19 /****************************************************************************/
20 //
21 // This file is part of SUMO.
22 // SUMO is free software: you can redistribute it and/or modify
23 // it under the terms of the GNU General Public License as published by
24 // the Free Software Foundation, either version 3 of the License, or
25 // (at your option) any later version.
26 //
27 /****************************************************************************/
28 #ifndef MSVehicle_h
29 #define MSVehicle_h
30 
31 
32 // ===========================================================================
33 // included modules
34 // ===========================================================================
35 #ifdef _MSC_VER
36 #include <windows_config.h>
37 #else
38 #include <config.h>
39 #endif
40 
41 #include <list>
42 #include <deque>
43 #include <map>
44 #include <set>
45 #include <string>
46 #include <vector>
47 #include "MSVehicleType.h"
48 #include "MSBaseVehicle.h"
49 #include "MSLink.h"
50 #include "MSLane.h"
51 
52 
53 // ===========================================================================
54 // class declarations
55 // ===========================================================================
56 class SUMOSAXAttributes;
57 class MSMoveReminder;
58 class MSLaneChanger;
59 class MSVehicleTransfer;
61 class MSBusStop;
62 class MSPerson;
63 class MSDevice;
65 class OutputDevice;
66 class Position;
67 class MSDevice_Person;
68 
69 
70 // ===========================================================================
71 // class definitions
72 // ===========================================================================
77 class MSVehicle : public MSBaseVehicle {
78 public:
79 
81  friend class MSLaneChanger;
82 
86  class State {
88  friend class MSVehicle;
89  friend class MSLaneChanger;
90 
91  public:
94 
96  State(const State& state);
97 
99  State& operator=(const State& state);
100 
102  bool operator!=(const State& state);
103 
105  SUMOReal pos() const;
106 
108  SUMOReal speed() const {
109  return mySpeed;
110  };
111 
112  private:
114  SUMOReal myPos;
115 
118 
119  };
120 
121 
134  };
135 
143  MSVehicle(SUMOVehicleParameter* pars, const MSRoute* route,
144  const MSVehicleType* type, SUMOReal speedFactor);
145 
147  virtual ~MSVehicle();
148 
149 
150 
152 
153 
163 
164 
165 
167 
168 
172  bool hasArrived() const;
173 
182  bool replaceRoute(const MSRoute* route, bool onInit = false);
183 
184 
190  bool willPass(const MSEdge* const edge) const;
191 
192  unsigned int getRoutePosition() const;
193  void resetRoutePosition(unsigned int index);
194 
203 
204 
212  static inline SUMOReal gap(SUMOReal predPos, SUMOReal predLength, SUMOReal pos) {
213  return predPos - predLength - pos;
214  }
215 
216 
217 
219 
220 
238  void workOnMoveReminders(SUMOReal oldPos, SUMOReal newPos, SUMOReal newSpeed);
240 
241 
259  void planMove(const SUMOTime t, const MSVehicle* pred, const SUMOReal lengthsInFront);
260 
261 
274  bool executeMove();
275 
276 
278 
279 
284  return myState.myPos;
285  }
286 
287 
291  SUMOReal getSpeed() const {
292  return myState.mySpeed;
293  }
294 
295 
300  return myAcceleration;
301  }
303 
304 
305 
307 
308 
316  Position getPosition(const SUMOReal offset = 0) const;
317 
318 
322  MSLane* getLane() const {
323  return myLane;
324  }
325 
326 
330  inline bool isOnRoad() const {
331  return myAmOnNet;
332  }
333 
334 
342  return myWaitingTime;
343  }
344 
345 
353  return STEPS2TIME(myWaitingTime);
354  }
355 
356 
360  SUMOReal getAngle() const;
362 
363 
365  static bool overlap(const MSVehicle* veh1, const MSVehicle* veh2) {
366  if (veh1->myState.myPos < veh2->myState.myPos) {
367  return veh2->myState.myPos - veh2->getVehicleType().getLengthWithGap() < veh1->myState.myPos;
368  }
369  return veh1->myState.myPos - veh1->getVehicleType().getLengthWithGap() < veh2->myState.myPos;
370  }
371 
372 
375  bool congested() const {
376  return myState.mySpeed < SUMOReal(60) / SUMOReal(3.6);
377  }
378 
379 
391 
398  bool enterLaneAtMove(MSLane* enteredLane, bool onTeleporting = false);
399 
400 
401 
409  void enterLaneAtInsertion(MSLane* enteredLane, SUMOReal pos, SUMOReal speed,
410  MSMoveReminder::Notification notification);
411 
412 
417  void enterLaneAtLaneChange(MSLane* enteredLane);
418 
419 
421  void leaveLane(const MSMoveReminder::Notification reason);
422 
423 
426 
429 
433  struct LaneQ {
447  std::vector<MSLane*> bestContinuations;
448  };
449 
468  virtual const std::vector<LaneQ>& getBestLanes(bool forceRebuild = false, MSLane* startLane = 0) const;
469 
470 
475  const std::vector<MSLane*>& getBestLanesContinuation() const;
476 
481  const std::vector<MSLane*>& getBestLanesContinuation(const MSLane* const l) const;
482 
484  int getBestLaneOffset() const;
485 
487 
489  bool fixPosition();
490 
491 
500  void replaceVehicleType(MSVehicleType* type);
501 
502 
510  inline const MSCFModel& getCarFollowModel() const {
511  return myType->getCarFollowModel();
512  }
513 
514 
520  return myCFVariables;
521  }
522 
523 
525 
526 
530  struct Stop {
534  const MSLane* lane;
546  bool triggered;
548  bool parking;
550  bool reached;
552  std::set<std::string> awaitedPersons;
553  };
554 
555 
562  bool addStop(const SUMOVehicleParameter::Stop& stopPar, SUMOTime untilOffset = 0);
563 
564 
568  bool hasStops() const {
569  return !myStops.empty();
570  }
571 
575  bool isStopped() const;
576 
580  bool isParking() const;
581 
582 
586  bool isStoppedTriggered() const;
588 
589  bool knowsEdgeTest(MSEdge& edge) const;
590  unsigned int getLaneIndex() const;
591 
601  SUMOReal getDistanceToPosition(SUMOReal destPos, const MSEdge* destEdge);
602 
603 
610  SUMOReal processNextStop(SUMOReal currentVelocity);
611 
612 
614 
615 
620 
621 
626 
627 
632 
633 
638 
639 
644 
645 
650 
651 
657 
658 
659 
661 
662 
666  void addPerson(MSPerson* person);
667 
668 
672  unsigned int getPersonNumber() const;
673 
675  SUMOReal getImpatience() const;
676 
679 
683  enum Signalling {
714  };
715 
716 
722  LC_NEVER = 0, // lcModel shall never trigger changes at this level
723  LC_NOCONFLICT = 1, // lcModel may trigger changes if not in conflict with TraCI request
724  LC_ALWAYS = 2 // lcModel may always trigger changes of this level regardless of requests
725  };
726 
727 
730  LCP_ALWAYS = 0, // change regardless of blockers, adapt own speed and speed of blockers
731  LCP_NOOVERLAP = 1, // change unless overlapping with blockers, adapt own speed and speed of blockers
732  LCP_URGENT = 2, // change if not blocked, adapt own speed and speed of blockers
733  LCP_OPPORTUNISTIC = 3 // change if not blocked
734  };
735 
736 
740  void switchOnSignal(int signal) {
741  mySignals |= signal;
742  }
743 
744 
748  void switchOffSignal(int signal) {
749  mySignals &= ~signal;
750  }
751 
752 
756  int getSignals() const {
757  return mySignals;
758  }
759 
760 
765  bool signalSet(int which) const {
766  return (mySignals & which) != 0;
767  }
769 
770 
771 #ifndef NO_TRACI
772 
780 
791  bool addTraciStop(MSLane* lane, SUMOReal pos, SUMOReal radius, SUMOTime duration, bool parking, bool triggered);
792 
797  Stop& getNextStop();
798 
803  bool resumeFromStopping();
804 
805 
818  class Influencer {
819  public:
821  Influencer();
822 
823 
825  ~Influencer();
826 
827 
831  void setSpeedTimeLine(const std::vector<std::pair<SUMOTime, SUMOReal> >& speedTimeLine);
832 
833 
837  void setLaneTimeLine(const std::vector<std::pair<SUMOTime, unsigned int> >& laneTimeLine);
838 
839 
851  SUMOReal influenceSpeed(SUMOTime currentTime, SUMOReal speed, SUMOReal vSafe, SUMOReal vMin, SUMOReal vMax);
852 
860  int influenceChangeDecision(const SUMOTime currentTime, const MSEdge& currentEdge, const unsigned int currentLaneIndex, int state);
861 
862 
868  SUMOReal changeRequestRemainingSeconds(const SUMOTime currentTime) const;
869 
873  void setConsiderSafeVelocity(bool value);
874 
875 
879  void setConsiderMaxAcceleration(bool value);
880 
881 
885  void setConsiderMaxDeceleration(bool value);
886 
887 
891  void setLaneChangeMode(int value);
892 
893 
898  return myOriginalSpeed;
899  }
900 
901  void setVTDControlled(bool c, MSLane* l, SUMOReal pos, int edgeOffset, const MSEdgeVector& route) {
902  myAmVTDControlled = c;
903  myVTDLane = l;
904  myVTDPos = pos;
905  myVTDEdgeOffset = edgeOffset;
906  myVTDRoute = route;
907  }
908 
909  void postProcessVTD(MSVehicle* v);
910 
911  inline bool isVTDControlled() const {
912  return myAmVTDControlled;
913  }
914 
915  private:
917  std::vector<std::pair<SUMOTime, SUMOReal> > mySpeedTimeLine;
918 
920  std::vector<std::pair<SUMOTime, unsigned int> > myLaneTimeLine;
921 
924 
927 
930 
933 
936 
942 
944 
956 
957  };
958 
959 
966 
967  bool hasInfluencer() const {
968  return myInfluencer != 0;
969  }
970 
972  int influenceChangeDecision(int state);
973 
974 
975 #endif
976 
978 
979 
981  void saveState(OutputDevice& out);
982 
985  void loadState(const SUMOSAXAttributes& attrs, const SUMOTime offset);
987 
988 protected:
989 
990  SUMOReal getSpaceTillLastStanding(const MSLane* l, bool& foundStopped) const;
991 
994 
1010  void adaptLaneEntering2MoveReminder(const MSLane& enteredLane);
1012 
1013 
1014 
1015  void setBlinkerInformation();
1016 
1017 
1020 
1023 
1026 
1028 
1029  mutable const MSEdge* myLastBestLanesEdge;
1031 
1032  mutable std::vector<std::vector<LaneQ> > myBestLanes;
1033  mutable std::vector<LaneQ>::iterator myCurrentLaneInBestLanes;
1034  static std::vector<MSLane*> myEmptyLaneVector;
1035 
1037  std::list<Stop> myStops;
1038 
1041 
1044 
1046  std::vector<MSLane*> myFurtherLanes;
1047 
1050 
1053 
1056 
1058 
1060 
1061 protected:
1075 
1076  DriveProcessItem(MSLink* link, SUMOReal vPass, SUMOReal vWait, bool setRequest,
1077  SUMOTime arrivalTime, SUMOReal arrivalSpeed,
1078  SUMOTime arrivalTimeBraking, SUMOReal arrivalSpeedBraking,
1079  SUMOReal distance,
1080  SUMOReal leaveSpeed = -1.) :
1081  myLink(link), myVLinkPass(vPass), myVLinkWait(vWait), mySetRequest(setRequest),
1082  myArrivalTime(arrivalTime), myArrivalSpeed(arrivalSpeed),
1083  myArrivalTimeBraking(arrivalTimeBraking), myArrivalSpeedBraking(arrivalSpeedBraking),
1084  myDistance(distance),
1085  accelV(leaveSpeed), hadVehicle(false), availableSpace(-1.) {
1086  assert(vWait >= 0);
1087  assert(vPass >= 0);
1088  };
1089 
1092  myLink(0), myVLinkPass(vWait), myVLinkWait(vWait), mySetRequest(false),
1095  myDistance(distance),
1096  accelV(-1), hadVehicle(false), availableSpace(-1.) {
1097  assert(vWait >= 0);
1098  };
1099 
1100 
1101  inline void adaptLeaveSpeed(const SUMOReal v) {
1102  if (accelV < 0) {
1103  accelV = v;
1104  } else {
1105  accelV = MIN2(accelV, v);
1106  }
1107  }
1108  inline SUMOReal getLeaveSpeed() const {
1109  return accelV < 0 ? myVLinkPass : accelV;
1110  }
1111  };
1112 
1113  typedef std::vector< DriveProcessItem > DriveItemVector;
1114 
1117 
1118  void planMoveInternal(const SUMOTime t, const MSVehicle* pred, DriveItemVector& lfLinks) const;
1119  void checkRewindLinkLanes(const SUMOReal lengthsInFront, DriveItemVector& lfLinks) const;
1120 
1122  inline SUMOReal estimateLeaveSpeed(const MSLink* const link, const SUMOReal vLinkPass) const {
1123  // estimate leave speed for passing time computation
1124  // l=linkLength, a=accel, t=continuousTime, v=vLeave
1125  // l=v*t + 0.5*a*t^2, solve for t and multiply with a, then add v
1126  return MIN2(link->getViaLaneOrLane()->getVehicleMaxSpeed(this),
1128  }
1129 
1130  /* @brief estimate speed while accelerating for the given distance
1131  * @param[in] dist The distance during which accelerating takes place
1132  * @param[in] v The initial speed
1133  * @param[in] accel The acceleration
1134  */
1135  inline SUMOReal estimateSpeedAfterDistance(const SUMOReal dist, const SUMOReal v, const SUMOReal accel) const {
1136  // dist=v*t + 0.5*accel*t^2, solve for t and multiply with accel, then add v
1137  return MIN2(getVehicleType().getMaxSpeed(),
1138  (SUMOReal)sqrt(2 * dist * accel + v * v));
1139  }
1140 
1141 
1142  /* @brief estimate speed while accelerating for the given distance
1143  * @param[in] leaderInfo The leading vehicle and the (virtual) distance to it
1144  * @param[in] seen the distance to the end of the current lane
1145  * @param[in] lastLink the lastLink index
1146  * @param[in] lane The current Lane the vehicle is on
1147  * @param[in,out] the safe velocity for driving
1148  * @param[in,out] the safe velocity for arriving at the next link
1149  */
1150  void adaptToLeader(const std::pair<const MSVehicle*, SUMOReal> leaderInfo,
1151  const SUMOReal seen, DriveProcessItem* const lastLink,
1152  const MSLane* const lane, SUMOReal& v, SUMOReal& vLinkPass) const;
1153 
1154 #ifdef HAVE_INTERNAL_LANES
1155  mutable std::set<std::string> myLinkLeaders;
1157 #endif
1158 
1159 private:
1160  /* @brief The vehicle's knowledge about edge efforts/travel times; @see MSEdgeWeightsStorage
1161  * @note member is initialized on first access */
1163 
1166 
1167 #ifndef NO_TRACI
1170 #endif
1171 
1172 private:
1174  MSVehicle();
1175 
1177  MSVehicle(const MSVehicle&);
1178 
1180  MSVehicle& operator=(const MSVehicle&);
1181 
1183 
1184 };
1185 
1186 
1187 #endif
1188 
1189 /****************************************************************************/
1190 
void resetRoutePosition(unsigned int index)
Definition: MSVehicle.cpp:502
bool signalSet(int which) const
Returns whether the given signal is on.
Definition: MSVehicle.h:765
const MSLane * myLastBestLanesInternalLane
Definition: MSVehicle.h:1030
virtual const std::vector< LaneQ > & getBestLanes(bool forceRebuild=false, MSLane *startLane=0) const
Returns the description of best lanes to use in order to continue the route.
Definition: MSVehicle.cpp:1673
const MSVehicleType * myType
This Vehicle&#39;s type.
void replaceVehicleType(MSVehicleType *type)
Replaces the current vehicle type by the one given.
Definition: MSVehicle.cpp:2119
bool enterLaneAtMove(MSLane *enteredLane, bool onTeleporting=false)
Update when the vehicle enters a new lane in the move step.
Definition: MSVehicle.cpp:1514
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:77
SUMOReal speed() const
Speed of this state.
Definition: MSVehicle.h:108
MSEdgeWeightsStorage * myEdgeWeights
Definition: MSVehicle.h:1162
SUMOReal getHBEFA_HCEmissions() const
Returns HC emission of the current state.
Definition: MSVehicle.cpp:2028
const MSEdge * myLastBestLanesEdge
Definition: MSVehicle.h:1029
LaneChangeMode
modes for resolving conflicts between external control (traci) and vehicle control over lane changing...
Definition: MSVehicle.h:721
MSAbstractLaneChangeModel * myLaneChangeModel
Definition: MSVehicle.h:1027
bool myAmOnNet
Whether the vehicle is on the network (not parking, teleported, vaporized, or arrived) ...
Definition: MSVehicle.h:1052
SUMOReal getImpatience() const
Returns this vehicles impatience.
Definition: MSVehicle.cpp:2134
LaneChangeMode myRightDriveLC
changing to the rightmost lane
Definition: MSVehicle.h:952
std::vector< std::vector< LaneQ > > myBestLanes
Definition: MSVehicle.h:1032
const MSCFModel & getCarFollowModel() const
Returns the vehicle&#39;s car following model definition.
Definition: MSVehicle.h:510
std::vector< MSLane * > myFurtherLanes
The information into which lanes the vehicle laps into.
Definition: MSVehicle.h:1046
State myState
This Vehicles driving state (pos and speed)
Definition: MSVehicle.h:1022
Stop & getNextStop()
Definition: MSVehicle.cpp:2181
SUMOReal getMaxSpeed() const
Returns the maximum speed.
DriveItemVector myLFLinkLanes
Container for used Links/visited Lanes during lookForward.
Definition: MSVehicle.h:1116
SUMOReal pos() const
Position of this state.
Definition: MSVehicle.cpp:133
bool resumeFromStopping()
Definition: MSVehicle.cpp:2170
bool myAmRegisteredAsWaitingForPerson
Whether this vehicle is registered as waiting for a person (for deadlock-recognition) ...
Definition: MSVehicle.h:1055
bool hasInfluencer() const
Definition: MSVehicle.h:967
SUMOReal getLengthWithGap() const
Get vehicle&#39;s length including the minimum gap [m].
int bestLaneOffset
The (signed) number of lanes to be crossed to get to the lane which allows to continue the drive...
Definition: MSVehicle.h:443
void setBlinkerInformation()
Definition: MSVehicle.cpp:2088
SUMOReal getHBEFA_NOxEmissions() const
Returns NOx emission of the current state.
Definition: MSVehicle.cpp:2034
SUMOReal getLeaveSpeed() const
Definition: MSVehicle.h:1108
SUMOReal myAcceleration
The current acceleration after dawdling in m/s.
Definition: MSVehicle.h:1043
MSEdgeVector::const_iterator MSRouteIterator
Definition: MSRoute.h:59
SUMOReal getSpeedWithoutTraciInfluence() const
Returns the uninfluenced velocity.
Definition: MSVehicle.cpp:2196
bool isVTDControlled() const
Definition: MSVehicle.h:911
SUMOTime getWaitingTime() const
Returns the SUMOTime waited (speed was lesser than 0.1m/s)
Definition: MSVehicle.h:341
bool congested() const
Definition: MSVehicle.h:375
The front lights are on (no visualisation)
Definition: MSVehicle.h:695
Signalling
Some boolean values which describe the state of some vehicle parts.
Definition: MSVehicle.h:683
Position getPosition(const SUMOReal offset=0) const
Return current position (x/y, cartesian)
Definition: MSVehicle.cpp:577
bool hasArrived() const
Returns whether this vehicle has already arived (reached the arrivalPosition on its final edge) ...
Definition: MSVehicle.cpp:442
The car-following model abstraction.
Definition: MSCFModel.h:58
bool myConsiderMaxAcceleration
Whether the maximum acceleration shall be regarded.
Definition: MSVehicle.h:932
State(SUMOReal pos, SUMOReal speed)
Constructor.
Definition: MSVehicle.cpp:138
The high beam lights are on (no visualisation)
Definition: MSVehicle.h:699
Notification
Definition of a vehicle state.
Changes the wished vehicle speed / lanes.
Definition: MSVehicle.h:818
bool reached
Information whether the stop has been reached.
Definition: MSVehicle.h:550
State & operator=(const State &state)
Assignment operator.
Definition: MSVehicle.cpp:118
The backwards driving lights are on (no visualisation)
Definition: MSVehicle.h:701
vehicle doesn&#39;t want to change
Definition: MSVehicle.h:127
unsigned int getPersonNumber() const
Returns the number of persons.
Definition: MSVehicle.cpp:2081
TraciLaneChangePriority
modes for prioritizing traci lane change requests
Definition: MSVehicle.h:729
void postProcessVTD(MSVehicle *v)
Definition: MSVehicle.cpp:328
SUMOReal estimateLeaveSpeed(const MSLink *const link, const SUMOReal vLinkPass) const
estimate leaving speed when accelerating across a link
Definition: MSVehicle.h:1122
SUMOReal mySpeed
the stored speed
Definition: MSVehicle.h:117
Definition of vehicle stop (position and duration)
Definition: MSVehicle.h:530
bool executeMove()
Executes planned vehicle movements with regards to right-of-way.
Definition: MSVehicle.cpp:1071
SUMOReal getPositionOnLane() const
Get the vehicle&#39;s position along the lane.
Definition: MSVehicle.h:283
DriveProcessItem(MSLink *link, SUMOReal vPass, SUMOReal vWait, bool setRequest, SUMOTime arrivalTime, SUMOReal arrivalSpeed, SUMOTime arrivalTimeBraking, SUMOReal arrivalSpeedBraking, SUMOReal distance, SUMOReal leaveSpeed=-1.)
Definition: MSVehicle.h:1076
The base class for microscopic and mesoscopic vehicles.
Definition: MSBaseVehicle.h:57
bool myHaveToWaitOnNextLink
Definition: MSVehicle.h:1057
SUMOReal processNextStop(SUMOReal currentVelocity)
Processes stops, returns the velocity needed to reach the stop.
Definition: MSVehicle.cpp:719
A storage for edge travel times and efforts.
bool hasStops() const
Returns whether the vehicle has to stop somewhere.
Definition: MSVehicle.h:568
SUMOReal length
The overall length which may be driven when using this lane without a lane change.
Definition: MSVehicle.h:437
int influenceChangeDecision(const SUMOTime currentTime, const MSEdge &currentEdge, const unsigned int currentLaneIndex, int state)
Applies stored LaneChangeMode information and laneTimeLine.
Definition: MSVehicle.cpp:210
void enterLaneAtLaneChange(MSLane *enteredLane)
Update when the vehicle enters a new lane in the laneChange step.
Definition: MSVehicle.cpp:1546
The car-following model and parameter.
Definition: MSVehicleType.h:74
bool triggered
whether an arriving person lets the vehicle continue
Definition: MSVehicle.h:546
MSAbstractLaneChangeModel & getLaneChangeModel()
Definition: MSVehicle.cpp:1661
MSCFModel::VehicleVariables * myCFVariables
The per vehicle variables of the car following model.
Definition: MSVehicle.h:1165
const MSCFModel & getCarFollowModel() const
Returns the vehicle type&#39;s car following model definition (const version)
Right blinker lights are switched on.
Definition: MSVehicle.h:687
SUMOReal nextOccupation
As occupation, but without the first lane.
Definition: MSVehicle.h:441
void enterLaneAtInsertion(MSLane *enteredLane, SUMOReal pos, SUMOReal speed, MSMoveReminder::Notification notification)
Update when the vehicle enters a new lane in the emit step.
Definition: MSVehicle.cpp:1598
SUMOReal influenceSpeed(SUMOTime currentTime, SUMOReal speed, SUMOReal vSafe, SUMOReal vMin, SUMOReal vMax)
Applies stored velocity information on the speed to use.
Definition: MSVehicle.cpp:177
bool operator!=(const State &state)
Operator !=.
Definition: MSVehicle.cpp:126
Performs lane changing of vehicles.
Definition: MSLaneChanger.h:54
A road/street connecting two junctions.
Definition: MSEdge.h:73
MSLane * lane
The described lane.
Definition: MSVehicle.h:435
void checkRewindLinkLanes(const SUMOReal lengthsInFront, DriveItemVector &lfLinks) const
Definition: MSVehicle.cpp:1324
Left blinker lights are switched on.
Definition: MSVehicle.h:689
SUMOReal getHBEFA_COEmissions() const
Returns CO emission of the current state.
Definition: MSVehicle.cpp:2022
DriveProcessItem(SUMOReal vWait, SUMOReal distance)
constructor if the link shall not be passed
Definition: MSVehicle.h:1091
The wipers are on.
Definition: MSVehicle.h:703
void workOnMoveReminders(SUMOReal oldPos, SUMOReal newPos, SUMOReal newSpeed)
Processes active move reminder.
Definition: MSVehicle.cpp:533
vehicle want&#39;s to change to right lane
Definition: MSVehicle.h:131
bool addTraciStop(MSLane *lane, SUMOReal pos, SUMOReal radius, SUMOTime duration, bool parking, bool triggered)
Definition: MSVehicle.cpp:2142
Encapsulated SAX-Attributes.
std::vector< const MSEdge * > MSEdgeVector
Definition: MSPerson.h:53
bool replaceRoute(const MSRoute *route, bool onInit=false)
Replaces the current route by the given one.
Definition: MSVehicle.cpp:448
void setLaneTimeLine(const std::vector< std::pair< SUMOTime, unsigned int > > &laneTimeLine)
Sets a new lane timeline.
Definition: MSVehicle.cpp:171
ChangeRequest
Requests set via TraCI.
Definition: MSVehicle.h:125
const std::vector< MSLane * > & getBestLanesContinuation() const
Returns the subpart of best lanes that describes the vehicle&#39;s current lane and their successors...
Definition: MSVehicle.cpp:1946
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:46
TraciLaneChangePriority myTraciLaneChangePriority
flags for determining the priority of traci lane change requests
Definition: MSVehicle.h:955
bool willPass(const MSEdge *const edge) const
Returns whether the vehicle wil pass the given edge.
Definition: MSVehicle.cpp:490
A lane area vehicles can halt at.
Definition: MSBusStop.h:63
Position myCachedPosition
Definition: MSVehicle.h:1059
const MSLane * lane
The lane to stop at.
Definition: MSVehicle.h:534
static SUMOReal gap(SUMOReal predPos, SUMOReal predLength, SUMOReal pos)
Uses the given values to compute the brutto-gap.
Definition: MSVehicle.h:212
SUMOReal myOriginalSpeed
The velocity before influence.
Definition: MSVehicle.h:923
std::list< Stop > myStops
The vehicle&#39;s list of stops.
Definition: MSVehicle.h:1037
bool isStopped() const
Returns whether the vehicle is at a stop.
Definition: MSVehicle.cpp:701
void setVTDControlled(bool c, MSLane *l, SUMOReal pos, int edgeOffset, const MSEdgeVector &route)
Definition: MSVehicle.h:901
bool myConsiderMaxDeceleration
Whether the maximum deceleration shall be regarded.
Definition: MSVehicle.h:935
#define STEPS2TIME(x)
Definition: SUMOTime.h:65
void adaptLeaveSpeed(const SUMOReal v)
Definition: MSVehicle.h:1101
MSLane * myLane
The lane the vehicle is on.
Definition: MSVehicle.h:1025
Blinker lights on both sides are switched on.
Definition: MSVehicle.h:691
Influencer * myInfluencer
An instance of a velicty/lane influencing instance; built in &quot;getInfluencer&quot;.
Definition: MSVehicle.h:1169
std::vector< LaneQ >::iterator myCurrentLaneInBestLanes
Definition: MSVehicle.h:1033
SUMOReal getSpaceTillLastStanding(const MSLane *l, bool &foundStopped) const
Definition: MSVehicle.cpp:1306
SUMOTime duration
The stopping duration.
Definition: MSVehicle.h:542
MSVehicle()
invalidated default constructor
T MIN2(T a, T b)
Definition: StdDefs.h:57
SUMOReal getHBEFA_PMxEmissions() const
Returns PMx emission of the current state.
Definition: MSVehicle.cpp:2040
The brake lights are on.
Definition: MSVehicle.h:693
SUMOReal estimateSpeedAfterDistance(const SUMOReal dist, const SUMOReal v, const SUMOReal accel) const
Definition: MSVehicle.h:1135
A blue emergency light is on.
Definition: MSVehicle.h:709
A structure representing the best lanes for continuing the route.
Definition: MSVehicle.h:433
void loadState(const SUMOSAXAttributes &attrs, const SUMOTime offset)
Loads the state of this vehicle from the given description.
Definition: MSVehicle.cpp:2233
Everything is switched off.
Definition: MSVehicle.h:685
void onRemovalFromNet(const MSMoveReminder::Notification reason)
Called when the vehicle is removed from the network.
Definition: MSVehicle.cpp:429
Something on a lane to be noticed about vehicle movement.
SUMOReal changeRequestRemainingSeconds(const SUMOTime currentTime) const
Return the remaining number of seconds of the current laneTimeLine assuming one exists.
Definition: MSVehicle.cpp:292
bool addStop(const SUMOVehicleParameter::Stop &stopPar, SUMOTime untilOffset=0)
Adds a stop.
Definition: MSVehicle.cpp:622
SUMOTime myWaitingTime
The time the vehicle waits (is not faster than 0.1m/s) in seconds.
Definition: MSVehicle.h:1019
One of the left doors is opened.
Definition: MSVehicle.h:705
LaneChangeMode mySpeedGainLC
lane changing to travel with higher speed
Definition: MSVehicle.h:950
bool isParking() const
Returns whether the vehicle is parking.
Definition: MSVehicle.cpp:707
LaneChangeMode myCooperativeLC
lane changing with the intent to help other vehicles
Definition: MSVehicle.h:948
bool knowsEdgeTest(MSEdge &edge) const
bool allowsContinuation
Whether this lane allows to continue the drive.
Definition: MSVehicle.h:445
SUMOReal getHarmonoise_NoiseEmissions() const
Returns noise emissions of the current state.
Definition: MSVehicle.cpp:2052
Container that holds the vehicles driving state (position+speed).
Definition: MSVehicle.h:86
void saveState(OutputDevice &out)
Saves the states of a vehicle.
Definition: MSVehicle.cpp:2219
void planMoveInternal(const SUMOTime t, const MSVehicle *pred, DriveItemVector &lfLinks) const
Definition: MSVehicle.cpp:818
SUMOReal getOriginalSpeed() const
Returns the originally longitudinal speed to use.
Definition: MSVehicle.h:897
MSCFModel::VehicleVariables * getCarFollowVariables() const
Returns the vehicle&#39;s car following model variables.
Definition: MSVehicle.h:519
SUMOReal getHBEFA_FuelConsumption() const
Returns fuel consumption of the current state.
Definition: MSVehicle.cpp:2046
MSEdgeWeightsStorage & _getWeightsStorage() const
Definition: MSVehicle.cpp:523
Influencer()
Constructor.
Definition: MSVehicle.cpp:146
MSEdgeVector myVTDRoute
Definition: MSVehicle.h:941
void leaveLane(const MSMoveReminder::Notification reason)
Update of members if vehicle leaves a new lane in the lane change step or at arrival.
Definition: MSVehicle.cpp:1630
SUMOReal getMaxAccel() const
Get the vehicle type&#39;s maximum acceleration [m/s^2].
Definition: MSCFModel.h:157
Abstract in-vehicle device.
Definition: MSDevice.h:68
vehicle want&#39;s to change to left lane
Definition: MSVehicle.h:129
~Influencer()
Destructor.
Definition: MSVehicle.cpp:160
void setSpeedTimeLine(const std::vector< std::pair< SUMOTime, SUMOReal > > &speedTimeLine)
Sets a new velocity timeline.
Definition: MSVehicle.cpp:164
MSVehicle & operator=(const MSVehicle &)
invalidated assignment operator
Influencer & getInfluencer()
Returns the velocity/lane influencer.
Definition: MSVehicle.cpp:2187
Structure representing possible vehicle parameter.
Definition of vehicle stop (position and duration)
std::vector< std::pair< SUMOTime, SUMOReal > > mySpeedTimeLine
The velocity time line to apply.
Definition: MSVehicle.h:917
void setConsiderMaxDeceleration(bool value)
Sets whether the maximum deceleration shall be regarded.
Definition: MSVehicle.cpp:322
bool fixPosition()
repair errors in vehicle position after changing between internal edges
Definition: MSVehicle.cpp:1984
SUMOReal occupation
The overall vehicle sum on consecutive lanes which can be passed without a lane change.
Definition: MSVehicle.h:439
SUMOReal getAcceleration() const
Returns the vehicle&#39;s acceleration in m/s.
Definition: MSVehicle.h:299
int mySignals
State of things of the vehicle that can be on or off.
Definition: MSVehicle.h:1049
std::vector< MSLane * > bestContinuations
Consecutive lane that can be followed without a lane change (contribute to length and occupation) ...
Definition: MSVehicle.h:447
Definition of vehicle stop (position and duration)
std::set< std::string > awaitedPersons
IDs of persons the vehicle has to wait for until departing.
Definition: MSVehicle.h:552
const MSVehicleType & getVehicleType() const
Returns the vehicle&#39;s type definition.
Definition: MSBaseVehicle.h:94
SUMOTime until
The time at which the vehicle may continue its journey.
Definition: MSVehicle.h:544
void setConsiderSafeVelocity(bool value)
Sets whether the safe velocity shall be regarded.
Definition: MSVehicle.cpp:300
MSRouteIterator edge
The edge in the route to stop at.
Definition: MSVehicle.h:532
SUMOReal getDistanceToPosition(SUMOReal destPos, const MSEdge *destEdge)
Definition: MSVehicle.cpp:1995
SUMOReal getSpeed() const
Returns the vehicle&#39;s current speed.
Definition: MSVehicle.h:291
int SUMOTime
Definition: SUMOTime.h:43
void adaptToLeader(const std::pair< const MSVehicle *, SUMOReal > leaderInfo, const SUMOReal seen, DriveProcessItem *const lastLink, const MSLane *const lane, SUMOReal &v, SUMOReal &vLinkPass) const
Definition: MSVehicle.cpp:1048
void setLaneChangeMode(int value)
Sets lane changing behavior.
Definition: MSVehicle.cpp:312
SUMOReal myPos
the stored position
Definition: MSVehicle.h:110
SUMOReal getWaitingSeconds() const
Returns the number of seconds waited (speed was lesser than 0.1m/s)
Definition: MSVehicle.h:352
MSBusStop * busstop
(Optional) bus stop if one is assigned to the stop
Definition: MSVehicle.h:536
bool isStoppedTriggered() const
Returns whether the vehicle is on a triggered stop.
Definition: MSVehicle.cpp:713
std::vector< DriveProcessItem > DriveItemVector
Definition: MSVehicle.h:1113
std::vector< std::pair< SUMOTime, unsigned int > > myLaneTimeLine
The lane usage time line to apply.
Definition: MSVehicle.h:920
void planMove(const SUMOTime t, const MSVehicle *pred, const SUMOReal lengthsInFront)
Compute safe velocities for the upcoming lanes based on positions and speeds from the last time step...
Definition: MSVehicle.cpp:810
SUMOReal endPos
The stopping position end.
Definition: MSVehicle.h:540
vehicle want&#39;s to keep the current lane
Definition: MSVehicle.h:133
int getSignals() const
Returns the signals.
Definition: MSVehicle.h:756
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:70
#define SUMOReal
Definition: config.h:215
void switchOffSignal(int signal)
Switches the given signal off.
Definition: MSVehicle.h:748
void switchOnSignal(int signal)
Switches the given signal on.
Definition: MSVehicle.h:740
static std::vector< MSLane * > myEmptyLaneVector
Definition: MSVehicle.h:1034
static bool overlap(const MSVehicle *veh1, const MSVehicle *veh2)
Definition: MSVehicle.h:365
virtual ~MSVehicle()
Destructor.
Definition: MSVehicle.cpp:349
SUMOReal getVehicleMaxSpeed(const SUMOVehicle *const veh) const
Returns the lane&#39;s maximum speed, given a vehicle&#39;s speed limit adaptation.
Definition: MSLane.h:349
bool isOnRoad() const
Returns the information whether the vehicle is on a road (is simulated)
Definition: MSVehicle.h:330
bool mySpeedAdaptationStarted
Whether influencing the speed has already started.
Definition: MSVehicle.h:926
MSLane * getLane() const
Returns the lane the vehicle is on.
Definition: MSVehicle.h:322
int influenceChangeDecision(int state)
allow TraCI to influence a lane change decision
Definition: MSVehicle.cpp:2205
void activateReminders(const MSMoveReminder::Notification reason)
&quot;Activates&quot; all current move reminder
Definition: MSVehicle.cpp:1483
SUMOReal getHBEFA_CO2Emissions() const
Returns CO2 emission of the current state.
Definition: MSVehicle.cpp:2016
void addPerson(MSPerson *person)
Adds a passenger.
Definition: MSVehicle.cpp:2058
SUMOReal startPos
The stopping position start.
Definition: MSVehicle.h:538
A red emergency light is on.
Definition: MSVehicle.h:711
Representation of a lane in the micro simulation.
Definition: MSLane.h:77
const MSEdgeWeightsStorage & getWeightsStorage() const
Returns the vehicle&#39;s internal edge travel times/efforts container.
Definition: MSVehicle.cpp:511
void adaptLaneEntering2MoveReminder(const MSLane &enteredLane)
Adapts the vehicle&#39;s entering of a new lane.
Definition: MSVehicle.cpp:557
LaneChangeMode myStrategicLC
lane changing which is necessary to follow the current route
Definition: MSVehicle.h:946
unsigned int getRoutePosition() const
Definition: MSVehicle.cpp:496
One of the right doors is opened.
Definition: MSVehicle.h:707
Interface for lane-change models.
MSDevice_Person * myPersonDevice
The passengers this vehicle may have.
Definition: MSVehicle.h:1040
int getBestLaneOffset() const
returns the current offset from the best lane
Definition: MSVehicle.cpp:1974
bool myConsiderSafeVelocity
Whether the safe velocity shall be regarded.
Definition: MSVehicle.h:929
void setConsiderMaxAcceleration(bool value)
Sets whether the maximum acceleration shall be regarded.
Definition: MSVehicle.cpp:306
The fog lights are on (no visualisation)
Definition: MSVehicle.h:697
bool parking
whether the vehicle is removed from the net while stopping
Definition: MSVehicle.h:548
SUMOReal getAngle() const
Returns the vehicle&#39;s direction in degrees.
Definition: MSVehicle.cpp:604
A yellow emergency light is on.
Definition: MSVehicle.h:713
unsigned int getLaneIndex() const
Definition: MSVehicle.cpp:2127