SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules 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.dlr.de/
18 // Copyright (C) 2001-2016 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 MSPerson;
66 class MSDevice;
68 class OutputDevice;
69 class Position;
71 class MSContainer;
72 class MSJunction;
73 class MSLeaderInfo;
74 
75 // ===========================================================================
76 // class definitions
77 // ===========================================================================
82 class MSVehicle : public MSBaseVehicle {
83 public:
84 
86  friend class MSLaneChanger;
87  friend class MSLaneChangerSublane;
88 
92  class State {
94  friend class MSVehicle;
95  friend class MSLaneChanger;
96  friend class MSLaneChangerSublane;
97 
98  public:
101 
103  State(const State& state);
104 
106  State& operator=(const State& state);
107 
109  bool operator!=(const State& state);
110 
112  SUMOReal pos() const {
113  return myPos;
114  }
115 
117  SUMOReal speed() const {
118  return mySpeed;
119  };
120 
122  SUMOReal posLat() const {
123  return myPosLat;
124  }
125 
127  SUMOReal backPos() const {
128  return myBackPos;
129  }
130 
133  return myLastCoveredDist;
134  }
135 
136 
137  private:
140 
143 
146 
148  // if the vehicle occupies multiple lanes, this is the position relative
149  // to the lane occupied by its back
151 
154 
160 
161  };
162 
163 
168  friend class MSVehicle;
169 
170  typedef std::list<std::pair<SUMOTime, SUMOTime> > waitingIntervalList;
171 
172  public:
175 
178 
181 
183  bool operator!=(const WaitingTimeCollector& wt) const;
184 
187 
188  // return the waiting time within the last memory millisecs
189  SUMOTime cumulatedWaitingTime(SUMOTime memory = -1) const;
190 
191  // process time passing for dt millisecs
192  void passTime(SUMOTime dt, bool waiting);
193 
194  // maximal memory time stored
196  return myMemorySize;
197  }
198 
199  // maximal memory time stored
200  const waitingIntervalList& getWaitingIntervals() const {
201  return myWaitingIntervals;
202  }
203 
204  private:
207 
211  waitingIntervalList myWaitingIntervals;
212 
214  void appendWaitingTime(SUMOTime dt);
215  };
216 
217 
230  };
231 
239  MSVehicle(SUMOVehicleParameter* pars, const MSRoute* route,
240  const MSVehicleType* type, const SUMOReal speedFactor);
241 
243  virtual ~MSVehicle();
244 
245 
247 
248 
258 
259 
260 
262 
263 
267  bool hasArrived() const;
268 
277  bool replaceRoute(const MSRoute* route, bool onInit = false, int offset = 0);
278 
279 
285  bool willPass(const MSEdge* const edge) const;
286 
287  int getRoutePosition() const;
288  void resetRoutePosition(int index);
289 
298 
299 
301 
302 
320  void workOnMoveReminders(SUMOReal oldPos, SUMOReal newPos, SUMOReal newSpeed);
322 
323 
341  void planMove(const SUMOTime t, const MSLeaderInfo& ahead, const SUMOReal lengthsInFront);
342 
343 
356  bool executeMove();
357 
358 
366 
367 
369 
370 
375  return myState.myPos;
376  }
377 
382  return myState.lastCoveredDist();
383  }
384 
388  SUMOReal getPositionOnLane(const MSLane* lane) const;
389 
393  SUMOReal getBackPositionOnLane(const MSLane* lane) const;
394 
400  }
401 
407  return myState.myPosLat;
408  }
409 
415 
417  SUMOReal getLateralOverlap() const;
418 
424  SUMOReal getRightSideOnEdge(const MSLane* lane = 0) const;
425 
431  SUMOReal getCenterOnEdge(const MSLane* lane = 0) const;
432 
436  SUMOReal getLatOffset(const MSLane* lane) const;
437 
441  SUMOReal getSpeed() const {
442  return myState.mySpeed;
443  }
444 
445 
450  return myState.myPreviousSpeed;
451  }
452 
453 
459  return myAcceleration;
460  }
462 
463 
464 
466 
467 
471  SUMOReal getSlope() const;
472 
473 
481  Position getPosition(const SUMOReal offset = 0) const;
482 
483 
487  MSLane* getLane() const {
488  return myLane;
489  }
490 
491 
496  SUMOReal
498  if (myLane != 0) {
499  return myLane->getVehicleMaxSpeed(this);
500  } else {
501  return myType->getMaxSpeed();
502  }
503  }
504 
505 
509  inline bool isOnRoad() const {
510  return myAmOnNet;
511  }
512 
513 
517  bool isFrontOnLane(const MSLane* lane) const;
518 
519 
526  const MSEdge* getRerouteOrigin() const;
527 
528 
536  return myWaitingTime;
537  }
538 
539 
547  }
548 
549 
557  return STEPS2TIME(myWaitingTime);
558  }
559 
560 
568  }
569 
570 
574  SUMOReal getAngle() const {
575  return myAngle;
576  }
578 
580  SUMOReal computeAngle() const;
581 
583  void setAngle(SUMOReal angle);
584 
586  static bool overlap(const MSVehicle* veh1, const MSVehicle* veh2) {
587  if (veh1->myState.myPos < veh2->myState.myPos) {
588  return veh2->myState.myPos - veh2->getVehicleType().getLengthWithGap() < veh1->myState.myPos;
589  }
590  return veh1->myState.myPos - veh1->getVehicleType().getLengthWithGap() < veh2->myState.myPos;
591  }
592 
593 
596  bool congested() const {
597  return myState.mySpeed < SUMOReal(60) / SUMOReal(3.6);
598  }
599 
600 
612 
619  bool enterLaneAtMove(MSLane* enteredLane, bool onTeleporting = false);
620 
621 
622 
631  void enterLaneAtInsertion(MSLane* enteredLane, SUMOReal pos, SUMOReal speed, SUMOReal posLat,
632  MSMoveReminder::Notification notification);
633 
638  void setTentativeLaneAndPosition(MSLane* lane, SUMOReal pos, SUMOReal posLat = 0);
639 
644  void enterLaneAtLaneChange(MSLane* enteredLane);
645 
646 
648  void leaveLane(const MSMoveReminder::Notification reason);
649 
650 
653 
654  const std::vector<MSLane*>& getFurtherLanes() const {
655  return myFurtherLanes;
656  }
657 
658  const std::vector<SUMOReal>& getFurtherLanesPosLat() const {
659  return myFurtherLanesPosLat;
660  }
661 
664 
665  // TODO: improve documentation, refs. #2604
669  struct LaneQ {
685  std::vector<MSLane*> bestContinuations; // XXX: Why "best"?, refs. #2604
686  };
687 
688  // TODO: improve documentation ("best"?), refs. #2604
692  const std::vector<LaneQ>& getBestLanes() const;
693 
711  void updateBestLanes(bool forceRebuild = false, const MSLane* startLane = 0);
712 
713 
714  // TODO: improve documentation, refs. #2604
718  const std::vector<MSLane*>& getBestLanesContinuation() const;
719 
720 
721  // TODO: improve documentation, refs. #2604
725  const std::vector<MSLane*>& getBestLanesContinuation(const MSLane* const l) const;
726 
727  // TODO: improve documentation (which is the "best"?), refs. #2604
729  int getBestLaneOffset() const;
730 
732  void adaptBestLanesOccupation(int laneIndex, SUMOReal density);
733 
735 
737  void fixPosition();
738 
739 
748  void replaceVehicleType(MSVehicleType* type);
749 
750 
758  inline const MSCFModel& getCarFollowModel() const {
759  return myType->getCarFollowModel();
760  }
761 
762 
768  return myCFVariables;
769  }
770 
771 
773 
774 
778  struct Stop {
782  const MSLane* lane;
798  bool triggered;
802  bool parking;
804  bool reached;
806  std::set<std::string> awaitedPersons;
808  std::set<std::string> awaitedContainers;
813 
814  };
815 
816 
823  bool addStop(const SUMOVehicleParameter::Stop& stopPar, std::string& errorMsg, SUMOTime untilOffset = 0);
824 
825 
829  bool hasStops() const {
830  return !myStops.empty();
831  }
832 
836  bool isStopped() const;
837 
841  bool isParking() const;
842 
846  bool isRemoteControlled() const;
847 
850  return myStopDist;
851  }
852 
856  bool isStoppedTriggered() const;
857 
860  bool isStoppedInRange(SUMOReal pos) const;
862 
863  bool knowsEdgeTest(MSEdge& edge) const;
864  int getLaneIndex() const;
865 
875  SUMOReal getDistanceToPosition(SUMOReal destPos, const MSEdge* destEdge) const;
876 
877 
885  SUMOReal processNextStop(SUMOReal currentVelocity);
886 
894  std::pair<const MSVehicle* const, SUMOReal> getLeader(SUMOReal dist = 0) const;
895 
902  SUMOReal getTimeGap() const;
903 
904 
906 
907 
911  SUMOReal getCO2Emissions() const;
912 
913 
917  SUMOReal getCOEmissions() const;
918 
919 
923  SUMOReal getHCEmissions() const;
924 
925 
929  SUMOReal getNOxEmissions() const;
930 
931 
935  SUMOReal getPMxEmissions() const;
936 
937 
942 
943 
948 
949 
955 
956 
957 
959 
960 
964  void addPerson(MSTransportable* person);
965 
967 
968 
972  void addContainer(MSTransportable* container);
973 
975  const std::vector<MSTransportable*>& getPersons() const;
976 
978  const std::vector<MSTransportable*>& getContainers() const;
979 
983  int getPersonNumber() const;
984 
988  int getContainerNumber() const;
989 
992 
996  enum Signalling {
1027  };
1028 
1029 
1035  LC_NEVER = 0, // lcModel shall never trigger changes at this level
1036  LC_NOCONFLICT = 1, // lcModel may trigger changes if not in conflict with TraCI request
1037  LC_ALWAYS = 2 // lcModel may always trigger changes of this level regardless of requests
1038  };
1039 
1040 
1043  LCP_ALWAYS = 0, // change regardless of blockers, adapt own speed and speed of blockers
1044  LCP_NOOVERLAP = 1, // change unless overlapping with blockers, adapt own speed and speed of blockers
1045  LCP_URGENT = 2, // change if not blocked, adapt own speed and speed of blockers
1046  LCP_OPPORTUNISTIC = 3 // change if not blocked
1047  };
1048 
1049 
1053  void switchOnSignal(int signal) {
1054  mySignals |= signal;
1055  }
1056 
1057 
1061  void switchOffSignal(int signal) {
1062  mySignals &= ~signal;
1063  }
1064 
1065 
1069  int getSignals() const {
1070  return mySignals;
1071  }
1072 
1073 
1078  bool signalSet(int which) const {
1079  return (mySignals & which) != 0;
1080  }
1082 
1083 
1085  bool unsafeLinkAhead(const MSLane* lane) const;
1086 
1087 
1088 #ifndef NO_TRACI
1089 
1097 
1110  bool addTraciStop(MSLane* const lane, const SUMOReal startPos, const SUMOReal endPos, const SUMOTime duration, const SUMOTime until,
1111  const bool parking, const bool triggered, const bool containerTriggered, std::string& errorMsg);
1112 
1124  bool addTraciBusOrContainerStop(const std::string& stopId, const SUMOTime duration, const SUMOTime until, const bool parking,
1125  const bool triggered, const bool containerTriggered, const bool isContainerStop, std::string& errorMsg);
1126 
1131  Stop& getNextStop();
1132 
1137  bool resumeFromStopping();
1138 
1139 
1141  SUMOReal updateFurtherLanes(std::vector<MSLane*>& furtherLanes,
1142  std::vector<SUMOReal>& furtherLanesPosLat,
1143  const std::vector<MSLane*>& passedLanes);
1144 
1147 
1150 
1163  class Influencer {
1164  public:
1166  Influencer();
1167 
1168 
1170  ~Influencer();
1171 
1172 
1176  void setSpeedTimeLine(const std::vector<std::pair<SUMOTime, SUMOReal> >& speedTimeLine);
1177 
1178 
1182  void setLaneTimeLine(const std::vector<std::pair<SUMOTime, int> >& laneTimeLine);
1183 
1185  int getSpeedMode() const;
1186 
1198  SUMOReal influenceSpeed(SUMOTime currentTime, SUMOReal speed, SUMOReal vSafe, SUMOReal vMin, SUMOReal vMax);
1199 
1207  int influenceChangeDecision(const SUMOTime currentTime, const MSEdge& currentEdge, const int currentLaneIndex, int state);
1208 
1209 
1215  SUMOReal changeRequestRemainingSeconds(const SUMOTime currentTime) const;
1216 
1220  void setConsiderSafeVelocity(bool value);
1221 
1222 
1226  void setConsiderMaxAcceleration(bool value);
1227 
1228 
1232  void setConsiderMaxDeceleration(bool value);
1233 
1234 
1238  void setRespectJunctionPriority(bool value);
1239 
1240 
1244  inline bool getRespectJunctionPriority() const {
1246  }
1247 
1248 
1252  void setEmergencyBrakeRedLight(bool value);
1253 
1254 
1258  inline bool getEmergencyBrakeRedLight() const {
1259  return myEmergencyBrakeRedLight;
1260  }
1261 
1262 
1266  void setLaneChangeMode(int value);
1267 
1268 
1272  inline SUMOReal getOriginalSpeed() const {
1273  return myOriginalSpeed;
1274  }
1275 
1276  void setVTDControlled(Position xyPos, MSLane* l, SUMOReal pos, SUMOReal posLat, SUMOReal angle, int edgeOffset, const ConstMSEdgeVector& route, SUMOTime t);
1277 
1279  return myLastVTDAccess;
1280  }
1281 
1282  void postProcessVTD(MSVehicle* v);
1283 
1285  SUMOReal implicitSpeedVTD(const MSVehicle* veh, SUMOReal oldSpeed);
1286 
1289 
1290  bool isVTDControlled() const;
1291 
1292  bool isVTDAffected(SUMOTime t) const;
1293 
1294  private:
1296  std::vector<std::pair<SUMOTime, SUMOReal> > mySpeedTimeLine;
1297 
1299  std::vector<std::pair<SUMOTime, int> > myLaneTimeLine;
1300 
1303 
1306 
1309 
1312 
1315 
1318 
1321 
1330 
1332 
1346 
1347  };
1348 
1349 
1356 
1357  const Influencer* getInfluencer() const;
1358 
1359  bool hasInfluencer() const {
1360  return myInfluencer != 0;
1361  }
1362 
1364  int influenceChangeDecision(int state);
1365 
1367  void setVTDState(Position xyPos);
1368 
1370  SUMOReal getSafeFollowSpeed(const std::pair<const MSVehicle*, SUMOReal> leaderInfo,
1371  const SUMOReal seen, const MSLane* const lane, SUMOReal distToCrossing) const;
1372 
1374  static int nextLinkPriority(const std::vector<MSLane*>& conts);
1375 
1376 #endif
1377 
1379 
1380 
1382  void saveState(OutputDevice& out);
1383 
1386  void loadState(const SUMOSAXAttributes& attrs, const SUMOTime offset);
1388 
1389 protected:
1390 
1391  SUMOReal getSpaceTillLastStanding(const MSLane* l, bool& foundStopped) const;
1392 
1395 
1411  void adaptLaneEntering2MoveReminder(const MSLane& enteredLane);
1413 
1414 
1415 
1416  void setBlinkerInformation();
1417 
1420  void setEmergencyBlueLight(SUMOTime currentTime);
1421 
1423  void updateOccupancyAndCurrentBestLane(const MSLane* startLane);
1424 
1427  const ConstMSEdgeVector getStopEdges() const;
1428 
1430  virtual void drawOutsideNetwork(bool /*add*/) {};
1431 
1435 
1438 
1441 
1443 
1446 
1447  std::vector<std::vector<LaneQ> > myBestLanes; // XXX: Documentation?, refs. #2604
1448  std::vector<LaneQ>::iterator myCurrentLaneInBestLanes;
1449  static std::vector<MSLane*> myEmptyLaneVector;
1450  static std::vector<MSTransportable*> myEmptyTransportableVector;
1451 
1453  std::list<Stop> myStops;
1454 
1457 
1460 
1463 
1465  std::vector<MSLane*> myFurtherLanes;
1466  std::vector<SUMOReal> myFurtherLanesPosLat;
1467 
1470 
1473 
1476 
1479 
1481 
1484 
1487 
1489 
1490 protected:
1504 
1505  DriveProcessItem(MSLink* link, SUMOReal vPass, SUMOReal vWait, bool setRequest,
1506  SUMOTime arrivalTime, SUMOReal arrivalSpeed,
1507  SUMOTime arrivalTimeBraking, SUMOReal arrivalSpeedBraking,
1508  SUMOReal distance,
1509  SUMOReal leaveSpeed = -1.) :
1510  myLink(link), myVLinkPass(vPass), myVLinkWait(vWait), mySetRequest(setRequest),
1511  myArrivalTime(arrivalTime), myArrivalSpeed(arrivalSpeed),
1512  myArrivalTimeBraking(arrivalTimeBraking), myArrivalSpeedBraking(arrivalSpeedBraking),
1513  myDistance(distance),
1514  accelV(leaveSpeed), hadVehicle(false), availableSpace(-1.) {
1515  assert(vWait >= 0 || !MSGlobals::gSemiImplicitEulerUpdate);
1516  assert(vPass >= 0 || !MSGlobals::gSemiImplicitEulerUpdate);
1517  };
1518 
1519 
1522  myLink(0), myVLinkPass(vWait), myVLinkWait(vWait), mySetRequest(false),
1523  myArrivalTime(0), myArrivalSpeed(0),
1524  myArrivalTimeBraking(0), myArrivalSpeedBraking(0),
1525  myDistance(distance),
1526  accelV(-1), hadVehicle(false), availableSpace(-1.) {
1527  assert(vWait >= 0 || !MSGlobals::gSemiImplicitEulerUpdate);
1528  };
1529 
1530 
1531  inline void adaptLeaveSpeed(const SUMOReal v) {
1532  if (accelV < 0) {
1533  accelV = v;
1534  } else {
1535  accelV = MIN2(accelV, v);
1536  }
1537  }
1538  inline SUMOReal getLeaveSpeed() const {
1539  return accelV < 0 ? myVLinkPass : accelV;
1540  }
1541  };
1542 
1544  typedef std::vector< DriveProcessItem > DriveItemVector;
1545  DriveItemVector myLFLinkLanes;
1546 
1548  void planMoveInternal(const SUMOTime t, MSLeaderInfo ahead, DriveItemVector& lfLinks, SUMOReal& myStopDist) const;
1549 
1551  void checkRewindLinkLanes(const SUMOReal lengthsInFront, DriveItemVector& lfLinks) const;
1552 
1554  void removeApproachingInformation(DriveItemVector& lfLinks) const;
1555 
1556 
1558  inline SUMOReal estimateLeaveSpeed(const MSLink* const link, const SUMOReal vLinkPass) const {
1559  // estimate leave speed for passing time computation
1560  // l=linkLength, a=accel, t=continuousTime, v=vLeave
1561  // l=v*t + 0.5*a*t^2, solve for t and multiply with a, then add v
1562  return MIN2(link->getViaLaneOrLane()->getVehicleMaxSpeed(this),
1564  }
1565 
1566 
1567  /* @brief adapt safe velocity in accordance to a moving obstacle:
1568  * - a leader vehicle
1569  * - a vehicle or pedestrian that crosses this vehicles path on an upcoming intersection
1570  * @param[in] leaderInfo The leading vehicle and the (virtual) distance to it
1571  * @param[in] seen the distance to the end of the current lane
1572  * @param[in] lastLink the lastLink index
1573  * @param[in] lane The current Lane the vehicle is on
1574  * @param[in,out] the safe velocity for driving
1575  * @param[in,out] the safe velocity for arriving at the next link
1576  * @param[in] distToCrossing The distance to the crossing point with the current leader where relevant or -1
1577  */
1578  void adaptToLeader(const std::pair<const MSVehicle*, SUMOReal> leaderInfo,
1579  const SUMOReal seen, DriveProcessItem* const lastLink,
1580  const MSLane* const lane, SUMOReal& v, SUMOReal& vLinkPass,
1581  SUMOReal distToCrossing = -1) const;
1582 
1583  /* @brief adapt safe velocity in accordance to multiple vehicles ahead:
1584  * @param[in] ahead The leader information according to the current lateral-resolution
1585  * @param[in] latOffset the lateral offset for locating the ego vehicle on the given lane
1586  * @param[in] seen the distance to the end of the current lane
1587  * @param[in] lastLink the lastLink index
1588  * @param[in] lane The current Lane the vehicle is on
1589  * @param[in,out] the safe velocity for driving
1590  * @param[in,out] the safe velocity for arriving at the next link
1591  */
1592  void adaptToLeaders(const MSLeaderInfo& ahead,
1593  SUMOReal latOffset,
1594  const SUMOReal seen, DriveProcessItem* const lastLink,
1595  const MSLane* const lane, SUMOReal& v, SUMOReal& vLinkPass) const;
1596 
1597 
1598  // @brief return the lane on which the back of this vehicle resides
1599  const MSLane* getBackLane() const;
1600 
1601  // @brief get the position of the back bumper;
1602  const Position getBackPosition() const;
1603 
1611  void updateState(SUMOReal vNext);
1612 
1613 private:
1614  /* @brief The vehicle's knowledge about edge efforts/travel times; @see MSEdgeWeightsStorage
1615  * @note member is initialized on first access */
1617 
1620 
1621 #ifndef NO_TRACI
1624 #endif
1625 
1626 private:
1628  MSVehicle();
1629 
1631  MSVehicle(const MSVehicle&);
1632 
1634  MSVehicle& operator=(const MSVehicle&);
1635 
1637 
1638 };
1639 
1640 
1641 #endif
1642 
1643 /****************************************************************************/
1644 
bool signalSet(int which) const
Returns whether the given signal is on.
Definition: MSVehicle.h:1078
void setAngle(SUMOReal angle)
Set a custom vehicle angle in rad.
Definition: MSVehicle.cpp:817
const MSLane * myLastBestLanesInternalLane
Definition: MSVehicle.h:1445
bool isRemoteControlled() const
Returns the information whether the vehicle is fully controlled via TraCI.
Definition: MSVehicle.cpp:3734
const MSVehicleType * myType
This Vehicle's type.
void replaceVehicleType(MSVehicleType *type)
Replaces the current vehicle type by the one given.
Definition: MSVehicle.cpp:3330
bool enterLaneAtMove(MSLane *enteredLane, bool onTeleporting=false)
Update when the vehicle enters a new lane in the move step.
Definition: MSVehicle.cpp:2524
static int nextLinkPriority(const std::vector< MSLane * > &conts)
get a numerical value for the priority of the upcoming link
Definition: MSVehicle.cpp:3015
std::list< std::pair< SUMOTime, SUMOTime > > waitingIntervalList
Definition: MSVehicle.h:170
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:82
SUMOReal getMaxSpeed() const
Get vehicle'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:1226
SUMOReal speed() const
Speed of this state.
Definition: MSVehicle.h:117
SUMOTime timeToBoardNextPerson
The time at which the vehicle is able to board another person.
Definition: MSVehicle.h:810
MSEdgeWeightsStorage * myEdgeWeights
Definition: MSVehicle.h:1616
SUMOReal backPos() const
back Position of this state
Definition: MSVehicle.h:127
const MSEdge * myLastBestLanesEdge
Definition: MSVehicle.h:1444
LaneChangeMode
modes for resolving conflicts between external control (traci) and vehicle control over lane changing...
Definition: MSVehicle.h:1034
MSAbstractLaneChangeModel * myLaneChangeModel
Definition: MSVehicle.h:1442
bool myAmOnNet
Whether the vehicle is on the network (not parking, teleported, vaporized, or arrived) ...
Definition: MSVehicle.h:1472
LaneChangeMode myRightDriveLC
changing to the rightmost lane
Definition: MSVehicle.h:1340
std::vector< std::vector< LaneQ > > myBestLanes
Definition: MSVehicle.h:1447
const MSCFModel & getCarFollowModel() const
Returns the vehicle's car following model definition.
Definition: MSVehicle.h:758
std::vector< MSLane * > myFurtherLanes
The information into which lanes the vehicle laps into.
Definition: MSVehicle.h:1465
State myState
This Vehicles driving state (pos and speed)
Definition: MSVehicle.h:1437
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:3345
SUMOReal getRightSideOnEdge(const MSLane *lane=0) const
Get the vehicle's lateral position on the edge of the given lane (or its current edge if lane == 0) ...
Definition: MSVehicle.cpp:3361
Stop & getNextStop()
Definition: MSVehicle.cpp:3684
A lane area vehicles can halt at.
DriveItemVector myLFLinkLanes
Definition: MSVehicle.h:1545
SUMOReal pos() const
Position of this state.
Definition: MSVehicle.h:112
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:2611
bool resumeFromStopping()
Definition: MSVehicle.cpp:3647
bool myAmRegisteredAsWaitingForPerson
Whether this vehicle is registered as waiting for a person (for deadlock-recognition) ...
Definition: MSVehicle.h:1475
bool hasInfluencer() const
Definition: MSVehicle.h:1359
SUMOTime myLastVTDAccess
Definition: MSVehicle.h:1329
SUMOReal getLengthWithGap() const
Get vehicle'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:681
void setBlinkerInformation()
Definition: MSVehicle.cpp:3282
void addContainer(MSTransportable *container)
Adds a container.
Definition: MSVehicle.cpp:3229
SUMOReal getLeaveSpeed() const
Definition: MSVehicle.h:1538
bool unsafeLinkAhead(const MSLane *lane) const
whether the vehicle may safely move to the given lane with regard to upcoming links ...
Definition: MSVehicle.cpp:3461
SUMOReal myAcceleration
The current acceleration after dawdling in m/s.
Definition: MSVehicle.h:1462
SUMOReal getSpeedWithoutTraciInfluence() const
Returns the uninfluenced velocity.
Definition: MSVehicle.cpp:3705
void setRespectJunctionPriority(bool value)
Sets whether junction priority rules shall be respected.
Definition: MSVehicle.cpp:422
bool isVTDControlled() const
Definition: MSVehicle.cpp:458
SUMOTime getWaitingTime() const
Returns the SUMOTime waited (speed was lesser than 0.1m/s)
Definition: MSVehicle.h:535
bool congested() const
Definition: MSVehicle.h:596
The front lights are on (no visualisation)
Definition: MSVehicle.h:1008
Signalling
Some boolean values which describe the state of some vehicle parts.
Definition: MSVehicle.h:996
Position getPosition(const SUMOReal offset=0) const
Return current position (x/y, cartesian)
Definition: MSVehicle.cpp:776
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:610
The car-following model abstraction.
Definition: MSCFModel.h:60
bool myConsiderMaxAcceleration
Whether the maximum acceleration shall be regarded.
Definition: MSVehicle.h:1311
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:2090
The high beam lights are on (no visualisation)
Definition: MSVehicle.h:1012
Notification
Definition of a vehicle state.
MSDevice_Transportable * myPersonDevice
The passengers this vehicle may have.
Definition: MSVehicle.h:1456
SUMOReal currentLength
The length which may be driven on this lane.
Definition: MSVehicle.h:675
bool replaceRoute(const MSRoute *route, bool onInit=false, int offset=0)
Replaces the current route by the given one.
Definition: MSVehicle.cpp:619
Changes the wished vehicle speed / lanes.
Definition: MSVehicle.h:1163
SUMOReal implicitDeltaPosVTD(const MSVehicle *veh)
return the change in longitudinal position that is implicit in the new VTD position ...
Definition: MSVehicle.cpp:513
SUMOReal getHCEmissions() const
Returns HC emission of the current state.
Definition: MSVehicle.cpp:3171
bool myRespectJunctionPriority
Whether the junction priority rules are respected.
Definition: MSVehicle.h:1317
bool reached
Information whether the stop has been reached.
Definition: MSVehicle.h:804
const MSLane * getBackLane() const
Definition: MSVehicle.cpp:2137
State & operator=(const State &state)
Assignment operator.
Definition: MSVehicle.cpp:126
The backwards driving lights are on (no visualisation)
Definition: MSVehicle.h:1014
vehicle doesn't want to change
Definition: MSVehicle.h:223
TraciLaneChangePriority
modes for prioritizing traci lane change requests
Definition: MSVehicle.h:1042
void postProcessVTD(MSVehicle *v)
Definition: MSVehicle.cpp:469
SUMOReal estimateLeaveSpeed(const MSLink *const link, const SUMOReal vLinkPass) const
estimate leaving speed when accelerating across a link
Definition: MSVehicle.h:1558
WaitingTimeCollector myWaitingTimeCollector
Definition: MSVehicle.h:1434
SUMOReal mySpeed
the stored speed (should be >=0 at any time)
Definition: MSVehicle.h:142
Definition of vehicle stop (position and duration)
Definition: MSVehicle.h:778
SUMOReal getCO2Emissions() const
Returns CO2 emission of the current state.
Definition: MSVehicle.cpp:3159
bool executeMove()
Executes planned vehicle movements with regards to right-of-way.
Definition: MSVehicle.cpp:1692
int getLaneIndex() const
Definition: MSVehicle.cpp:3338
std::vector< const MSEdge * > ConstMSEdgeVector
Definition: MSEdge.h:78
SUMOTime myMemorySize
the maximal memory to store
Definition: MSVehicle.h:206
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:3120
SUMOReal getPositionOnLane() const
Get the vehicle's position along the lane.
Definition: MSVehicle.h:374
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:1505
The base class for microscopic and mesoscopic vehicles.
Definition: MSBaseVehicle.h:56
bool myHaveToWaitOnNextLink
Definition: MSVehicle.h:1480
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:1579
SUMOReal processNextStop(SUMOReal currentVelocity)
Processes stops, returns the velocity needed to reach the stop.
Definition: MSVehicle.cpp:1027
A storage for edge travel times and efforts.
bool hasStops() const
Returns whether the vehicle has to stop somewhere.
Definition: MSVehicle.h:829
SUMOReal length
The overall length which may be driven when using this lane without a lane change.
Definition: MSVehicle.h:673
void enterLaneAtLaneChange(MSLane *enteredLane)
Update when the vehicle enters a new lane in the laneChange step.
Definition: MSVehicle.cpp:2561
SUMOReal myStopDist
distance to the next stop or -1 if there is none
Definition: MSVehicle.h:1486
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:2147
bool triggered
whether an arriving person lets the vehicle continue
Definition: MSVehicle.h:798
WaitingTimeCollector(SUMOTime memory=MSGlobals::gWaitingTimeMemory)
Constructor.
Definition: MSVehicle.cpp:157
MSAbstractLaneChangeModel & getLaneChangeModel()
Definition: MSVehicle.cpp:2702
MSCFModel::VehicleVariables * myCFVariables
The per vehicle variables of the car following model.
Definition: MSVehicle.h:1619
const MSCFModel & getCarFollowModel() const
Returns the vehicle type's car following model definition (const version)
Performs lane changing of vehicles.
Right blinker lights are switched on.
Definition: MSVehicle.h:1000
MSChargingStation * chargingStation
(Optional) charging station if one is assigned to the stop
Definition: MSVehicle.h:788
SUMOReal nextOccupation
As occupation, but without the first lane.
Definition: MSVehicle.h:679
SUMOReal getLateralPositionOnLane() const
Get the vehicle's lateral position on the lane.
Definition: MSVehicle.h:406
SUMOReal getElectricityConsumption() const
Returns electricity consumption of the current state.
Definition: MSVehicle.cpp:3195
SUMOTime getMemorySize() const
Definition: MSVehicle.h:195
std::vector< std::pair< SUMOTime, int > > myLaneTimeLine
The lane usage time line to apply.
Definition: MSVehicle.h:1299
int getContainerNumber() const
Returns the number of containers.
Definition: MSVehicle.cpp:3275
WaitingTimeCollector & operator=(const WaitingTimeCollector &wt)
Assignment operator.
Definition: MSVehicle.cpp:162
SUMOReal influenceSpeed(SUMOTime currentTime, SUMOReal speed, SUMOReal vSafe, SUMOReal vMin, SUMOReal vMax)
Applies stored velocity information on the speed to use.
Definition: MSVehicle.cpp:279
bool operator!=(const State &state)
Operator !=.
Definition: MSVehicle.cpp:138
static std::vector< MSTransportable * > myEmptyTransportableVector
Definition: MSVehicle.h:1450
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:671
void checkRewindLinkLanes(const SUMOReal lengthsInFront, DriveItemVector &lfLinks) const
Definition: MSVehicle.cpp:2284
Left blinker lights are switched on.
Definition: MSVehicle.h:1002
void setEmergencyBrakeRedLight(bool value)
Sets whether red lights shall be a reason to brake.
Definition: MSVehicle.cpp:428
SUMOReal computeAngle() const
compute the current vehicle angle
Definition: MSVehicle.cpp:823
DriveProcessItem(SUMOReal vWait, SUMOReal distance)
constructor if the link shall not be passed
Definition: MSVehicle.h:1521
SUMOReal implicitSpeedVTD(const MSVehicle *veh, SUMOReal oldSpeed)
return the speed that is implicit in the new VTD position
Definition: MSVehicle.cpp:498
The wipers are on.
Definition: MSVehicle.h:1016
SUMOReal getLateralOverlap() const
return the amount by which the vehicle extends laterally outside it's primary lane ...
Definition: MSVehicle.cpp:3442
void workOnMoveReminders(SUMOReal oldPos, SUMOReal newPos, SUMOReal newSpeed)
Processes active move reminder.
Definition: MSVehicle.cpp:716
SUMOReal getMaxSpeedOnLane() const
Returns the maximal speed for the vehicle on its current lane (including speed factor and deviation...
Definition: MSVehicle.h:497
vehicle want's to change to right lane
Definition: MSVehicle.h:227
void removeApproachingInformation(DriveItemVector &lfLinks) const
unregister approach from all upcoming links
Definition: MSVehicle.cpp:3449
MSStoppingPlace * containerstop
(Optional) container stop if one is assigned to the stop
Definition: MSVehicle.h:786
Stores the waiting intervals over the previous seconds (memory is to be specified in ms...
Definition: MSVehicle.h:167
PositionVector getBoundingBox() const
get bounding rectangle
Definition: MSVehicle.cpp:3514
Encapsulated SAX-Attributes.
ChangeRequest
Requests set via TraCI.
Definition: MSVehicle.h:221
const std::vector< MSLane * > & getBestLanesContinuation() const
Returns the subpart of best lanes that describes the vehicle's current lane and their successors...
Definition: MSVehicle.cpp:3048
void appendWaitingTime(SUMOTime dt)
append an amount of dt millisecs to the stored waiting times
SUMOReal lastCoveredDist() const
previous Speed of this state
Definition: MSVehicle.h:132
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:1345
SUMOReal getLastStepDist() const
Get the distance the vehicle covered in the previous timestep.
Definition: MSVehicle.h:381
bool willPass(const MSEdge *const edge) const
Returns whether the vehicle wil pass the given edge.
Definition: MSVehicle.cpp:673
SUMOReal myAngle
the angle in radians (
Definition: MSVehicle.h:1483
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:2720
SUMOTime timeToLoadNextContainer
The time at which the vehicle is able to load another container.
Definition: MSVehicle.h:812
Position myCachedPosition
Definition: MSVehicle.h:1488
const MSLane * lane
The lane to stop at.
Definition: MSVehicle.h:782
SUMOReal myOriginalSpeed
The velocity before influence.
Definition: MSVehicle.h:1302
std::vector< SUMOReal > myFurtherLanesPosLat
Definition: MSVehicle.h:1466
bool addStop(const SUMOVehicleParameter::Stop &stopPar, std::string &errorMsg, SUMOTime untilOffset=0)
Adds a stop.
Definition: MSVehicle.cpp:875
std::list< Stop > myStops
The vehicle's list of stops.
Definition: MSVehicle.h:1453
ConstMSEdgeVector::const_iterator MSRouteIterator
Definition: MSRoute.h:65
PositionVector getBoundingPoly() const
get bounding polygon
Definition: MSVehicle.cpp:3527
bool isStopped() const
Returns whether the vehicle is at a stop.
Definition: MSVehicle.cpp:1003
bool isStoppedInRange(SUMOReal pos) const
return whether the given position is within range of the current stop
Definition: MSVehicle.cpp:1021
bool myConsiderMaxDeceleration
Whether the maximum deceleration shall be regarded.
Definition: MSVehicle.h:1314
#define STEPS2TIME(x)
Definition: SUMOTime.h:65
void adaptLeaveSpeed(const SUMOReal v)
Definition: MSVehicle.h:1531
MSLane * myLane
The lane the vehicle is on.
Definition: MSVehicle.h:1440
bool getRespectJunctionPriority() const
Returns whether junction priority rules shall be respected.
Definition: MSVehicle.h:1244
bool myAmRegisteredAsWaitingForContainer
Whether this vehicle is registered as waiting for a container (for deadlock-recognition) ...
Definition: MSVehicle.h:1478
Blinker lights on both sides are switched on.
Definition: MSVehicle.h:1004
Influencer * myInfluencer
An instance of a velocity/lane influencing instance; built in "getInfluencer".
Definition: MSVehicle.h:1623
void resetRoutePosition(int index)
Definition: MSVehicle.cpp:685
std::vector< LaneQ >::iterator myCurrentLaneInBestLanes
Definition: MSVehicle.h:1448
const std::vector< MSTransportable * > & getContainers() const
retrieve riding containers
Definition: MSVehicle.cpp:3259
SUMOReal getDistanceToPosition(SUMOReal destPos, const MSEdge *destEdge) const
Definition: MSVehicle.cpp:3103
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:1650
SUMOReal getSpaceTillLastStanding(const MSLane *l, bool &foundStopped) const
Definition: MSVehicle.cpp:2264
SUMOTime duration
The stopping duration.
Definition: MSVehicle.h:794
MSVehicle()
invalidated default constructor
T MIN2(T a, T b)
Definition: StdDefs.h:69
SUMOReal myLastCoveredDist
Definition: MSVehicle.h:159
The brake lights are on.
Definition: MSVehicle.h:1006
SUMOReal getAccumulatedWaitingSeconds() const
Returns the number of seconds waited (speed was lesser than 0.1m/s) within the last millisecs...
Definition: MSVehicle.h:566
A blue emergency light is on.
Definition: MSVehicle.h:1022
A structure representing the best lanes for continuing the route.
Definition: MSVehicle.h:669
void loadState(const SUMOSAXAttributes &attrs, const SUMOTime offset)
Loads the state of this vehicle from the given description.
Definition: MSVehicle.cpp:3756
Everything is switched off.
Definition: MSVehicle.h:998
void onRemovalFromNet(const MSMoveReminder::Notification reason)
Called when the vehicle is removed from the network.
Definition: MSVehicle.cpp:601
std::set< std::string > awaitedContainers
IDs of containers the vehicle has to wait for until departing.
Definition: MSVehicle.h:808
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:396
void fixPosition()
repair errors in vehicle position after changing between internal edges
Definition: MSVehicle.cpp:3095
SUMOTime myWaitingTime
The time the vehicle waits (is not faster than 0.1m/s) in seconds.
Definition: MSVehicle.h:1430
One of the left doors is opened.
Definition: MSVehicle.h:1018
LaneChangeMode mySpeedGainLC
lane changing to travel with higher speed
Definition: MSVehicle.h:1338
void planMoveInternal(const SUMOTime t, MSLeaderInfo ahead, DriveItemVector &lfLinks, SUMOReal &myStopDist) const
Definition: MSVehicle.cpp:1277
bool isParking() const
Returns whether the vehicle is parking.
Definition: MSVehicle.cpp:1009
LaneChangeMode myCooperativeLC
lane changing with the intent to help other vehicles
Definition: MSVehicle.h:1336
const std::vector< LaneQ > & getBestLanes() const
Returns the description of best lanes to use in order to continue the route.
Definition: MSVehicle.cpp:2714
int getRoutePosition() const
Definition: MSVehicle.cpp:679
void setVTDControlled(Position xyPos, MSLane *l, SUMOReal pos, SUMOReal posLat, SUMOReal angle, int edgeOffset, const ConstMSEdgeVector &route, SUMOTime t)
Definition: MSVehicle.cpp:445
bool knowsEdgeTest(MSEdge &edge) const
State(SUMOReal pos, SUMOReal speed, SUMOReal posLat, SUMOReal backPos)
Constructor.
Definition: MSVehicle.cpp:148
int getPersonNumber() const
Returns the number of persons.
Definition: MSVehicle.cpp:3269
bool allowsContinuation
Whether this lane allows to continue the drive.
Definition: MSVehicle.h:683
SUMOReal getHarmonoise_NoiseEmissions() const
Returns noise emissions of the current state.
Definition: MSVehicle.cpp:3201
const std::vector< MSTransportable * > & getPersons() const
retrieve riding persons
Definition: MSVehicle.cpp:3249
Container that holds the vehicles driving state (position+speed).
Definition: MSVehicle.h:92
void saveState(OutputDevice &out)
Saves the states of a vehicle.
Definition: MSVehicle.cpp:3741
SUMOReal getOriginalSpeed() const
Returns the originally longitudinal speed to use.
Definition: MSVehicle.h:1272
MSCFModel::VehicleVariables * getCarFollowVariables() const
Returns the vehicle's car following model variables.
Definition: MSVehicle.h:767
SUMOReal getNOxEmissions() const
Returns NOx emission of the current state.
Definition: MSVehicle.cpp:3177
SUMOReal getRightSideOnLane() const
Get the vehicle's lateral position on the lane:
Definition: MSVehicle.cpp:3355
bool myEmergencyBrakeRedLight
Whether red lights are a reason to brake.
Definition: MSVehicle.h:1320
MSEdgeWeightsStorage & _getWeightsStorage() const
Definition: MSVehicle.cpp:706
Influencer()
Constructor.
Definition: MSVehicle.cpp:235
ConstMSEdgeVector myVTDRoute
Definition: MSVehicle.h:1328
virtual void drawOutsideNetwork(bool)
register vehicle for drawing while outside the network
Definition: MSVehicle.h:1430
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:2653
SUMOReal getMaxAccel() const
Get the vehicle type's maximum acceleration [m/s^2].
Definition: MSCFModel.h:193
SUMOReal getPMxEmissions() const
Returns PMx emission of the current state.
Definition: MSVehicle.cpp:3183
SUMOReal getCOEmissions() const
Returns CO emission of the current state.
Definition: MSVehicle.cpp:3165
Abstract in-vehicle device.
Definition: MSDevice.h:69
void updateOccupancyAndCurrentBestLane(const MSLane *startLane)
updates LaneQ::nextOccupation and myCurrentLaneInBestLanes
Definition: MSVehicle.cpp:3031
const std::vector< SUMOReal > & getFurtherLanesPosLat() const
Definition: MSVehicle.h:658
void setEmergencyBlueLight(SUMOTime currentTime)
sets the blue flashing light for emergency vehicles
Definition: MSVehicle.cpp:3318
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:3399
vehicle want's to change to left lane
Definition: MSVehicle.h:225
~Influencer()
Destructor.
Definition: MSVehicle.cpp:252
const std::vector< MSLane * > & getFurtherLanes() const
Definition: MSVehicle.h:654
void setSpeedTimeLine(const std::vector< std::pair< SUMOTime, SUMOReal > > &speedTimeLine)
Sets a new velocity timeline.
Definition: MSVehicle.cpp:256
MSVehicle & operator=(const MSVehicle &)
invalidated assignment operator
Influencer & getInfluencer()
Returns the velocity/lane influencer.
Definition: MSVehicle.cpp:3690
Structure representing possible vehicle parameter.
Definition of vehicle stop (position and duration)
bool getEmergencyBrakeRedLight() const
Returns whether red lights shall be a reason to brake.
Definition: MSVehicle.h:1258
LaneChangeMode mySublaneLC
changing to the prefered lateral alignment
Definition: MSVehicle.h:1342
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:545
std::vector< std::pair< SUMOTime, SUMOReal > > mySpeedTimeLine
The velocity time line to apply.
Definition: MSVehicle.h:1296
SUMOReal getSlope() const
Returns the slope of the road at vehicle's position.
Definition: MSVehicle.cpp:765
bool containerTriggered
whether an arriving container lets the vehicle continue
Definition: MSVehicle.h:800
void setConsiderMaxDeceleration(bool value)
Sets whether the maximum deceleration shall be regarded.
Definition: MSVehicle.cpp:416
void setVTDState(Position xyPos)
sets position outside the road network
Definition: MSVehicle.cpp:3727
SUMOTime getLastAccessTimeStep() const
Definition: MSVehicle.h:1278
void passTime(SUMOTime dt, bool waiting)
Definition: MSVehicle.cpp:197
SUMOReal occupation
The overall vehicle sum on consecutive lanes which can be passed without a lane change.
Definition: MSVehicle.h:677
SUMOReal getAcceleration() const
Returns the vehicle's acceleration in m/s (this is computed as the last step's mean acceleration in c...
Definition: MSVehicle.h:458
SUMOReal getCenterOnEdge(const MSLane *lane=0) const
Get the vehicle's lateral position on the edge of the given lane (or its current edge if lane == 0) ...
Definition: MSVehicle.cpp:3367
int mySignals
State of things of the vehicle that can be on or off.
Definition: MSVehicle.h:1469
std::vector< MSLane * > bestContinuations
Consecutive lane that can be followed without a lane change (contribute to length and occupation) ...
Definition: MSVehicle.h:685
Definition of vehicle stop (position and duration)
bool operator!=(const WaitingTimeCollector &wt) const
Operator !=.
std::set< std::string > awaitedPersons
IDs of persons the vehicle has to wait for until departing.
Definition: MSVehicle.h:806
SUMOReal myPreviousSpeed
the speed at the begin of the previous time step
Definition: MSVehicle.h:153
SUMOReal getFuelConsumption() const
Returns fuel consumption of the current state.
Definition: MSVehicle.cpp:3189
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:1614
const MSVehicleType & getVehicleType() const
Returns the vehicle's type definition.
SUMOTime until
The time at which the vehicle may continue its journey.
Definition: MSVehicle.h:796
void setConsiderSafeVelocity(bool value)
Sets whether the safe velocity shall be regarded.
Definition: MSVehicle.cpp:404
const ConstMSEdgeVector getStopEdges() const
Returns the list of still pending stop edges.
Definition: MSVehicle.cpp:1216
MSRouteIterator edge
The edge in the route to stop at.
Definition: MSVehicle.h:780
const waitingIntervalList & getWaitingIntervals() const
Definition: MSVehicle.h:200
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:3597
SUMOReal getSpeed() const
Returns the vehicle's current speed.
Definition: MSVehicle.h:441
bool isFrontOnLane(const MSLane *lane) const
Returns the information whether the front of the vehicle is on the given lane.
Definition: MSVehicle.cpp:2258
void setLaneChangeMode(int value)
Sets lane changing behavior.
Definition: MSVehicle.cpp:434
SUMOReal myPos
the stored position
Definition: MSVehicle.h:139
SUMOReal getWaitingSeconds() const
Returns the number of seconds waited (speed was lesser than 0.1m/s)
Definition: MSVehicle.h:556
bool isStoppedTriggered() const
Returns whether the vehicle is on a triggered stop.
Definition: MSVehicle.cpp:1015
waitingIntervalList myWaitingIntervals
Definition: MSVehicle.h:211
static SUMOTime gWaitingTimeMemory
length of memory for waiting times (in millisecs)
Definition: MSGlobals.h:110
std::vector< DriveProcessItem > DriveItemVector
Container for used Links/visited Lanes during lookForward.
Definition: MSVehicle.h:1544
SUMOReal nextStopDist() const
return the distance to the next stop or SUMORealMax if there is none.
Definition: MSVehicle.h:849
SUMOReal endPos
The stopping position end.
Definition: MSVehicle.h:792
const MSEdge * getRerouteOrigin() const
Returns the starting point for reroutes (usually the current edge)
Definition: MSVehicle.cpp:802
SUMOReal getPreviousSpeed() const
Returns the vehicle's speed before the previous time step.
Definition: MSVehicle.h:449
vehicle want's to keep the current lane
Definition: MSVehicle.h:229
int getSignals() const
Returns the signals.
Definition: MSVehicle.h:1069
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:71
SUMOReal myPosLat
the stored lateral position
Definition: MSVehicle.h:145
#define SUMOReal
Definition: config.h:214
void switchOffSignal(int signal)
Switches the given signal off.
Definition: MSVehicle.h:1061
static bool gSemiImplicitEulerUpdate
Definition: MSGlobals.h:63
void switchOnSignal(int signal)
Switches the given signal on.
Definition: MSVehicle.h:1053
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:3207
static std::vector< MSLane * > myEmptyLaneVector
Definition: MSVehicle.h:1449
void adaptBestLanesOccupation(int laneIndex, SUMOReal density)
update occupation from MSLaneChanger
Definition: MSVehicle.cpp:3087
static bool overlap(const MSVehicle *veh1, const MSVehicle *veh2)
Definition: MSVehicle.h:586
SUMOReal myBackPos
the stored back position
Definition: MSVehicle.h:150
int getSpeedMode() const
return the current speed mode
Definition: MSVehicle.cpp:269
SUMOTime cumulatedWaitingTime(SUMOTime memory=-1) const
Definition: MSVehicle.cpp:176
void setLaneTimeLine(const std::vector< std::pair< SUMOTime, int > > &laneTimeLine)
Sets a new lane timeline.
Definition: MSVehicle.cpp:263
virtual ~MSVehicle()
Destructor.
Definition: MSVehicle.cpp:578
SUMOReal getVehicleMaxSpeed(const SUMOVehicle *const veh) const
Returns the lane's maximum speed, given a vehicle'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:509
bool mySpeedAdaptationStarted
Whether influencing the speed has already started.
Definition: MSVehicle.h:1305
MSLane * getLane() const
Returns the lane the vehicle is on.
Definition: MSVehicle.h:487
int influenceChangeDecision(int state)
allow TraCI to influence a lane change decision
Definition: MSVehicle.cpp:3714
void activateReminders(const MSMoveReminder::Notification reason)
"Activates" all current move reminder
Definition: MSVehicle.cpp:2492
SUMOReal getTimeGap() const
Returns the time gap in seconds to the leader of the vehicle looking for a fixed distance.
Definition: MSVehicle.cpp:3149
int influenceChangeDecision(const SUMOTime currentTime, const MSEdge &currentEdge, const int currentLaneIndex, int state)
Applies stored LaneChangeMode information and laneTimeLine.
Definition: MSVehicle.cpp:312
SUMOReal getBackPositionOnLane() const
Get the vehicle's position relative to its current lane.
Definition: MSVehicle.h:398
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:3564
SUMOReal startPos
The stopping position start.
Definition: MSVehicle.h:790
A red emergency light is on.
Definition: MSVehicle.h:1024
MSStoppingPlace * busstop
(Optional) bus stop if one is assigned to the stop
Definition: MSVehicle.h:784
Representation of a lane in the micro simulation.
Definition: MSLane.h:79
const MSEdgeWeightsStorage & getWeightsStorage() const
Returns the vehicle's internal edge travel times/efforts container.
Definition: MSVehicle.cpp:694
void adaptLaneEntering2MoveReminder(const MSLane &enteredLane)
Adapts the vehicle's entering of a new lane.
Definition: MSVehicle.cpp:745
LaneChangeMode myStrategicLC
lane changing which is necessary to follow the current route
Definition: MSVehicle.h:1334
bool isVTDAffected(SUMOTime t) const
Definition: MSVehicle.cpp:464
One of the right doors is opened.
Definition: MSVehicle.h:1020
Interface for lane-change models.
int getBestLaneOffset() const
returns the current offset from the best lane
Definition: MSVehicle.cpp:3077
SUMOReal posLat() const
Lateral Position of this state (m relative to the centerline of the lane).
Definition: MSVehicle.h:122
bool myConsiderSafeVelocity
Whether the safe velocity shall be regarded.
Definition: MSVehicle.h:1308
void setConsiderMaxAcceleration(bool value)
Sets whether the maximum acceleration shall be regarded.
Definition: MSVehicle.cpp:410
MSDevice_Transportable * myContainerDevice
The containers this vehicle may have.
Definition: MSVehicle.h:1459
The fog lights are on (no visualisation)
Definition: MSVehicle.h:1010
bool parking
whether the vehicle is removed from the net while stopping
Definition: MSVehicle.h:802
SUMOReal getAngle() const
Returns the vehicle's direction in radians.
Definition: MSVehicle.h:574
A yellow emergency light is on.
Definition: MSVehicle.h:1026
const Position getBackPosition() const
Definition: MSVehicle.cpp:851
SUMOReal getDeltaPos(SUMOReal accel)
calculates the distance covered in the next integration step given an acceleration and assuming the c...
Definition: MSVehicle.cpp:1670