SUMO - Simulation of Urban MObility
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.dlr.de/
18 // Copyright (C) 2001-2017 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 "MSGlobals.h"
48 #include "MSVehicleType.h"
49 #include "MSBaseVehicle.h"
50 #include "MSLink.h"
51 #include "MSLane.h"
52 
53 #define INVALID_SPEED 299792458 + 1 // nothing can go faster than the speed of light! Refs. #2577
54 
55 // ===========================================================================
56 // class declarations
57 // ===========================================================================
58 class SUMOSAXAttributes;
59 class MSMoveReminder;
60 class MSLaneChanger;
61 class MSVehicleTransfer;
63 class MSStoppingPlace;
64 class MSChargingStation;
65 class MSParkingArea;
66 class MSPerson;
67 class MSDevice;
69 class OutputDevice;
70 class Position;
72 class MSContainer;
73 class MSJunction;
74 class MSLeaderInfo;
75 
76 // ===========================================================================
77 // class definitions
78 // ===========================================================================
83 class MSVehicle : public MSBaseVehicle {
84 public:
85 
87  friend class MSLaneChanger;
88  friend class MSLaneChangerSublane;
89 
93  class State {
95  friend class MSVehicle;
96  friend class MSLaneChanger;
97  friend class MSLaneChangerSublane;
98 
99  public:
102 
104  State(const State& state);
105 
107  State& operator=(const State& state);
108 
110  bool operator!=(const State& state);
111 
113  SUMOReal pos() const {
114  return myPos;
115  }
116 
118  SUMOReal speed() const {
119  return mySpeed;
120  };
121 
123  SUMOReal posLat() const {
124  return myPosLat;
125  }
126 
128  SUMOReal backPos() const {
129  return myBackPos;
130  }
131 
134  return myLastCoveredDist;
135  }
136 
137 
138  private:
141 
144 
147 
149  // if the vehicle occupies multiple lanes, this is the position relative
150  // to the lane occupied by its back
152 
155 
161 
162  };
163 
164 
169  friend class MSVehicle;
170 
171  typedef std::list<std::pair<SUMOTime, SUMOTime> > waitingIntervalList;
172 
173  public:
176 
179 
182 
184  bool operator!=(const WaitingTimeCollector& wt) const;
185 
188 
189  // return the waiting time within the last memory millisecs
190  SUMOTime cumulatedWaitingTime(SUMOTime memory = -1) const;
191 
192  // process time passing for dt millisecs
193  void passTime(SUMOTime dt, bool waiting);
194 
195  // maximal memory time stored
197  return myMemorySize;
198  }
199 
200  // maximal memory time stored
201  const waitingIntervalList& getWaitingIntervals() const {
202  return myWaitingIntervals;
203  }
204 
205  private:
208 
212  waitingIntervalList myWaitingIntervals;
213 
215  void appendWaitingTime(SUMOTime dt);
216  };
217 
218 
231  };
232 
240  MSVehicle(SUMOVehicleParameter* pars, const MSRoute* route,
241  const MSVehicleType* type, const SUMOReal speedFactor);
242 
244  virtual ~MSVehicle();
245 
246 
248 
249 
259 
260 
261 
263 
264 
268  bool hasArrived() const;
269 
278  bool replaceRoute(const MSRoute* route, bool onInit = false, int offset = 0, bool addStops = true);
279 
280 
286  bool willPass(const MSEdge* const edge) const;
287 
288  int getRoutePosition() const;
289  void resetRoutePosition(int index);
290 
299 
300 
302 
303 
321  void workOnMoveReminders(SUMOReal oldPos, SUMOReal newPos, SUMOReal newSpeed);
323 
324 
342  void planMove(const SUMOTime t, const MSLeaderInfo& ahead, const SUMOReal lengthsInFront);
343 
344 
357  bool executeMove();
358 
359 
367 
368 
370 
371 
376  return myState.myPos;
377  }
378 
383  return myState.lastCoveredDist();
384  }
385 
389  SUMOReal getPositionOnLane(const MSLane* lane) const;
390 
394  SUMOReal getBackPositionOnLane(const MSLane* lane) const;
395 
401  }
402 
408  return myState.myPosLat;
409  }
410 
416 
418  SUMOReal getLateralOverlap() const;
419 
425  SUMOReal getRightSideOnEdge(const MSLane* lane = 0) const;
426 
432  SUMOReal getCenterOnEdge(const MSLane* lane = 0) const;
433 
437  SUMOReal getLatOffset(const MSLane* lane) const;
438 
442  SUMOReal getSpeed() const {
443  return myState.mySpeed;
444  }
445 
446 
451  return myState.myPreviousSpeed;
452  }
453 
454 
460  return myAcceleration;
461  }
463 
464 
465 
467 
468 
472  SUMOReal getSlope() const;
473 
474 
482  Position getPosition(const SUMOReal offset = 0) const;
483 
484 
488  MSLane* getLane() const {
489  return myLane;
490  }
491 
492 
497  SUMOReal
499  if (myLane != 0) {
500  return myLane->getVehicleMaxSpeed(this);
501  } else {
502  return myType->getMaxSpeed();
503  }
504  }
505 
506 
510  inline bool isOnRoad() const {
511  return myAmOnNet;
512  }
513 
514 
518  bool isFrontOnLane(const MSLane* lane) const;
519 
520 
527  const MSEdge* getRerouteOrigin() const;
528 
529 
537  return myWaitingTime;
538  }
539 
550  return myTimeLoss;
551  }
552 
553 
561  }
562 
563 
571  return STEPS2TIME(myWaitingTime);
572  }
573 
574 
582  }
583 
587  return STEPS2TIME(myTimeLoss);
588  }
589 
590 
594  SUMOReal getAngle() const {
595  return myAngle;
596  }
598 
600  SUMOReal computeAngle() const;
601 
603  void setAngle(SUMOReal angle);
604 
606  static bool overlap(const MSVehicle* veh1, const MSVehicle* veh2) {
607  if (veh1->myState.myPos < veh2->myState.myPos) {
608  return veh2->myState.myPos - veh2->getVehicleType().getLengthWithGap() < veh1->myState.myPos;
609  }
610  return veh1->myState.myPos - veh1->getVehicleType().getLengthWithGap() < veh2->myState.myPos;
611  }
612 
613 
616  bool congested() const {
617  return myState.mySpeed < SUMOReal(60) / SUMOReal(3.6);
618  }
619 
620 
632 
639  bool enterLaneAtMove(MSLane* enteredLane, bool onTeleporting = false);
640 
641 
642 
652  MSMoveReminder::Notification notification);
653 
658  void setTentativeLaneAndPosition(MSLane* lane, SUMOReal pos, SUMOReal posLat = 0);
659 
664  void enterLaneAtLaneChange(MSLane* enteredLane);
665 
666 
668  void leaveLane(const MSMoveReminder::Notification reason);
669 
670 
673 
674  const std::vector<MSLane*>& getFurtherLanes() const {
675  return myFurtherLanes;
676  }
677 
678  const std::vector<SUMOReal>& getFurtherLanesPosLat() const {
679  return myFurtherLanesPosLat;
680  }
681 
684 
685  //
689  struct LaneQ {
704  /* @brief Longest sequence of (normal-edge) lanes that can be followed without a lane change
705  * The 'length' attribute is the sum of these lane lengths
706  * (There may be alternative sequences that have equal length)
707  * It is the 'best' in the strategic sense of reducing required lane-changes
708  */
709  std::vector<MSLane*> bestContinuations;
710  };
711 
715  const std::vector<LaneQ>& getBestLanes() const;
716 
734  void updateBestLanes(bool forceRebuild = false, const MSLane* startLane = 0);
735 
736 
740  const std::vector<MSLane*>& getBestLanesContinuation() const;
741 
742 
746  const std::vector<MSLane*>& getBestLanesContinuation(const MSLane* const l) const;
747 
748  /* @brief returns the current signed offset from the lane that is most
749  * suited for continuing the current route (in the strategic sense of reducing lane-changes)
750  * - 0 if the vehicle is one it's best lane
751  * - negative if the vehicle should change to the right
752  * - positive if the vehicle should change to the left
753  */
754  int getBestLaneOffset() const;
755 
757  void adaptBestLanesOccupation(int laneIndex, SUMOReal density);
758 
760 
762  void fixPosition();
763 
764 
773  void replaceVehicleType(MSVehicleType* type);
774 
775 
783  inline const MSCFModel& getCarFollowModel() const {
784  return myType->getCarFollowModel();
785  }
786 
787 
793  return myCFVariables;
794  }
795 
796 
798 
799 
803  struct Stop {
807  const MSLane* lane;
825  bool triggered;
829  bool parking;
831  bool reached;
833  std::set<std::string> awaitedPersons;
835  std::set<std::string> awaitedContainers;
840 
841  void write(OutputDevice& dev) const;
842 
844  SUMOReal getEndPos(const SUMOVehicle& veh) const;
845  };
846 
847 
854  bool addStop(const SUMOVehicleParameter::Stop& stopPar, std::string& errorMsg, SUMOTime untilOffset = 0);
855 
858  bool replaceParkingArea(MSParkingArea* parkingArea, std::string& errorMsg);
859 
860 
864 
868  bool hasStops() const {
869  return !myStops.empty();
870  }
871 
875  bool isStopped() const;
876 
880  bool isParking() const;
881 
885  bool isRemoteControlled() const;
886 
889  return myStopDist;
890  }
891 
895  bool isStoppedTriggered() const;
896 
899  bool isStoppedInRange(SUMOReal pos) const;
901 
902  bool knowsEdgeTest(MSEdge& edge) const;
903  int getLaneIndex() const;
904 
914  SUMOReal getDistanceToPosition(SUMOReal destPos, const MSEdge* destEdge) const;
915 
916 
924  SUMOReal processNextStop(SUMOReal currentVelocity);
925 
933  std::pair<const MSVehicle* const, SUMOReal> getLeader(SUMOReal dist = 0) const;
934 
941  SUMOReal getTimeGapOnLane() const;
942 
943 
945 
946 
950  SUMOReal getCO2Emissions() const;
951 
952 
956  SUMOReal getCOEmissions() const;
957 
958 
962  SUMOReal getHCEmissions() const;
963 
964 
968  SUMOReal getNOxEmissions() const;
969 
970 
974  SUMOReal getPMxEmissions() const;
975 
976 
981 
982 
987 
988 
994 
995 
996 
998 
999 
1003  void addPerson(MSTransportable* person);
1004 
1006 
1007 
1011  void addContainer(MSTransportable* container);
1012 
1015 
1017  const std::vector<MSTransportable*>& getPersons() const;
1018 
1020  const std::vector<MSTransportable*>& getContainers() const;
1021 
1025  int getPersonNumber() const;
1026 
1030  int getContainerNumber() const;
1031 
1034 
1038  enum Signalling {
1069  };
1070 
1071 
1077  LC_NEVER = 0, // lcModel shall never trigger changes at this level
1078  LC_NOCONFLICT = 1, // lcModel may trigger changes if not in conflict with TraCI request
1079  LC_ALWAYS = 2 // lcModel may always trigger changes of this level regardless of requests
1080  };
1081 
1082 
1085  LCP_ALWAYS = 0, // change regardless of blockers, adapt own speed and speed of blockers
1086  LCP_NOOVERLAP = 1, // change unless overlapping with blockers, adapt own speed and speed of blockers
1087  LCP_URGENT = 2, // change if not blocked, adapt own speed and speed of blockers
1088  LCP_OPPORTUNISTIC = 3 // change if not blocked
1089  };
1090 
1091 
1095  void switchOnSignal(int signal) {
1096  mySignals |= signal;
1097  }
1098 
1099 
1103  void switchOffSignal(int signal) {
1104  mySignals &= ~signal;
1105  }
1106 
1107 
1111  int getSignals() const {
1112  return mySignals;
1113  }
1114 
1115 
1120  bool signalSet(int which) const {
1121  return (mySignals & which) != 0;
1122  }
1124 
1125 
1127  bool unsafeLinkAhead(const MSLane* lane) const;
1128 
1129 
1130 #ifndef NO_TRACI
1131 
1139 
1152  bool addTraciStop(MSLane* const lane, const SUMOReal startPos, const SUMOReal endPos, const SUMOTime duration, const SUMOTime until,
1153  const bool parking, const bool triggered, const bool containerTriggered, std::string& errorMsg);
1154 
1166  bool addTraciBusOrContainerStop(const std::string& stopId, const SUMOTime duration, const SUMOTime until, const bool parking,
1167  const bool triggered, const bool containerTriggered, const bool isContainerStop, std::string& errorMsg);
1168 
1173  Stop& getNextStop();
1174 
1179  bool resumeFromStopping();
1180 
1181 
1183  SUMOReal updateFurtherLanes(std::vector<MSLane*>& furtherLanes,
1184  std::vector<SUMOReal>& furtherLanesPosLat,
1185  const std::vector<MSLane*>& passedLanes);
1186 
1189 
1192 
1205  class Influencer {
1206  public:
1208  Influencer();
1209 
1210 
1212  ~Influencer();
1213 
1214 
1218  void setSpeedTimeLine(const std::vector<std::pair<SUMOTime, SUMOReal> >& speedTimeLine);
1219 
1220 
1224  void setLaneTimeLine(const std::vector<std::pair<SUMOTime, int> >& laneTimeLine);
1225 
1227  int getSpeedMode() const;
1228 
1240  SUMOReal influenceSpeed(SUMOTime currentTime, SUMOReal speed, SUMOReal vSafe, SUMOReal vMin, SUMOReal vMax);
1241 
1249  int influenceChangeDecision(const SUMOTime currentTime, const MSEdge& currentEdge, const int currentLaneIndex, int state);
1250 
1251 
1257  SUMOReal changeRequestRemainingSeconds(const SUMOTime currentTime) const;
1258 
1262  inline bool getRespectJunctionPriority() const {
1263  return myRespectJunctionPriority;
1264  }
1265 
1266 
1270  inline bool getEmergencyBrakeRedLight() const {
1271  return myEmergencyBrakeRedLight;
1272  }
1273 
1277  void setSpeedMode(int speedMode);
1278 
1282  void setLaneChangeMode(int value);
1283 
1284 
1288  inline SUMOReal getOriginalSpeed() const {
1289  return myOriginalSpeed;
1290  }
1291 
1292  void setVTDControlled(Position xyPos, MSLane* l, SUMOReal pos, SUMOReal posLat, SUMOReal angle, int edgeOffset, const ConstMSEdgeVector& route, SUMOTime t);
1293 
1295  return myLastVTDAccess;
1296  }
1297 
1298  void postProcessVTD(MSVehicle* v);
1299 
1301  SUMOReal implicitSpeedVTD(const MSVehicle* veh, SUMOReal oldSpeed);
1302 
1304  SUMOReal implicitDeltaPosVTD(const MSVehicle* veh);
1305 
1306  bool isVTDControlled() const;
1307 
1308  bool isVTDAffected(SUMOTime t) const;
1309 
1310  void setSignals(int signals) {
1311  myTraCISignals = signals;
1312  }
1313 
1314  int getSignals() const {
1315  return myTraCISignals;
1316  }
1317 
1318  private:
1320  std::vector<std::pair<SUMOTime, SUMOReal> > mySpeedTimeLine;
1321 
1323  std::vector<std::pair<SUMOTime, int> > myLaneTimeLine;
1324 
1327 
1330 
1333 
1336 
1339 
1342 
1345 
1354 
1356 
1357  LaneChangeMode myStrategicLC;
1368  TraciLaneChangePriority myTraciLaneChangePriority;
1370 
1371  // @brief the signals set via TraCI
1373 
1374  };
1375 
1376 
1383 
1384  const Influencer* getInfluencer() const;
1385 
1386  bool hasInfluencer() const {
1387  return myInfluencer != 0;
1388  }
1389 
1391  int influenceChangeDecision(int state);
1392 
1394  void setVTDState(Position xyPos);
1395 
1397  SUMOReal getSafeFollowSpeed(const std::pair<const MSVehicle*, SUMOReal> leaderInfo,
1398  const SUMOReal seen, const MSLane* const lane, SUMOReal distToCrossing) const;
1399 
1401  static int nextLinkPriority(const std::vector<MSLane*>& conts);
1402 
1403 #endif
1404 
1406 
1407 
1409  void saveState(OutputDevice& out);
1410 
1413  void loadState(const SUMOSAXAttributes& attrs, const SUMOTime offset);
1415 
1416 protected:
1417 
1418  SUMOReal getSpaceTillLastStanding(const MSLane* l, bool& foundStopped) const;
1419 
1422 
1438  void adaptLaneEntering2MoveReminder(const MSLane& enteredLane);
1440 
1441 
1442 
1443  void setBlinkerInformation();
1444 
1447  void setEmergencyBlueLight(SUMOTime currentTime);
1448 
1450  void updateOccupancyAndCurrentBestLane(const MSLane* startLane);
1451 
1454  const ConstMSEdgeVector getStopEdges() const;
1455 
1457  virtual void drawOutsideNetwork(bool /*add*/) {};
1458 
1462 
1465 
1468 
1471 
1473 
1476 
1477  /* @brief Complex data structure for keeping and updating LaneQ:
1478  * Each element of the outer vector corresponds to an upcoming edge on the vehicles route
1479  * The first element corresponds to the current edge and is returned in getBestLanes()
1480  * The other elements are only used as a temporary structure in updateBestLanes();
1481  */
1482  std::vector<std::vector<LaneQ> > myBestLanes;
1483 
1484  /* @brief iterator to speed up retrival of the current lane's LaneQ in getBestLaneOffset() and getBestLanesContinuation()
1485  * This is updated in updateOccupancyAndCurrentBestLane()
1486  */
1487  std::vector<LaneQ>::iterator myCurrentLaneInBestLanes;
1488 
1489  static std::vector<MSLane*> myEmptyLaneVector;
1490  static std::vector<MSTransportable*> myEmptyTransportableVector;
1491 
1493  std::list<Stop> myStops;
1494 
1497 
1500 
1503 
1505  std::vector<MSLane*> myFurtherLanes;
1506  std::vector<SUMOReal> myFurtherLanesPosLat;
1507 
1510 
1513 
1516 
1519 
1521 
1524 
1527 
1529 
1530 protected:
1544 
1545  DriveProcessItem(MSLink* link, SUMOReal vPass, SUMOReal vWait, bool setRequest,
1546  SUMOTime arrivalTime, SUMOReal arrivalSpeed,
1547  SUMOTime arrivalTimeBraking, SUMOReal arrivalSpeedBraking,
1548  SUMOReal distance,
1549  SUMOReal leaveSpeed = -1.) :
1550  myLink(link), myVLinkPass(vPass), myVLinkWait(vWait), mySetRequest(setRequest),
1551  myArrivalTime(arrivalTime), myArrivalSpeed(arrivalSpeed),
1552  myArrivalTimeBraking(arrivalTimeBraking), myArrivalSpeedBraking(arrivalSpeedBraking),
1553  myDistance(distance),
1554  accelV(leaveSpeed), hadVehicle(false), availableSpace(-1.) {
1555  assert(vWait >= 0 || !MSGlobals::gSemiImplicitEulerUpdate);
1556  assert(vPass >= 0 || !MSGlobals::gSemiImplicitEulerUpdate);
1557  };
1558 
1559 
1562  myLink(0), myVLinkPass(vWait), myVLinkWait(vWait), mySetRequest(false),
1563  myArrivalTime(0), myArrivalSpeed(0),
1564  myArrivalTimeBraking(0), myArrivalSpeedBraking(0),
1565  myDistance(distance),
1566  accelV(-1), hadVehicle(false), availableSpace(-1.) {
1567  assert(vWait >= 0 || !MSGlobals::gSemiImplicitEulerUpdate);
1568  };
1569 
1570 
1571  inline void adaptLeaveSpeed(const SUMOReal v) {
1572  if (accelV < 0) {
1573  accelV = v;
1574  } else {
1575  accelV = MIN2(accelV, v);
1576  }
1577  }
1578  inline SUMOReal getLeaveSpeed() const {
1579  return accelV < 0 ? myVLinkPass : accelV;
1580  }
1581  };
1582 
1584  typedef std::vector< DriveProcessItem > DriveItemVector;
1585  DriveItemVector myLFLinkLanes;
1586 
1588  void planMoveInternal(const SUMOTime t, MSLeaderInfo ahead, DriveItemVector& lfLinks, SUMOReal& myStopDist) const;
1589 
1591  void checkRewindLinkLanes(const SUMOReal lengthsInFront, DriveItemVector& lfLinks) const;
1592 
1594  void removeApproachingInformation(DriveItemVector& lfLinks) const;
1595 
1596 
1598  inline SUMOReal estimateLeaveSpeed(const MSLink* const link, const SUMOReal vLinkPass) const {
1599  // estimate leave speed for passing time computation
1600  // l=linkLength, a=accel, t=continuousTime, v=vLeave
1601  // l=v*t + 0.5*a*t^2, solve for t and multiply with a, then add v
1602  return MIN2(link->getViaLaneOrLane()->getVehicleMaxSpeed(this),
1604  }
1605 
1606 
1607  /* @brief adapt safe velocity in accordance to a moving obstacle:
1608  * - a leader vehicle
1609  * - a vehicle or pedestrian that crosses this vehicles path on an upcoming intersection
1610  * @param[in] leaderInfo The leading vehicle and the (virtual) distance to it
1611  * @param[in] seen the distance to the end of the current lane
1612  * @param[in] lastLink the lastLink index
1613  * @param[in] lane The current Lane the vehicle is on
1614  * @param[in,out] the safe velocity for driving
1615  * @param[in,out] the safe velocity for arriving at the next link
1616  * @param[in] distToCrossing The distance to the crossing point with the current leader where relevant or -1
1617  */
1618  void adaptToLeader(const std::pair<const MSVehicle*, SUMOReal> leaderInfo,
1619  const SUMOReal seen, DriveProcessItem* const lastLink,
1620  const MSLane* const lane, SUMOReal& v, SUMOReal& vLinkPass,
1621  SUMOReal distToCrossing = -1) const;
1622 
1623  /* @brief adapt safe velocity in accordance to multiple vehicles ahead:
1624  * @param[in] ahead The leader information according to the current lateral-resolution
1625  * @param[in] latOffset the lateral offset for locating the ego vehicle on the given lane
1626  * @param[in] seen the distance to the end of the current lane
1627  * @param[in] lastLink the lastLink index
1628  * @param[in] lane The current Lane the vehicle is on
1629  * @param[in,out] the safe velocity for driving
1630  * @param[in,out] the safe velocity for arriving at the next link
1631  */
1632  void adaptToLeaders(const MSLeaderInfo& ahead,
1633  SUMOReal latOffset,
1634  const SUMOReal seen, DriveProcessItem* const lastLink,
1635  const MSLane* const lane, SUMOReal& v, SUMOReal& vLinkPass) const;
1636 
1637 
1638  // @brief return the lane on which the back of this vehicle resides
1639  const MSLane* getBackLane() const;
1640 
1641  // @brief get the position of the back bumper;
1642  const Position getBackPosition() const;
1643 
1651  void updateState(SUMOReal vNext);
1652 
1653 private:
1654  /* @brief The vehicle's knowledge about edge efforts/travel times; @see MSEdgeWeightsStorage
1655  * @note member is initialized on first access */
1657 
1660 
1661 #ifndef NO_TRACI
1664 #endif
1665 
1666 private:
1668  MSVehicle();
1669 
1671  MSVehicle(const MSVehicle&);
1672 
1674  MSVehicle& operator=(const MSVehicle&);
1675 
1677 
1678 };
1679 
1680 
1681 #endif
1682 
1683 /****************************************************************************/
1684 
A lane area vehicles can halt at.
Definition: MSParkingArea.h:66
bool signalSet(int which) const
Returns whether the given signal is on.
Definition: MSVehicle.h:1120
void setAngle(SUMOReal angle)
Set a custom vehicle angle in rad.
Definition: MSVehicle.cpp:814
const MSLane * myLastBestLanesInternalLane
Definition: MSVehicle.h:1475
bool isRemoteControlled() const
Returns the information whether the vehicle is fully controlled via TraCI.
Definition: MSVehicle.cpp:3949
const MSVehicleType * myType
This Vehicle&#39;s type.
void replaceVehicleType(MSVehicleType *type)
Replaces the current vehicle type by the one given.
Definition: MSVehicle.cpp:3532
bool enterLaneAtMove(MSLane *enteredLane, bool onTeleporting=false)
Update when the vehicle enters a new lane in the move step.
Definition: MSVehicle.cpp:2689
static int nextLinkPriority(const std::vector< MSLane * > &conts)
get a numerical value for the priority of the upcoming link
Definition: MSVehicle.cpp:3203
std::list< std::pair< SUMOTime, SUMOTime > > waitingIntervalList
Definition: MSVehicle.h:171
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:83
SUMOReal getMaxSpeed() const
Get vehicle&#39;s maximum speed [m/s].
long long int SUMOTime
Definition: SUMOTime.h:43
void planMove(const SUMOTime t, const MSLeaderInfo &ahead, const SUMOReal lengthsInFront)
Compute safe velocities for the upcoming lanes based on positions and speeds from the last time step...
Definition: MSVehicle.cpp:1344
SUMOReal speed() const
Speed of this state.
Definition: MSVehicle.h:118
SUMOTime timeToBoardNextPerson
The time at which the vehicle is able to board another person.
Definition: MSVehicle.h:837
MSEdgeWeightsStorage * myEdgeWeights
Definition: MSVehicle.h:1656
SUMOReal backPos() const
back Position of this state
Definition: MSVehicle.h:128
const MSEdge * myLastBestLanesEdge
Definition: MSVehicle.h:1474
LaneChangeMode
modes for resolving conflicts between external control (traci) and vehicle control over lane changing...
Definition: MSVehicle.h:1076
MSAbstractLaneChangeModel * myLaneChangeModel
Definition: MSVehicle.h:1472
bool myAmOnNet
Whether the vehicle is on the network (not parking, teleported, vaporized, or arrived) ...
Definition: MSVehicle.h:1512
LaneChangeMode myRightDriveLC
changing to the rightmost lane
Definition: MSVehicle.h:1364
std::vector< std::vector< LaneQ > > myBestLanes
Definition: MSVehicle.h:1482
const MSCFModel & getCarFollowModel() const
Returns the vehicle&#39;s car following model definition.
Definition: MSVehicle.h:783
std::vector< MSLane * > myFurtherLanes
The information into which lanes the vehicle laps into.
Definition: MSVehicle.h:1505
State myState
This Vehicles driving state (pos and speed)
Definition: MSVehicle.h:1467
void setTentativeLaneAndPosition(MSLane *lane, SUMOReal pos, SUMOReal posLat=0)
set tentative lane and position during insertion to ensure that all cfmodels work (some of them requi...
Definition: MSVehicle.cpp:3547
SUMOReal getRightSideOnEdge(const MSLane *lane=0) const
Get the vehicle&#39;s lateral position on the edge of the given lane (or its current edge if lane == 0) ...
Definition: MSVehicle.cpp:3563
Stop & getNextStop()
Definition: MSVehicle.cpp:3899
A lane area vehicles can halt at.
bool replaceParkingArea(MSParkingArea *parkingArea, std::string &errorMsg)
replace the current parking area stop with a new stop with merge duration
Definition: MSVehicle.cpp:1018
DriveItemVector myLFLinkLanes
Definition: MSVehicle.h:1585
SUMOReal pos() const
Position of this state.
Definition: MSVehicle.h:113
void enterLaneAtInsertion(MSLane *enteredLane, SUMOReal pos, SUMOReal speed, SUMOReal posLat, MSMoveReminder::Notification notification)
Update when the vehicle enters a new lane in the emit step.
Definition: MSVehicle.cpp:2776
bool resumeFromStopping()
Definition: MSVehicle.cpp:3855
bool myAmRegisteredAsWaitingForPerson
Whether this vehicle is registered as waiting for a person (for deadlock-recognition) ...
Definition: MSVehicle.h:1515
bool hasInfluencer() const
Definition: MSVehicle.h:1386
SUMOTime myLastVTDAccess
Definition: MSVehicle.h:1353
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:701
void setBlinkerInformation()
Definition: MSVehicle.cpp:3481
void addContainer(MSTransportable *container)
Adds a container.
Definition: MSVehicle.cpp:3418
SUMOReal getLeaveSpeed() const
Definition: MSVehicle.h:1578
bool unsafeLinkAhead(const MSLane *lane) const
whether the vehicle may safely move to the given lane with regard to upcoming links ...
Definition: MSVehicle.cpp:3663
SUMOReal myAcceleration
The current acceleration after dawdling in m/s.
Definition: MSVehicle.h:1502
SUMOReal getSpeedWithoutTraciInfluence() const
Returns the uninfluenced velocity.
Definition: MSVehicle.cpp:3920
SUMOTime getWaitingTime() const
Returns the SUMOTime waited (speed was lesser than 0.1m/s)
Definition: MSVehicle.h:536
bool congested() const
Definition: MSVehicle.h:616
The front lights are on (no visualisation)
Definition: MSVehicle.h:1050
Signalling
Some boolean values which describe the state of some vehicle parts.
Definition: MSVehicle.h:1038
Position getPosition(const SUMOReal offset=0) const
Return current position (x/y, cartesian)
Definition: MSVehicle.cpp:767
The base class for an intersection.
Definition: MSJunction.h:64
bool hasArrived() const
Returns whether this vehicle has already arived (reached the arrivalPosition on its final edge) ...
Definition: MSVehicle.cpp:599
The car-following model abstraction.
Definition: MSCFModel.h:60
bool myConsiderMaxAcceleration
Whether the maximum acceleration shall be regarded.
Definition: MSVehicle.h:1335
void updateState(SUMOReal vNext)
updates the vehicles state, given a next value for its speed. This value can be negative in case of t...
Definition: MSVehicle.cpp:2251
The high beam lights are on (no visualisation)
Definition: MSVehicle.h:1054
Notification
Definition of a vehicle state.
MSDevice_Transportable * myPersonDevice
The passengers this vehicle may have.
Definition: MSVehicle.h:1496
SUMOReal currentLength
The length which may be driven on this lane.
Definition: MSVehicle.h:695
Changes the wished vehicle speed / lanes.
Definition: MSVehicle.h:1205
SUMOReal getHCEmissions() const
Returns HC emission of the current state.
Definition: MSVehicle.cpp:3360
bool myRespectJunctionPriority
Whether the junction priority rules are respected.
Definition: MSVehicle.h:1341
bool reached
Information whether the stop has been reached.
Definition: MSVehicle.h:831
const MSLane * getBackLane() const
Definition: MSVehicle.cpp:2298
State & operator=(const State &state)
Assignment operator.
Definition: MSVehicle.cpp:128
bool replaceRoute(const MSRoute *route, bool onInit=false, int offset=0, bool addStops=true)
Replaces the current route by the given one.
Definition: MSVehicle.cpp:608
The backwards driving lights are on (no visualisation)
Definition: MSVehicle.h:1056
vehicle doesn&#39;t want to change
Definition: MSVehicle.h:224
TraciLaneChangePriority
modes for prioritizing traci lane change requests
Definition: MSVehicle.h:1084
SUMOReal estimateLeaveSpeed(const MSLink *const link, const SUMOReal vLinkPass) const
estimate leaving speed when accelerating across a link
Definition: MSVehicle.h:1598
WaitingTimeCollector myWaitingTimeCollector
Definition: MSVehicle.h:1461
SUMOReal mySpeed
the stored speed (should be >=0 at any time)
Definition: MSVehicle.h:143
Definition of vehicle stop (position and duration)
Definition: MSVehicle.h:803
SUMOReal getCO2Emissions() const
Returns CO2 emission of the current state.
Definition: MSVehicle.cpp:3348
bool executeMove()
Executes planned vehicle movements with regards to right-of-way.
Definition: MSVehicle.cpp:1843
int getLaneIndex() const
Definition: MSVehicle.cpp:3540
std::vector< const MSEdge * > ConstMSEdgeVector
Definition: MSEdge.h:78
SUMOTime myMemorySize
the maximal memory to store
Definition: MSVehicle.h:207
std::pair< const MSVehicle *const, SUMOReal > getLeader(SUMOReal dist=0) const
Returns the leader of the vehicle looking for a fixed distance.
Definition: MSVehicle.cpp:3308
SUMOReal getPositionOnLane() const
Get the vehicle&#39;s position along the lane.
Definition: MSVehicle.h:375
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:1545
The base class for microscopic and mesoscopic vehicles.
Definition: MSBaseVehicle.h:56
bool myHaveToWaitOnNextLink
Definition: MSVehicle.h:1520
void adaptToLeaders(const MSLeaderInfo &ahead, SUMOReal latOffset, const SUMOReal seen, DriveProcessItem *const lastLink, const MSLane *const lane, SUMOReal &v, SUMOReal &vLinkPass) const
Definition: MSVehicle.cpp:1730
SUMOReal processNextStop(SUMOReal currentVelocity)
Processes stops, returns the velocity needed to reach the stop.
Definition: MSVehicle.cpp:1126
A storage for edge travel times and efforts.
bool hasStops() const
Returns whether the vehicle has to stop somewhere.
Definition: MSVehicle.h:868
SUMOReal length
The overall length which may be driven when using this lane without a lane change.
Definition: MSVehicle.h:693
void enterLaneAtLaneChange(MSLane *enteredLane)
Update when the vehicle enters a new lane in the laneChange step.
Definition: MSVehicle.cpp:2726
SUMOReal myStopDist
distance to the next stop or -1 if there is none
Definition: MSVehicle.h:1526
The car-following model and parameter.
Definition: MSVehicleType.h:74
SUMOReal updateFurtherLanes(std::vector< MSLane * > &furtherLanes, std::vector< SUMOReal > &furtherLanesPosLat, const std::vector< MSLane * > &passedLanes)
update a vector of further lanes and return the new backPos
Definition: MSVehicle.cpp:2308
bool triggered
whether an arriving person lets the vehicle continue
Definition: MSVehicle.h:825
MSAbstractLaneChangeModel & getLaneChangeModel()
Definition: MSVehicle.cpp:2881
MSCFModel::VehicleVariables * myCFVariables
The per vehicle variables of the car following model.
Definition: MSVehicle.h:1659
const MSCFModel & getCarFollowModel() const
Returns the vehicle type&#39;s car following model definition (const version)
Performs lane changing of vehicles.
Right blinker lights are switched on.
Definition: MSVehicle.h:1042
MSChargingStation * chargingStation
(Optional) charging station if one is assigned to the stop
Definition: MSVehicle.h:815
SUMOReal nextOccupation
As occupation, but without the first lane.
Definition: MSVehicle.h:699
SUMOReal getLateralPositionOnLane() const
Get the vehicle&#39;s lateral position on the lane.
Definition: MSVehicle.h:407
SUMOReal getElectricityConsumption() const
Returns electricity consumption of the current state.
Definition: MSVehicle.cpp:3384
SUMOTime getMemorySize() const
Definition: MSVehicle.h:196
std::vector< std::pair< SUMOTime, int > > myLaneTimeLine
The lane usage time line to apply.
Definition: MSVehicle.h:1323
int getContainerNumber() const
Returns the number of containers.
Definition: MSVehicle.cpp:3474
bool operator!=(const State &state)
Operator !=.
Definition: MSVehicle.cpp:140
static std::vector< MSTransportable * > myEmptyTransportableVector
Definition: MSVehicle.h:1490
Performs lane changing of vehicles.
Definition: MSLaneChanger.h:55
A road/street connecting two junctions.
Definition: MSEdge.h:80
MSLane * lane
The described lane.
Definition: MSVehicle.h:691
void checkRewindLinkLanes(const SUMOReal lengthsInFront, DriveItemVector &lfLinks) const
Definition: MSVehicle.cpp:2446
Left blinker lights are switched on.
Definition: MSVehicle.h:1044
SUMOReal computeAngle() const
compute the current vehicle angle
Definition: MSVehicle.cpp:820
DriveProcessItem(SUMOReal vWait, SUMOReal distance)
constructor if the link shall not be passed
Definition: MSVehicle.h:1561
The wipers are on.
Definition: MSVehicle.h:1058
SUMOReal getLateralOverlap() const
return the amount by which the vehicle extends laterally outside it&#39;s primary lane ...
Definition: MSVehicle.cpp:3644
void workOnMoveReminders(SUMOReal oldPos, SUMOReal newPos, SUMOReal newSpeed)
Processes active move reminder.
Definition: MSVehicle.cpp:707
SUMOReal getMaxSpeedOnLane() const
Returns the maximal speed for the vehicle on its current lane (including speed factor and deviation...
Definition: MSVehicle.h:498
vehicle want&#39;s to change to right lane
Definition: MSVehicle.h:228
void removeApproachingInformation(DriveItemVector &lfLinks) const
unregister approach from all upcoming links
Definition: MSVehicle.cpp:3651
Representation of a vehicle.
Definition: SUMOVehicle.h:67
MSStoppingPlace * containerstop
(Optional) container stop if one is assigned to the stop
Definition: MSVehicle.h:811
Stores the waiting intervals over the previous seconds (memory is to be specified in ms...
Definition: MSVehicle.h:168
PositionVector getBoundingBox() const
get bounding rectangle
Definition: MSVehicle.cpp:3716
Encapsulated SAX-Attributes.
ChangeRequest
Requests set via TraCI.
Definition: MSVehicle.h:222
const std::vector< MSLane * > & getBestLanesContinuation() const
Returns the best sequence of lanes to continue the route starting at myLane.
Definition: MSVehicle.cpp:3236
SUMOReal lastCoveredDist() const
previous Speed of this state
Definition: MSVehicle.h:133
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:46
SUMOReal getLastStepDist() const
Get the distance the vehicle covered in the previous timestep.
Definition: MSVehicle.h:382
bool willPass(const MSEdge *const edge) const
Returns whether the vehicle wil pass the given edge.
Definition: MSVehicle.cpp:664
SUMOReal myAngle
the angle in radians (
Definition: MSVehicle.h:1523
A list of positions.
void updateBestLanes(bool forceRebuild=false, const MSLane *startLane=0)
computes the best lanes to use in order to continue the route
Definition: MSVehicle.cpp:2899
SUMOTime timeToLoadNextContainer
The time at which the vehicle is able to load another container.
Definition: MSVehicle.h:839
Position myCachedPosition
Definition: MSVehicle.h:1528
const MSLane * lane
The lane to stop at.
Definition: MSVehicle.h:807
SUMOReal myOriginalSpeed
The velocity before influence.
Definition: MSVehicle.h:1326
std::vector< SUMOReal > myFurtherLanesPosLat
Definition: MSVehicle.h:1506
bool addStop(const SUMOVehicleParameter::Stop &stopPar, std::string &errorMsg, SUMOTime untilOffset=0)
Adds a stop.
Definition: MSVehicle.cpp:885
std::list< Stop > myStops
The vehicle&#39;s list of stops.
Definition: MSVehicle.h:1493
ConstMSEdgeVector::const_iterator MSRouteIterator
Definition: MSRoute.h:65
SUMOTime myTimeLoss
the time loss due to writing with less than maximum speed
Definition: MSVehicle.h:1464
PositionVector getBoundingPoly() const
get bounding polygon
Definition: MSVehicle.cpp:3729
bool isStopped() const
Returns whether the vehicle is at a stop.
Definition: MSVehicle.cpp:1102
bool isStoppedInRange(SUMOReal pos) const
return whether the given position is within range of the current stop
Definition: MSVehicle.cpp:1120
bool myConsiderMaxDeceleration
Whether the maximum deceleration shall be regarded.
Definition: MSVehicle.h:1338
#define STEPS2TIME(x)
Definition: SUMOTime.h:65
void adaptLeaveSpeed(const SUMOReal v)
Definition: MSVehicle.h:1571
MSLane * myLane
The lane the vehicle is on.
Definition: MSVehicle.h:1470
bool getRespectJunctionPriority() const
Returns whether junction priority rules shall be respected.
Definition: MSVehicle.h:1262
bool myAmRegisteredAsWaitingForContainer
Whether this vehicle is registered as waiting for a container (for deadlock-recognition) ...
Definition: MSVehicle.h:1518
Blinker lights on both sides are switched on.
Definition: MSVehicle.h:1046
Influencer * myInfluencer
An instance of a velocity/lane influencing instance; built in "getInfluencer".
Definition: MSVehicle.h:1663
void resetRoutePosition(int index)
Definition: MSVehicle.cpp:676
std::vector< LaneQ >::iterator myCurrentLaneInBestLanes
Definition: MSVehicle.h:1487
const std::vector< MSTransportable * > & getContainers() const
retrieve riding containers
Definition: MSVehicle.cpp:3458
SUMOReal getDistanceToPosition(SUMOReal destPos, const MSEdge *destEdge) const
Definition: MSVehicle.cpp:3291
SUMOReal getSafeFollowSpeed(const std::pair< const MSVehicle *, SUMOReal > leaderInfo, const SUMOReal seen, const MSLane *const lane, SUMOReal distToCrossing) const
compute safe speed for following the given leader
Definition: MSVehicle.cpp:1801
SUMOReal getSpaceTillLastStanding(const MSLane *l, bool &foundStopped) const
Definition: MSVehicle.cpp:2425
SUMOTime duration
The stopping duration.
Definition: MSVehicle.h:821
T MIN2(T a, T b)
Definition: StdDefs.h:64
SUMOReal myLastCoveredDist
Definition: MSVehicle.h:160
The brake lights are on.
Definition: MSVehicle.h:1048
SUMOReal getTimeGapOnLane() const
Returns the time gap in seconds to the leader of the vehicle on the same lane.
Definition: MSVehicle.cpp:3337
SUMOReal getAccumulatedWaitingSeconds() const
Returns the number of seconds waited (speed was lesser than 0.1m/s) within the last millisecs...
Definition: MSVehicle.h:580
A blue emergency light is on.
Definition: MSVehicle.h:1064
A structure representing the best lanes for continuing the current route starting at &#39;lane&#39;...
Definition: MSVehicle.h:689
void loadState(const SUMOSAXAttributes &attrs, const SUMOTime offset)
Loads the state of this vehicle from the given description.
Definition: MSVehicle.cpp:4030
Everything is switched off.
Definition: MSVehicle.h:1040
void onRemovalFromNet(const MSMoveReminder::Notification reason)
Called when the vehicle is removed from the network.
Definition: MSVehicle.cpp:590
std::set< std::string > awaitedContainers
IDs of containers the vehicle has to wait for until departing.
Definition: MSVehicle.h:835
Something on a lane to be noticed about vehicle movement.
int getSignals() const
Definition: MSVehicle.h:1314
void fixPosition()
repair errors in vehicle position after changing between internal edges
Definition: MSVehicle.cpp:3283
MSParkingArea * parkingarea
(Optional) parkingArea if one is assigned to the stop
Definition: MSVehicle.h:813
SUMOTime myWaitingTime
The time the vehicle waits (is not faster than 0.1m/s) in seconds.
Definition: MSVehicle.h:1457
One of the left doors is opened.
Definition: MSVehicle.h:1060
LaneChangeMode mySpeedGainLC
lane changing to travel with higher speed
Definition: MSVehicle.h:1362
void planMoveInternal(const SUMOTime t, MSLeaderInfo ahead, DriveItemVector &lfLinks, SUMOReal &myStopDist) const
Definition: MSVehicle.cpp:1395
bool isParking() const
Returns whether the vehicle is parking.
Definition: MSVehicle.cpp:1108
LaneChangeMode myCooperativeLC
lane changing with the intent to help other vehicles
Definition: MSVehicle.h:1360
const std::vector< LaneQ > & getBestLanes() const
Returns the description of best lanes to use in order to continue the route.
Definition: MSVehicle.cpp:2893
int getRoutePosition() const
Definition: MSVehicle.cpp:670
bool knowsEdgeTest(MSEdge &edge) const
State(SUMOReal pos, SUMOReal speed, SUMOReal posLat, SUMOReal backPos)
Constructor.
Definition: MSVehicle.cpp:150
int getPersonNumber() const
Returns the number of persons.
Definition: MSVehicle.cpp:3468
bool allowsContinuation
Whether this lane allows to continue the drive.
Definition: MSVehicle.h:703
SUMOReal getHarmonoise_NoiseEmissions() const
Returns noise emissions of the current state.
Definition: MSVehicle.cpp:3390
const std::vector< MSTransportable * > & getPersons() const
retrieve riding persons
Definition: MSVehicle.cpp:3448
Container that holds the vehicles driving state (position+speed).
Definition: MSVehicle.h:93
void saveState(OutputDevice &out)
Saves the states of a vehicle.
Definition: MSVehicle.cpp:4010
SUMOReal getOriginalSpeed() const
Returns the originally longitudinal speed to use.
Definition: MSVehicle.h:1288
MSCFModel::VehicleVariables * getCarFollowVariables() const
Returns the vehicle&#39;s car following model variables.
Definition: MSVehicle.h:792
SUMOReal getNOxEmissions() const
Returns NOx emission of the current state.
Definition: MSVehicle.cpp:3366
SUMOReal getRightSideOnLane() const
Get the vehicle&#39;s lateral position on the lane:
Definition: MSVehicle.cpp:3557
bool myEmergencyBrakeRedLight
Whether red lights are a reason to brake.
Definition: MSVehicle.h:1344
MSEdgeWeightsStorage & _getWeightsStorage() const
Definition: MSVehicle.cpp:697
ConstMSEdgeVector myVTDRoute
Definition: MSVehicle.h:1352
virtual void drawOutsideNetwork(bool)
register vehicle for drawing while outside the network
Definition: MSVehicle.h:1457
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:2832
SUMOReal getMaxAccel() const
Get the vehicle type&#39;s maximum acceleration [m/s^2].
Definition: MSCFModel.h:193
SUMOReal getPMxEmissions() const
Returns PMx emission of the current state.
Definition: MSVehicle.cpp:3372
SUMOReal getCOEmissions() const
Returns CO emission of the current state.
Definition: MSVehicle.cpp:3354
Abstract in-vehicle device.
Definition: MSDevice.h:69
void updateOccupancyAndCurrentBestLane(const MSLane *startLane)
updates LaneQ::nextOccupation and myCurrentLaneInBestLanes
Definition: MSVehicle.cpp:3219
const std::vector< SUMOReal > & getFurtherLanesPosLat() const
Definition: MSVehicle.h:678
void setEmergencyBlueLight(SUMOTime currentTime)
sets the blue flashing light for emergency vehicles
Definition: MSVehicle.cpp:3520
SUMOReal getLatOffset(const MSLane *lane) const
Get the offset that that must be added to interpret myState.myPosLat for the given lane...
Definition: MSVehicle.cpp:3601
vehicle want&#39;s to change to left lane
Definition: MSVehicle.h:226
const std::vector< MSLane * > & getFurtherLanes() const
Definition: MSVehicle.h:674
void addStops(const bool ignoreStopErrors)
Adds stops to the built vehicle.
Influencer & getInfluencer()
Returns the velocity/lane influencer.
Definition: MSVehicle.cpp:3905
Structure representing possible vehicle parameter.
bool getEmergencyBrakeRedLight() const
Returns whether red lights shall be a reason to brake.
Definition: MSVehicle.h:1270
LaneChangeMode mySublaneLC
changing to the prefered lateral alignment
Definition: MSVehicle.h:1366
SUMOTime getAccumulatedWaitingTime(SUMOTime t=MSGlobals::gWaitingTimeMemory) const
Returns the SUMOTime waited (speed was lesser than 0.1m/s) within the last t millisecs.
Definition: MSVehicle.h:559
std::vector< std::pair< SUMOTime, SUMOReal > > mySpeedTimeLine
The velocity time line to apply.
Definition: MSVehicle.h:1320
SUMOReal getSlope() const
Returns the slope of the road at vehicle&#39;s position.
Definition: MSVehicle.cpp:756
bool containerTriggered
whether an arriving container lets the vehicle continue
Definition: MSVehicle.h:827
void setVTDState(Position xyPos)
sets position outside the road network
Definition: MSVehicle.cpp:3942
SUMOTime getTimeLoss() const
Returns the SUMOTime lost (speed was lesser maximum speed)
Definition: MSVehicle.h:549
SUMOTime getLastAccessTimeStep() const
Definition: MSVehicle.h:1294
SUMOReal occupation
The overall vehicle sum on consecutive lanes which can be passed without a lane change.
Definition: MSVehicle.h:697
SUMOReal getAcceleration() const
Returns the vehicle&#39;s acceleration in m/s (this is computed as the last step&#39;s mean acceleration in c...
Definition: MSVehicle.h:459
SUMOReal getCenterOnEdge(const MSLane *lane=0) const
Get the vehicle&#39;s lateral position on the edge of the given lane (or its current edge if lane == 0) ...
Definition: MSVehicle.cpp:3569
int mySignals
State of things of the vehicle that can be on or off.
Definition: MSVehicle.h:1509
std::vector< MSLane * > bestContinuations
Definition: MSVehicle.h:709
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:833
SUMOReal myPreviousSpeed
the speed at the begin of the previous time step
Definition: MSVehicle.h:154
SUMOReal getFuelConsumption() const
Returns fuel consumption of the current state.
Definition: MSVehicle.cpp:3378
void adaptToLeader(const std::pair< const MSVehicle *, SUMOReal > leaderInfo, const SUMOReal seen, DriveProcessItem *const lastLink, const MSLane *const lane, SUMOReal &v, SUMOReal &vLinkPass, SUMOReal distToCrossing=-1) const
Definition: MSVehicle.cpp:1765
const MSVehicleType & getVehicleType() const
Returns the vehicle&#39;s type definition.
SUMOTime until
The time at which the vehicle may continue its journey.
Definition: MSVehicle.h:823
const ConstMSEdgeVector getStopEdges() const
Returns the list of still pending stop edges.
Definition: MSVehicle.cpp:1334
friend class MSVehicle
vehicle sets states directly
Definition: MSVehicle.h:95
MSRouteIterator edge
The edge in the route to stop at.
Definition: MSVehicle.h:805
const waitingIntervalList & getWaitingIntervals() const
Definition: MSVehicle.h:201
bool addTraciBusOrContainerStop(const std::string &stopId, const SUMOTime duration, const SUMOTime until, const bool parking, const bool triggered, const bool containerTriggered, const bool isContainerStop, std::string &errorMsg)
Definition: MSVehicle.cpp:3802
SUMOReal getSpeed() const
Returns the vehicle&#39;s current speed.
Definition: MSVehicle.h:442
bool isFrontOnLane(const MSLane *lane) const
Returns the information whether the front of the vehicle is on the given lane.
Definition: MSVehicle.cpp:2419
SUMOReal myPos
the stored position
Definition: MSVehicle.h:140
SUMOReal getWaitingSeconds() const
Returns the number of seconds waited (speed was lesser than 0.1m/s)
Definition: MSVehicle.h:570
bool isStoppedTriggered() const
Returns whether the vehicle is on a triggered stop.
Definition: MSVehicle.cpp:1114
waitingIntervalList myWaitingIntervals
Definition: MSVehicle.h:212
static SUMOTime gWaitingTimeMemory
length of memory for waiting times (in millisecs)
Definition: MSGlobals.h:113
std::vector< DriveProcessItem > DriveItemVector
Container for used Links/visited Lanes during lookForward.
Definition: MSVehicle.h:1584
void setSignals(int signals)
Definition: MSVehicle.h:1310
SUMOReal nextStopDist() const
return the distance to the next stop or SUMORealMax if there is none.
Definition: MSVehicle.h:888
SUMOReal endPos
The stopping position end.
Definition: MSVehicle.h:819
const MSEdge * getRerouteOrigin() const
Returns the starting point for reroutes (usually the current edge)
Definition: MSVehicle.cpp:799
SUMOReal getPreviousSpeed() const
Returns the vehicle&#39;s speed before the previous time step.
Definition: MSVehicle.h:450
vehicle want&#39;s to keep the current lane
Definition: MSVehicle.h:230
int getSignals() const
Returns the signals.
Definition: MSVehicle.h:1111
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:71
SUMOReal myPosLat
the stored lateral position
Definition: MSVehicle.h:146
#define SUMOReal
Definition: config.h:208
void switchOffSignal(int signal)
Switches the given signal off.
Definition: MSVehicle.h:1103
static bool gSemiImplicitEulerUpdate
Definition: MSGlobals.h:63
void switchOnSignal(int signal)
Switches the given signal on.
Definition: MSVehicle.h:1095
SUMOReal estimateSpeedAfterDistance(const SUMOReal dist, const SUMOReal v, const SUMOReal accel) const
Definition: MSCFModel.cpp:468
void addPerson(MSTransportable *person)
Adds a passenger.
Definition: MSVehicle.cpp:3396
static std::vector< MSLane * > myEmptyLaneVector
Definition: MSVehicle.h:1489
void adaptBestLanesOccupation(int laneIndex, SUMOReal density)
update occupation from MSLaneChanger
Definition: MSVehicle.cpp:3275
static bool overlap(const MSVehicle *veh1, const MSVehicle *veh2)
Definition: MSVehicle.h:606
SUMOReal myBackPos
the stored back position
Definition: MSVehicle.h:151
SUMOReal getTimeLossSeconds() const
Returns the time loss in seconds.
Definition: MSVehicle.h:586
SUMOTime cumulatedWaitingTime(SUMOTime memory=-1) const
Definition: MSVehicle.cpp:178
virtual ~MSVehicle()
Destructor.
Definition: MSVehicle.cpp:567
MSParkingArea * getNextParkingArea()
get the current parking area stop
Definition: MSVehicle.cpp:1088
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:458
bool isOnRoad() const
Returns the information whether the vehicle is on a road (is simulated)
Definition: MSVehicle.h:510
bool mySpeedAdaptationStarted
Whether influencing the speed has already started.
Definition: MSVehicle.h:1329
MSLane * getLane() const
Returns the lane the vehicle is on.
Definition: MSVehicle.h:488
int influenceChangeDecision(int state)
allow TraCI to influence a lane change decision
Definition: MSVehicle.cpp:3929
void activateReminders(const MSMoveReminder::Notification reason)
"Activates" all current move reminder
Definition: MSVehicle.cpp:2657
SUMOReal getBackPositionOnLane() const
Get the vehicle&#39;s position relative to its current lane.
Definition: MSVehicle.h:399
bool addTraciStop(MSLane *const lane, const SUMOReal startPos, const SUMOReal endPos, const SUMOTime duration, const SUMOTime until, const bool parking, const bool triggered, const bool containerTriggered, std::string &errorMsg)
Definition: MSVehicle.cpp:3766
SUMOReal startPos
The stopping position start.
Definition: MSVehicle.h:817
A red emergency light is on.
Definition: MSVehicle.h:1066
MSStoppingPlace * busstop
(Optional) bus stop if one is assigned to the stop
Definition: MSVehicle.h:809
Representation of a lane in the micro simulation.
Definition: MSLane.h:79
const MSEdgeWeightsStorage & getWeightsStorage() const
Returns the vehicle&#39;s internal edge travel times/efforts container.
Definition: MSVehicle.cpp:685
void adaptLaneEntering2MoveReminder(const MSLane &enteredLane)
Adapts the vehicle&#39;s entering of a new lane.
Definition: MSVehicle.cpp:736
One of the right doors is opened.
Definition: MSVehicle.h:1062
Interface for lane-change models.
int getBestLaneOffset() const
Definition: MSVehicle.cpp:3265
SUMOReal posLat() const
Lateral Position of this state (m relative to the centerline of the lane).
Definition: MSVehicle.h:123
bool myConsiderSafeVelocity
Whether the safe velocity shall be regarded.
Definition: MSVehicle.h:1332
void removeTransportable(MSTransportable *t)
removes a person or container
Definition: MSVehicle.cpp:3438
MSDevice_Transportable * myContainerDevice
The containers this vehicle may have.
Definition: MSVehicle.h:1499
The fog lights are on (no visualisation)
Definition: MSVehicle.h:1052
bool parking
whether the vehicle is removed from the net while stopping
Definition: MSVehicle.h:829
SUMOReal getAngle() const
Returns the vehicle&#39;s direction in radians.
Definition: MSVehicle.h:594
A yellow emergency light is on.
Definition: MSVehicle.h:1068
const Position getBackPosition() const
Definition: MSVehicle.cpp:861
SUMOReal getDeltaPos(SUMOReal accel)
calculates the distance covered in the next integration step given an acceleration and assuming the c...
Definition: MSVehicle.cpp:1821