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:
101  State(double pos, double speed, double posLat, double backPos);
102 
104  State(const State& state);
105 
107  State& operator=(const State& state);
108 
110  bool operator!=(const State& state);
111 
113  double pos() const {
114  return myPos;
115  }
116 
118  double speed() const {
119  return mySpeed;
120  };
121 
123  double posLat() const {
124  return myPosLat;
125  }
126 
128  double backPos() const {
129  return myBackPos;
130  }
131 
133  double lastCoveredDist() const {
134  return myLastCoveredDist;
135  }
136 
137 
138  private:
140  double myPos;
141 
143  double mySpeed;
144 
146  double myPosLat;
147 
149  // if the vehicle occupies multiple lanes, this is the position relative
150  // to the lane occupied by its back
151  double myBackPos;
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 double 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(double oldPos, double newPos, double newSpeed);
323 
324 
342  void planMove(const SUMOTime t, const MSLeaderInfo& ahead, const double lengthsInFront);
343 
344 
357  bool executeMove();
358 
359 
366  double getDeltaPos(double accel);
367 
368 
370 
371 
375  double getPositionOnLane() const {
376  return myState.myPos;
377  }
378 
382  double getLastStepDist() const {
383  return myState.lastCoveredDist();
384  }
385 
389  double getPositionOnLane(const MSLane* lane) const;
390 
394  double getBackPositionOnLane(const MSLane* lane) const;
395 
399  double getBackPositionOnLane() const {
401  }
402 
407  double getLateralPositionOnLane() const {
408  return myState.myPosLat;
409  }
410 
415  double getRightSideOnLane() const;
416 
418  double getLateralOverlap() const;
419 
425  double getRightSideOnEdge(const MSLane* lane = 0) const;
426 
432  double getCenterOnEdge(const MSLane* lane = 0) const;
433 
437  double getLatOffset(const MSLane* lane) const;
438 
442  double getSpeed() const {
443  return myState.mySpeed;
444  }
445 
446 
450  double getPreviousSpeed() const {
451  return myState.myPreviousSpeed;
452  }
453 
454 
459  double getAcceleration() const {
460  return myAcceleration;
461  }
463 
464 
465 
467 
468 
472  double getSlope() const;
473 
474 
482  Position getPosition(const double offset = 0) const;
483 
484 
488  MSLane* getLane() const {
489  return myLane;
490  }
491 
492 
497  double
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 
570  double getWaitingSeconds() const {
571  return STEPS2TIME(myWaitingTime);
572  }
573 
574 
582  }
583 
586  double getTimeLossSeconds() const {
587  return STEPS2TIME(myTimeLoss);
588  }
589 
590 
594  double getAngle() const {
595  return myAngle;
596  }
597 
598 
603  return Position(std::cos(myAngle) * myState.speed(), std::sin(myAngle) * myState.speed());
604  }
606 
608  double computeAngle() const;
609 
611  void setAngle(double angle);
612 
614  static bool overlap(const MSVehicle* veh1, const MSVehicle* veh2) {
615  if (veh1->myState.myPos < veh2->myState.myPos) {
616  return veh2->myState.myPos - veh2->getVehicleType().getLengthWithGap() < veh1->myState.myPos;
617  }
618  return veh1->myState.myPos - veh1->getVehicleType().getLengthWithGap() < veh2->myState.myPos;
619  }
620 
621 
624  bool congested() const {
625  return myState.mySpeed < double(60) / double(3.6);
626  }
627 
628 
640  void activateReminders(const MSMoveReminder::Notification reason, const MSLane* enteredLane = 0);
641 
648  bool enterLaneAtMove(MSLane* enteredLane, bool onTeleporting = false);
649 
650 
651 
660  void enterLaneAtInsertion(MSLane* enteredLane, double pos, double speed, double posLat,
661  MSMoveReminder::Notification notification);
662 
667  void setTentativeLaneAndPosition(MSLane* lane, double pos, double posLat = 0);
668 
673  void enterLaneAtLaneChange(MSLane* enteredLane);
674 
675 
677  void leaveLane(const MSMoveReminder::Notification reason, const MSLane* approachedLane = 0);
678 
679 
682 
683  const std::vector<MSLane*>& getFurtherLanes() const {
684  return myFurtherLanes;
685  }
686 
687  const std::vector<double>& getFurtherLanesPosLat() const {
688  return myFurtherLanesPosLat;
689  }
690 
691 
693  bool onFurtherEdge(const MSEdge* edge) const;
694 
697 
698  //
702  struct LaneQ {
706  double length;
710  double occupation;
717  /* @brief Longest sequence of (normal-edge) lanes that can be followed without a lane change
718  * The 'length' attribute is the sum of these lane lengths
719  * (There may be alternative sequences that have equal length)
720  * It is the 'best' in the strategic sense of reducing required lane-changes
721  */
722  std::vector<MSLane*> bestContinuations;
723  };
724 
728  const std::vector<LaneQ>& getBestLanes() const;
729 
747  void updateBestLanes(bool forceRebuild = false, const MSLane* startLane = 0);
748 
749 
753  const std::vector<MSLane*>& getBestLanesContinuation() const;
754 
755 
759  const std::vector<MSLane*>& getBestLanesContinuation(const MSLane* const l) const;
760 
761  /* @brief returns the current signed offset from the lane that is most
762  * suited for continuing the current route (in the strategic sense of reducing lane-changes)
763  * - 0 if the vehicle is one it's best lane
764  * - negative if the vehicle should change to the right
765  * - positive if the vehicle should change to the left
766  */
767  int getBestLaneOffset() const;
768 
770  void adaptBestLanesOccupation(int laneIndex, double density);
771 
773 
775  void fixPosition();
776 
777 
786  void replaceVehicleType(MSVehicleType* type);
787 
788 
796  inline const MSCFModel& getCarFollowModel() const {
797  return myType->getCarFollowModel();
798  }
799 
800 
806  return myCFVariables;
807  }
808 
810  virtual bool isSelected() const {
811  return false;
812  }
813 
815 
816 
820  struct Stop {
824  const MSLane* lane;
834  double startPos;
836  double endPos;
842  bool triggered;
846  bool parking;
848  bool reached;
850  std::set<std::string> awaitedPersons;
852  std::set<std::string> awaitedContainers;
858  bool collision;
859 
860  void write(OutputDevice& dev) const;
861 
863  double getEndPos(const SUMOVehicle& veh) const;
864  };
865 
866 
873  bool addStop(const SUMOVehicleParameter::Stop& stopPar, std::string& errorMsg, SUMOTime untilOffset = 0, bool collision = false);
874 
877  bool replaceParkingArea(MSParkingArea* parkingArea, std::string& errorMsg);
878 
879 
883 
887  bool hasStops() const {
888  return !myStops.empty();
889  }
890 
894  bool isStopped() const;
895 
899  SUMOTime collisionStopTime() const;
900 
904  bool isParking() const;
905 
909  bool isRemoteControlled() const;
910 
914  bool wasRemoteControlled(SUMOTime lookBack = DELTA_T) const;
915 
917  double nextStopDist() const {
918  return myStopDist;
919  }
920 
924  bool isStoppedTriggered() const;
925 
928  bool isStoppedInRange(double pos) const;
930 
931  bool knowsEdgeTest(MSEdge& edge) const;
932  int getLaneIndex() const;
933 
943  double getDistanceToPosition(double destPos, const MSEdge* destEdge) const;
944 
945 
953  double processNextStop(double currentVelocity);
954 
962  std::pair<const MSVehicle* const, double> getLeader(double dist = 0) const;
963 
970  double getTimeGapOnLane() const;
971 
972 
974 
975 
979  double getCO2Emissions() const;
980 
981 
985  double getCOEmissions() const;
986 
987 
991  double getHCEmissions() const;
992 
993 
997  double getNOxEmissions() const;
998 
999 
1003  double getPMxEmissions() const;
1004 
1005 
1009  double getFuelConsumption() const;
1010 
1011 
1015  double getElectricityConsumption() const;
1016 
1017 
1021  double getHarmonoise_NoiseEmissions() const;
1023 
1024 
1025 
1027 
1028 
1032  void addPerson(MSTransportable* person);
1033 
1035 
1036 
1040  void addContainer(MSTransportable* container);
1041 
1044 
1046  const std::vector<MSTransportable*>& getPersons() const;
1047 
1049  const std::vector<MSTransportable*>& getContainers() const;
1050 
1054  int getPersonNumber() const;
1055 
1059  int getContainerNumber() const;
1060 
1063 
1067  enum Signalling {
1098  };
1099 
1100 
1106  LC_NEVER = 0, // lcModel shall never trigger changes at this level
1107  LC_NOCONFLICT = 1, // lcModel may trigger changes if not in conflict with TraCI request
1108  LC_ALWAYS = 2 // lcModel may always trigger changes of this level regardless of requests
1109  };
1110 
1111 
1114  LCP_ALWAYS = 0, // change regardless of blockers, adapt own speed and speed of blockers
1115  LCP_NOOVERLAP = 1, // change unless overlapping with blockers, adapt own speed and speed of blockers
1116  LCP_URGENT = 2, // change if not blocked, adapt own speed and speed of blockers
1117  LCP_OPPORTUNISTIC = 3 // change if not blocked
1118  };
1119 
1120 
1124  void switchOnSignal(int signal) {
1125  mySignals |= signal;
1126  }
1127 
1128 
1132  void switchOffSignal(int signal) {
1133  mySignals &= ~signal;
1134  }
1135 
1136 
1140  int getSignals() const {
1141  return mySignals;
1142  }
1143 
1144 
1149  bool signalSet(int which) const {
1150  return (mySignals & which) != 0;
1151  }
1153 
1154 
1156  bool unsafeLinkAhead(const MSLane* lane) const;
1157 
1158 
1159 #ifndef NO_TRACI
1160 
1167  double getSpeedWithoutTraciInfluence() const;
1168 
1181  bool addTraciStop(MSLane* const lane, const double startPos, const double endPos, const SUMOTime duration, const SUMOTime until,
1182  const bool parking, const bool triggered, const bool containerTriggered, std::string& errorMsg);
1183 
1195  bool addTraciStopAtStoppingPlace(const std::string& stopId, const SUMOTime duration, const SUMOTime until, const bool parking,
1196  const bool triggered, const bool containerTriggered, const SumoXMLTag stoppingPlaceType, std::string& errorMsg);
1197 
1202  Stop& getNextStop();
1203 
1208  bool resumeFromStopping();
1209 
1210 
1212  double updateFurtherLanes(std::vector<MSLane*>& furtherLanes,
1213  std::vector<double>& furtherLanesPosLat,
1214  const std::vector<MSLane*>& passedLanes);
1215 
1218 
1221 
1234  class Influencer {
1235  public:
1237  Influencer();
1238 
1239 
1241  ~Influencer();
1242 
1243 
1247  void setSpeedTimeLine(const std::vector<std::pair<SUMOTime, double> >& speedTimeLine);
1248 
1249 
1253  void setLaneTimeLine(const std::vector<std::pair<SUMOTime, int> >& laneTimeLine);
1254 
1258  void setSublaneChange(double latDist);
1259 
1261  int getSpeedMode() const;
1262 
1274  double influenceSpeed(SUMOTime currentTime, double speed, double vSafe, double vMin, double vMax);
1275 
1283  int influenceChangeDecision(const SUMOTime currentTime, const MSEdge& currentEdge, const int currentLaneIndex, int state);
1284 
1285 
1291  double changeRequestRemainingSeconds(const SUMOTime currentTime) const;
1292 
1296  inline bool getRespectJunctionPriority() const {
1297  return myRespectJunctionPriority;
1298  }
1299 
1300 
1304  inline bool getEmergencyBrakeRedLight() const {
1305  return myEmergencyBrakeRedLight;
1306  }
1307 
1311  void setSpeedMode(int speedMode);
1312 
1316  void setLaneChangeMode(int value);
1317 
1318 
1322  double getOriginalSpeed() const;
1323 
1324  void setVTDControlled(Position xyPos, MSLane* l, double pos, double posLat, double angle, int edgeOffset, const ConstMSEdgeVector& route, SUMOTime t);
1325 
1327  return myLastVTDAccess;
1328  }
1329 
1330  void postProcessVTD(MSVehicle* v);
1331 
1333  double implicitSpeedVTD(const MSVehicle* veh, double oldSpeed);
1334 
1336  double implicitDeltaPosVTD(const MSVehicle* veh);
1337 
1338  bool isVTDControlled() const;
1339 
1340  bool isVTDAffected(SUMOTime t) const;
1341 
1342  void setSignals(int signals) {
1343  myTraCISignals = signals;
1344  }
1345 
1346  int getSignals() const {
1347  return myTraCISignals;
1348  }
1349 
1350  double getLatDist() const {
1351  return myLatDist;
1352  }
1353 
1354  private:
1356  std::vector<std::pair<SUMOTime, double> > mySpeedTimeLine;
1357 
1359  std::vector<std::pair<SUMOTime, int> > myLaneTimeLine;
1360 
1363 
1365  double myLatDist;
1366 
1369 
1372 
1375 
1378 
1381 
1384 
1387  double myVTDPos;
1388  double myVTDPosLat;
1389  double myVTDAngle;
1393 
1395 
1396  LaneChangeMode myStrategicLC;
1407  TraciLaneChangePriority myTraciLaneChangePriority;
1409 
1410  // @brief the signals set via TraCI
1412 
1413  };
1414 
1415 
1422 
1423  const Influencer* getInfluencer() const;
1424 
1425  bool hasInfluencer() const {
1426  return myInfluencer != 0;
1427  }
1428 
1430  int influenceChangeDecision(int state);
1431 
1433  void setVTDState(Position xyPos);
1434 
1436  double getSafeFollowSpeed(const std::pair<const MSVehicle*, double> leaderInfo,
1437  const double seen, const MSLane* const lane, double distToCrossing) const;
1438 
1440  static int nextLinkPriority(const std::vector<MSLane*>& conts);
1441 
1442 #endif
1443 
1445 
1446 
1448  void saveState(OutputDevice& out);
1449 
1452  void loadState(const SUMOSAXAttributes& attrs, const SUMOTime offset);
1454 
1455 protected:
1456 
1457  double getSpaceTillLastStanding(const MSLane* l, bool& foundStopped) const;
1458 
1461 
1477  void adaptLaneEntering2MoveReminder(const MSLane& enteredLane);
1479 
1480 
1481 
1482  void setBlinkerInformation();
1483 
1486  void setEmergencyBlueLight(SUMOTime currentTime);
1487 
1489  void updateOccupancyAndCurrentBestLane(const MSLane* startLane);
1490 
1493  const ConstMSEdgeVector getStopEdges() const;
1494 
1496  virtual void drawOutsideNetwork(bool /*add*/) {};
1497 
1501 
1504 
1507 
1510 
1512 
1515 
1516  /* @brief Complex data structure for keeping and updating LaneQ:
1517  * Each element of the outer vector corresponds to an upcoming edge on the vehicles route
1518  * The first element corresponds to the current edge and is returned in getBestLanes()
1519  * The other elements are only used as a temporary structure in updateBestLanes();
1520  */
1521  std::vector<std::vector<LaneQ> > myBestLanes;
1522 
1523  /* @brief iterator to speed up retrival of the current lane's LaneQ in getBestLaneOffset() and getBestLanesContinuation()
1524  * This is updated in updateOccupancyAndCurrentBestLane()
1525  */
1526  std::vector<LaneQ>::iterator myCurrentLaneInBestLanes;
1527 
1528  static std::vector<MSLane*> myEmptyLaneVector;
1529  static std::vector<MSTransportable*> myEmptyTransportableVector;
1530 
1532  std::list<Stop> myStops;
1533 
1536 
1539 
1542 
1544  std::vector<MSLane*> myFurtherLanes;
1545  std::vector<double> myFurtherLanesPosLat;
1546 
1549 
1552 
1555 
1558 
1560 
1562  double myAngle;
1563 
1565  double myStopDist;
1566 
1569 
1571 
1572 protected:
1575  double myVLinkPass;
1576  double myVLinkWait;
1582  double myDistance;
1583  double accelV;
1586 
1587  DriveProcessItem(MSLink* link, double vPass, double vWait, bool setRequest,
1588  SUMOTime arrivalTime, double arrivalSpeed,
1589  SUMOTime arrivalTimeBraking, double arrivalSpeedBraking,
1590  double distance,
1591  double leaveSpeed = -1.) :
1592  myLink(link), myVLinkPass(vPass), myVLinkWait(vWait), mySetRequest(setRequest),
1593  myArrivalTime(arrivalTime), myArrivalSpeed(arrivalSpeed),
1594  myArrivalTimeBraking(arrivalTimeBraking), myArrivalSpeedBraking(arrivalSpeedBraking),
1595  myDistance(distance),
1596  accelV(leaveSpeed), hadVehicle(false), availableSpace(-1.) {
1597  assert(vWait >= 0 || !MSGlobals::gSemiImplicitEulerUpdate);
1598  assert(vPass >= 0 || !MSGlobals::gSemiImplicitEulerUpdate);
1599  };
1600 
1601 
1603  DriveProcessItem(double vWait, double distance) :
1604  myLink(0), myVLinkPass(vWait), myVLinkWait(vWait), mySetRequest(false),
1605  myArrivalTime(0), myArrivalSpeed(0),
1606  myArrivalTimeBraking(0), myArrivalSpeedBraking(0),
1607  myDistance(distance),
1608  accelV(-1), hadVehicle(false), availableSpace(-1.) {
1609  assert(vWait >= 0 || !MSGlobals::gSemiImplicitEulerUpdate);
1610  };
1611 
1612 
1613  inline void adaptLeaveSpeed(const double v) {
1614  if (accelV < 0) {
1615  accelV = v;
1616  } else {
1617  accelV = MIN2(accelV, v);
1618  }
1619  }
1620  inline double getLeaveSpeed() const {
1621  return accelV < 0 ? myVLinkPass : accelV;
1622  }
1623  };
1624 
1626  typedef std::vector< DriveProcessItem > DriveItemVector;
1627  DriveItemVector myLFLinkLanes;
1628 
1630  void planMoveInternal(const SUMOTime t, MSLeaderInfo ahead, DriveItemVector& lfLinks, double& myStopDist) const;
1631 
1633  void checkRewindLinkLanes(const double lengthsInFront, DriveItemVector& lfLinks) const;
1634 
1636  void removeApproachingInformation(DriveItemVector& lfLinks) const;
1637 
1638 
1640  inline double estimateLeaveSpeed(const MSLink* const link, const double vLinkPass) const {
1641  // estimate leave speed for passing time computation
1642  // l=linkLength, a=accel, t=continuousTime, v=vLeave
1643  // l=v*t + 0.5*a*t^2, solve for t and multiply with a, then add v
1644  return MIN2(link->getViaLaneOrLane()->getVehicleMaxSpeed(this),
1646  }
1647 
1648 
1649  /* @brief adapt safe velocity in accordance to a moving obstacle:
1650  * - a leader vehicle
1651  * - a vehicle or pedestrian that crosses this vehicles path on an upcoming intersection
1652  * @param[in] leaderInfo The leading vehicle and the (virtual) distance to it
1653  * @param[in] seen the distance to the end of the current lane
1654  * @param[in] lastLink the lastLink index
1655  * @param[in] lane The current Lane the vehicle is on
1656  * @param[in,out] the safe velocity for driving
1657  * @param[in,out] the safe velocity for arriving at the next link
1658  * @param[in] distToCrossing The distance to the crossing point with the current leader where relevant or -1
1659  */
1660  void adaptToLeader(const std::pair<const MSVehicle*, double> leaderInfo,
1661  const double seen, DriveProcessItem* const lastLink,
1662  const MSLane* const lane, double& v, double& vLinkPass,
1663  double distToCrossing = -1) const;
1664 
1665  /* @brief adapt safe velocity in accordance to multiple vehicles ahead:
1666  * @param[in] ahead The leader information according to the current lateral-resolution
1667  * @param[in] latOffset the lateral offset for locating the ego vehicle on the given lane
1668  * @param[in] seen the distance to the end of the current lane
1669  * @param[in] lastLink the lastLink index
1670  * @param[in] lane The current Lane the vehicle is on
1671  * @param[in,out] the safe velocity for driving
1672  * @param[in,out] the safe velocity for arriving at the next link
1673  */
1674  void adaptToLeaders(const MSLeaderInfo& ahead,
1675  double latOffset,
1676  const double seen, DriveProcessItem* const lastLink,
1677  const MSLane* const lane, double& v, double& vLinkPass) const;
1678 
1680  void checkLinkLeader(const MSLink* link, const MSLane* lane, double seen,
1681  DriveProcessItem* const lastLink, double& v, double& vLinkPass, double& vLinkWait, bool& setRequest) const;
1682 
1683 
1684  // @brief return the lane on which the back of this vehicle resides
1685  const MSLane* getBackLane() const;
1686 
1687  // @brief get the position of the back bumper;
1688  const Position getBackPosition() const;
1689 
1697  void updateState(double vNext);
1698 
1699 private:
1700  /* @brief The vehicle's knowledge about edge efforts/travel times; @see MSEdgeWeightsStorage
1701  * @note member is initialized on first access */
1703 
1706 
1707 #ifndef NO_TRACI
1710 #endif
1711 
1712 private:
1714  MSVehicle();
1715 
1717  MSVehicle(const MSVehicle&);
1718 
1720  MSVehicle& operator=(const MSVehicle&);
1721 
1723 
1724 };
1725 
1726 
1727 #endif
1728 
1729 /****************************************************************************/
1730 
double myPos
the stored position
Definition: MSVehicle.h:140
int getRoutePosition() const
Definition: MSVehicle.cpp:678
bool getRespectJunctionPriority() const
Returns whether junction priority rules shall be respected.
Definition: MSVehicle.h:1296
void adaptToLeader(const std::pair< const MSVehicle *, double > leaderInfo, const double seen, DriveProcessItem *const lastLink, const MSLane *const lane, double &v, double &vLinkPass, double distToCrossing=-1) const
Definition: MSVehicle.cpp:1773
double myLatDist
The requested lateral change.
Definition: MSVehicle.h:1365
A lane area vehicles can halt at.
Definition: MSParkingArea.h:66
void setAngle(double angle)
Set a custom vehicle angle in rad.
Definition: MSVehicle.cpp:822
void adaptToLeaders(const MSLeaderInfo &ahead, double latOffset, const double seen, DriveProcessItem *const lastLink, const MSLane *const lane, double &v, double &vLinkPass) const
Definition: MSVehicle.cpp:1738
void checkLinkLeader(const MSLink *link, const MSLane *lane, double seen, DriveProcessItem *const lastLink, double &v, double &vLinkPass, double &vLinkWait, bool &setRequest) const
checks for link leaders on the given link
Definition: MSVehicle.cpp:1809
const MSLane * myLastBestLanesInternalLane
Definition: MSVehicle.h:1514
double getLengthWithGap() const
Get vehicle&#39;s length including the minimum gap [m].
double computeAngle() const
compute the current vehicle angle
Definition: MSVehicle.cpp:828
double getFuelConsumption() const
Returns fuel consumption of the current state.
Definition: MSVehicle.cpp:3418
const MSVehicleType * myType
This Vehicle&#39;s type.
void replaceVehicleType(MSVehicleType *type)
Replaces the current vehicle type by the one given.
Definition: MSVehicle.cpp:3572
double getAccumulatedWaitingSeconds() const
Returns the number of seconds waited (speed was lesser than 0.1m/s) within the last millisecs...
Definition: MSVehicle.h:580
int getSignals() const
Definition: MSVehicle.h:1346
double getVehicleMaxSpeed(const SUMOVehicle *const veh) const
Returns the lane&#39;s maximum speed, given a vehicle&#39;s speed limit adaptation.
Definition: MSLane.h:462
SumoXMLTag
Numbers representing SUMO-XML - element names.
double getNOxEmissions() const
Returns NOx emission of the current state.
Definition: MSVehicle.cpp:3406
bool enterLaneAtMove(MSLane *enteredLane, bool onTeleporting=false)
Update when the vehicle enters a new lane in the move step.
Definition: MSVehicle.cpp:2732
std::list< std::pair< SUMOTime, SUMOTime > > waitingIntervalList
Definition: MSVehicle.h:171
double myAngle
the angle in radians (
Definition: MSVehicle.h:1562
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:83
MSCFModel::VehicleVariables * getCarFollowVariables() const
Returns the vehicle&#39;s car following model variables.
Definition: MSVehicle.h:805
bool isRemoteControlled() const
Returns the information whether the vehicle is fully controlled via TraCI.
Definition: MSVehicle.cpp:4037
SUMOTime timeToBoardNextPerson
The time at which the vehicle is able to board another person.
Definition: MSVehicle.h:854
double getElectricityConsumption() const
Returns electricity consumption of the current state.
Definition: MSVehicle.cpp:3424
double getPreviousSpeed() const
Returns the vehicle&#39;s speed before the previous time step.
Definition: MSVehicle.h:450
double backPos() const
back Position of this state
Definition: MSVehicle.h:128
double getAngle() const
Returns the vehicle&#39;s direction in radians.
Definition: MSVehicle.h:594
MSEdgeWeightsStorage * myEdgeWeights
Definition: MSVehicle.h:1702
PositionVector getBoundingPoly() const
get bounding polygon
Definition: MSVehicle.cpp:3766
static int nextLinkPriority(const std::vector< MSLane *> &conts)
get a numerical value for the priority of the upcoming link
Definition: MSVehicle.cpp:3243
SUMOTime getWaitingTime() const
Returns the SUMOTime waited (speed was lesser than 0.1m/s)
Definition: MSVehicle.h:536
const MSEdge * myLastBestLanesEdge
Definition: MSVehicle.h:1513
LaneChangeMode
modes for resolving conflicts between external control (traci) and vehicle control over lane changing...
Definition: MSVehicle.h:1105
void enterLaneAtInsertion(MSLane *enteredLane, double pos, double speed, double posLat, MSMoveReminder::Notification notification)
Update when the vehicle enters a new lane in the emit step.
Definition: MSVehicle.cpp:2816
MSAbstractLaneChangeModel * myLaneChangeModel
Definition: MSVehicle.h:1511
bool myAmOnNet
Whether the vehicle is on the network (not parking, teleported, vaporized, or arrived) ...
Definition: MSVehicle.h:1551
double getWaitingSeconds() const
Returns the number of seconds waited (speed was lesser than 0.1m/s)
Definition: MSVehicle.h:570
LaneChangeMode myRightDriveLC
changing to the rightmost lane
Definition: MSVehicle.h:1403
std::vector< std::vector< LaneQ > > myBestLanes
Definition: MSVehicle.h:1521
std::vector< MSLane * > myFurtherLanes
The information into which lanes the vehicle laps into.
Definition: MSVehicle.h:1544
Position getVelocityVector() const
Returns the vehicle&#39;s direction in radians.
Definition: MSVehicle.h:602
State myState
This Vehicles driving state (pos and speed)
Definition: MSVehicle.h:1506
double myOriginalSpeed
The velocity before influence.
Definition: MSVehicle.h:1362
Stop & getNextStop()
Definition: MSVehicle.cpp:3987
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:1031
DriveItemVector myLFLinkLanes
Definition: MSVehicle.h:1627
bool resumeFromStopping()
Definition: MSVehicle.cpp:3940
bool myAmRegisteredAsWaitingForPerson
Whether this vehicle is registered as waiting for a person (for deadlock-recognition) ...
Definition: MSVehicle.h:1554
MSLane * getLane() const
Returns the lane the vehicle is on.
Definition: MSVehicle.h:488
SUMOTime myLastVTDAccess
Definition: MSVehicle.h:1392
int bestLaneOffset
The (signed) number of lanes to be crossed to get to the lane which allows to continue the drive...
Definition: MSVehicle.h:714
void setBlinkerInformation()
Definition: MSVehicle.cpp:3521
void addContainer(MSTransportable *container)
Adds a container.
Definition: MSVehicle.cpp:3458
SUMOTime getMemorySize() const
Definition: MSVehicle.h:196
int getPersonNumber() const
Returns the number of persons.
Definition: MSVehicle.cpp:3508
std::pair< const MSVehicle *const, double > getLeader(double dist=0) const
Returns the leader of the vehicle looking for a fixed distance.
Definition: MSVehicle.cpp:3348
The front lights are on (no visualisation)
Definition: MSVehicle.h:1079
Signalling
Some boolean values which describe the state of some vehicle parts.
Definition: MSVehicle.h:1067
bool onFurtherEdge(const MSEdge *edge) const
whether this vehicle has its back (and no its front) on the given edge
Definition: MSVehicle.cpp:3802
The base class for an intersection.
Definition: MSJunction.h:64
void planMove(const SUMOTime t, const MSLeaderInfo &ahead, const double lengthsInFront)
Compute safe velocities for the upcoming lanes based on positions and speeds from the last time step...
Definition: MSVehicle.cpp:1363
The car-following model abstraction.
Definition: MSCFModel.h:60
double getPositionOnLane() const
Get the vehicle&#39;s position along the lane.
Definition: MSVehicle.h:375
bool myConsiderMaxAcceleration
Whether the maximum acceleration shall be regarded.
Definition: MSVehicle.h:1374
double myPosLat
the stored lateral position
Definition: MSVehicle.h:146
int getBestLaneOffset() const
Definition: MSVehicle.cpp:3305
The high beam lights are on (no visualisation)
Definition: MSVehicle.h:1083
Notification
Definition of a vehicle state.
MSDevice_Transportable * myPersonDevice
The passengers this vehicle may have.
Definition: MSVehicle.h:1535
Changes the wished vehicle speed / lanes.
Definition: MSVehicle.h:1234
bool addTraciStopAtStoppingPlace(const std::string &stopId, const SUMOTime duration, const SUMOTime until, const bool parking, const bool triggered, const bool containerTriggered, const SumoXMLTag stoppingPlaceType, std::string &errorMsg)
Definition: MSVehicle.cpp:3850
bool myRespectJunctionPriority
Whether the junction priority rules are respected.
Definition: MSVehicle.h:1380
bool reached
Information whether the stop has been reached.
Definition: MSVehicle.h:848
double getLeaveSpeed() const
Definition: MSVehicle.h:1620
State & operator=(const State &state)
Assignment operator.
Definition: MSVehicle.cpp:124
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:616
The backwards driving lights are on (no visualisation)
Definition: MSVehicle.h:1085
vehicle doesn&#39;t want to change
Definition: MSVehicle.h:224
TraciLaneChangePriority
modes for prioritizing traci lane change requests
Definition: MSVehicle.h:1113
SUMOTime DELTA_T
Definition: SUMOTime.cpp:40
PositionVector getBoundingBox() const
get bounding rectangle
Definition: MSVehicle.cpp:3753
Position getPosition(const double offset=0) const
Return current position (x/y, cartesian)
Definition: MSVehicle.cpp:777
double getRightSideOnLane() const
Get the vehicle&#39;s lateral position on the lane:
Definition: MSVehicle.cpp:3594
void adaptBestLanesOccupation(int laneIndex, double density)
update occupation from MSLaneChanger
Definition: MSVehicle.cpp:3315
WaitingTimeCollector myWaitingTimeCollector
Definition: MSVehicle.h:1500
Definition of vehicle stop (position and duration)
Definition: MSVehicle.h:820
bool executeMove()
Executes planned vehicle movements with regards to right-of-way.
Definition: MSVehicle.cpp:1880
double getSafeFollowSpeed(const std::pair< const MSVehicle *, double > leaderInfo, const double seen, const MSLane *const lane, double distToCrossing) const
compute safe speed for following the given leader
Definition: MSVehicle.cpp:1838
std::vector< const MSEdge * > ConstMSEdgeVector
Definition: MSEdge.h:78
SUMOTime myMemorySize
the maximal memory to store
Definition: MSVehicle.h:207
int getSignals() const
Returns the signals.
Definition: MSVehicle.h:1140
double lastCoveredDist() const
previous Speed of this state
Definition: MSVehicle.h:133
double myLastCoveredDist
Definition: MSVehicle.h:160
The base class for microscopic and mesoscopic vehicles.
Definition: MSBaseVehicle.h:56
bool myHaveToWaitOnNextLink
Definition: MSVehicle.h:1559
virtual bool isSelected() const
whether this vehicle is selected in the GUI
Definition: MSVehicle.h:810
A storage for edge travel times and efforts.
double nextOccupation
As occupation, but without the first lane.
Definition: MSVehicle.h:712
double length
The overall length which may be driven when using this lane without a lane change.
Definition: MSVehicle.h:706
DriveProcessItem(double vWait, double distance)
constructor if the link shall not be passed
Definition: MSVehicle.h:1603
bool wasRemoteControlled(SUMOTime lookBack=DELTA_T) const
Returns the information whether the vehicle is fully controlled via TraCI within the lookBack time...
Definition: MSVehicle.cpp:4043
bool hasArrived() const
Returns whether this vehicle has already arived (reached the arrivalPosition on its final edge) ...
Definition: MSVehicle.cpp:607
void enterLaneAtLaneChange(MSLane *enteredLane)
Update when the vehicle enters a new lane in the laneChange step.
Definition: MSVehicle.cpp:2766
bool collision
Whether this stop was triggered by a collision.
Definition: MSVehicle.h:858
void planMoveInternal(const SUMOTime t, MSLeaderInfo ahead, DriveItemVector &lfLinks, double &myStopDist) const
Definition: MSVehicle.cpp:1414
The car-following model and parameter.
Definition: MSVehicleType.h:74
bool triggered
whether an arriving person lets the vehicle continue
Definition: MSVehicle.h:842
MSAbstractLaneChangeModel & getLaneChangeModel()
Definition: MSVehicle.cpp:2921
bool isStoppedInRange(double pos) const
return whether the given position is within range of the current stop
Definition: MSVehicle.cpp:1139
MSCFModel::VehicleVariables * myCFVariables
The per vehicle variables of the car following model.
Definition: MSVehicle.h:1705
Performs lane changing of vehicles.
bool knowsEdgeTest(MSEdge &edge) const
bool isFrontOnLane(const MSLane *lane) const
Returns the information whether the front of the vehicle is on the given lane.
Definition: MSVehicle.cpp:2465
int getLaneIndex() const
Definition: MSVehicle.cpp:3577
double getBackPositionOnLane() const
Get the vehicle&#39;s position relative to its current lane.
Definition: MSVehicle.h:399
Right blinker lights are switched on.
Definition: MSVehicle.h:1071
MSChargingStation * chargingStation
(Optional) charging station if one is assigned to the stop
Definition: MSVehicle.h:832
double getMaxSpeedOnLane() const
Returns the maximal speed for the vehicle on its current lane (including speed factor and deviation...
Definition: MSVehicle.h:498
const ConstMSEdgeVector getStopEdges() const
Returns the list of still pending stop edges.
Definition: MSVehicle.cpp:1353
double getMaxAccel() const
Get the vehicle type&#39;s maximum acceleration [m/s^2].
Definition: MSCFModel.h:193
std::vector< std::pair< SUMOTime, int > > myLaneTimeLine
The lane usage time line to apply.
Definition: MSVehicle.h:1359
std::vector< double > myFurtherLanesPosLat
Definition: MSVehicle.h:1545
bool signalSet(int which) const
Returns whether the given signal is on.
Definition: MSVehicle.h:1149
bool getEmergencyBrakeRedLight() const
Returns whether red lights shall be a reason to brake.
Definition: MSVehicle.h:1304
bool operator!=(const State &state)
Operator !=.
Definition: MSVehicle.cpp:136
static std::vector< MSTransportable * > myEmptyTransportableVector
Definition: MSVehicle.h:1529
Performs lane changing of vehicles.
Definition: MSLaneChanger.h:55
double getDistanceToPosition(double destPos, const MSEdge *destEdge) const
Definition: MSVehicle.cpp:3331
A road/street connecting two junctions.
Definition: MSEdge.h:80
bool isOnRoad() const
Returns the information whether the vehicle is on a road (is simulated)
Definition: MSVehicle.h:510
void leaveLane(const MSMoveReminder::Notification reason, const MSLane *approachedLane=0)
Update of members if vehicle leaves a new lane in the lane change step or at arrival.
Definition: MSVehicle.cpp:2872
double getLatOffset(const MSLane *lane) const
Get the offset that that must be added to interpret myState.myPosLat for the given lane...
Definition: MSVehicle.cpp:3638
MSLane * lane
The described lane.
Definition: MSVehicle.h:704
const MSCFModel & getCarFollowModel() const
Returns the vehicle&#39;s car following model definition.
Definition: MSVehicle.h:796
double getCO2Emissions() const
Returns CO2 emission of the current state.
Definition: MSVehicle.cpp:3388
Left blinker lights are switched on.
Definition: MSVehicle.h:1073
The wipers are on.
Definition: MSVehicle.h:1087
const MSCFModel & getCarFollowModel() const
Returns the vehicle type&#39;s car following model definition (const version)
vehicle want&#39;s to change to right lane
Definition: MSVehicle.h:228
void updateState(double vNext)
updates the vehicles state, given a next value for its speed. This value can be negative in case of t...
Definition: MSVehicle.cpp:2290
double getLateralOverlap() const
return the amount by which the vehicle extends laterally outside it&#39;s primary lane ...
Definition: MSVehicle.cpp:3681
double updateFurtherLanes(std::vector< MSLane *> &furtherLanes, std::vector< double > &furtherLanesPosLat, const std::vector< MSLane *> &passedLanes)
update a vector of further lanes and return the new backPos
Definition: MSVehicle.cpp:2347
Representation of a vehicle.
Definition: SUMOVehicle.h:67
MSStoppingPlace * containerstop
(Optional) container stop if one is assigned to the stop
Definition: MSVehicle.h:828
Stores the waiting intervals over the previous seconds (memory is to be specified in ms...
Definition: MSVehicle.h:168
Encapsulated SAX-Attributes.
SUMOTime myCollisionImmunity
amount of time for which the vehicle is immune from collisions
Definition: MSVehicle.h:1568
void adaptLeaveSpeed(const double v)
Definition: MSVehicle.h:1613
ChangeRequest
Requests set via TraCI.
Definition: MSVehicle.h:222
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:46
double posLat() const
Lateral Position of this state (m relative to the centerline of the lane).
Definition: MSVehicle.h:123
A list of positions.
double getTimeLossSeconds() const
Returns the time loss in seconds.
Definition: MSVehicle.h:586
void updateBestLanes(bool forceRebuild=false, const MSLane *startLane=0)
computes the best lanes to use in order to continue the route
Definition: MSVehicle.cpp:2939
SUMOTime timeToLoadNextContainer
The time at which the vehicle is able to load another container.
Definition: MSVehicle.h:856
const std::vector< MSLane * > & getBestLanesContinuation() const
Returns the best sequence of lanes to continue the route starting at myLane.
Definition: MSVehicle.cpp:3276
Position myCachedPosition
Definition: MSVehicle.h:1570
double getSpaceTillLastStanding(const MSLane *l, bool &foundStopped) const
Definition: MSVehicle.cpp:2471
double 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:3606
const MSLane * lane
The lane to stop at.
Definition: MSVehicle.h:824
double currentLength
The length which may be driven on this lane.
Definition: MSVehicle.h:708
const std::vector< MSLane * > & getFurtherLanes() const
Definition: MSVehicle.h:683
std::list< Stop > myStops
The vehicle&#39;s list of stops.
Definition: MSVehicle.h:1532
ConstMSEdgeVector::const_iterator MSRouteIterator
Definition: MSRoute.h:65
SUMOTime myTimeLoss
the time loss due to writing with less than maximum speed
Definition: MSVehicle.h:1503
bool myConsiderMaxDeceleration
Whether the maximum deceleration shall be regarded.
Definition: MSVehicle.h:1377
#define STEPS2TIME(x)
Definition: SUMOTime.h:65
MSLane * myLane
The lane the vehicle is on.
Definition: MSVehicle.h:1509
bool myAmRegisteredAsWaitingForContainer
Whether this vehicle is registered as waiting for a container (for deadlock-recognition) ...
Definition: MSVehicle.h:1557
Blinker lights on both sides are switched on.
Definition: MSVehicle.h:1075
bool hasStops() const
Returns whether the vehicle has to stop somewhere.
Definition: MSVehicle.h:887
bool addStop(const SUMOVehicleParameter::Stop &stopPar, std::string &errorMsg, SUMOTime untilOffset=0, bool collision=false)
Adds a stop.
Definition: MSVehicle.cpp:893
Influencer * myInfluencer
An instance of a velocity/lane influencing instance; built in "getInfluencer".
Definition: MSVehicle.h:1709
void resetRoutePosition(int index)
Definition: MSVehicle.cpp:684
std::vector< LaneQ >::iterator myCurrentLaneInBestLanes
Definition: MSVehicle.h:1526
double getDeltaPos(double accel)
calculates the distance covered in the next integration step given an acceleration and assuming the c...
Definition: MSVehicle.cpp:1858
SUMOTime duration
The stopping duration.
Definition: MSVehicle.h:838
double getMaxSpeed() const
Get vehicle&#39;s maximum speed [m/s].
double getHarmonoise_NoiseEmissions() const
Returns noise emissions of the current state.
Definition: MSVehicle.cpp:3430
T MIN2(T a, T b)
Definition: StdDefs.h:64
The brake lights are on.
Definition: MSVehicle.h:1077
A blue emergency light is on.
Definition: MSVehicle.h:1093
A structure representing the best lanes for continuing the current route starting at &#39;lane&#39;...
Definition: MSVehicle.h:702
void loadState(const SUMOSAXAttributes &attrs, const SUMOTime offset)
Loads the state of this vehicle from the given description.
Definition: MSVehicle.cpp:4129
Everything is switched off.
Definition: MSVehicle.h:1069
void onRemovalFromNet(const MSMoveReminder::Notification reason)
Called when the vehicle is removed from the network.
Definition: MSVehicle.cpp:598
double myStopDist
distance to the next stop or -1 if there is none
Definition: MSVehicle.h:1565
bool isStoppedTriggered() const
Returns whether the vehicle is on a triggered stop.
Definition: MSVehicle.cpp:1133
bool hasInfluencer() const
Definition: MSVehicle.h:1425
std::set< std::string > awaitedContainers
IDs of containers the vehicle has to wait for until departing.
Definition: MSVehicle.h:852
SUMOTime collisionStopTime() const
Returns the remaining time a vehicle needs to stop due to a collision. A negative value indicates tha...
Definition: MSVehicle.cpp:1121
Something on a lane to be noticed about vehicle movement.
double myAcceleration
The current acceleration after dawdling in m/s.
Definition: MSVehicle.h:1541
void fixPosition()
repair errors in vehicle position after changing between internal edges
Definition: MSVehicle.cpp:3323
double myPreviousSpeed
the speed at the begin of the previous time step
Definition: MSVehicle.h:154
MSParkingArea * parkingarea
(Optional) parkingArea if one is assigned to the stop
Definition: MSVehicle.h:830
SUMOTime myWaitingTime
The time the vehicle waits (is not faster than 0.1m/s) in seconds.
Definition: MSVehicle.h:1496
One of the left doors is opened.
Definition: MSVehicle.h:1089
LaneChangeMode mySpeedGainLC
lane changing to travel with higher speed
Definition: MSVehicle.h:1401
LaneChangeMode myCooperativeLC
lane changing with the intent to help other vehicles
Definition: MSVehicle.h:1399
bool allowsContinuation
Whether this lane allows to continue the drive.
Definition: MSVehicle.h:716
const waitingIntervalList & getWaitingIntervals() const
Definition: MSVehicle.h:201
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:4104
DriveProcessItem(MSLink *link, double vPass, double vWait, bool setRequest, SUMOTime arrivalTime, double arrivalSpeed, SUMOTime arrivalTimeBraking, double arrivalSpeedBraking, double distance, double leaveSpeed=-1.)
Definition: MSVehicle.h:1587
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
double getLateralPositionOnLane() const
Get the vehicle&#39;s lateral position on the lane.
Definition: MSVehicle.h:407
bool myEmergencyBrakeRedLight
Whether red lights are a reason to brake.
Definition: MSVehicle.h:1383
double getCOEmissions() const
Returns CO emission of the current state.
Definition: MSVehicle.cpp:3394
ConstMSEdgeVector myVTDRoute
Definition: MSVehicle.h:1391
virtual void drawOutsideNetwork(bool)
register vehicle for drawing while outside the network
Definition: MSVehicle.h:1496
const std::vector< double > & getFurtherLanesPosLat() const
Definition: MSVehicle.h:687
Abstract in-vehicle device.
Definition: MSDevice.h:71
void updateOccupancyAndCurrentBestLane(const MSLane *startLane)
updates LaneQ::nextOccupation and myCurrentLaneInBestLanes
Definition: MSVehicle.cpp:3259
void setEmergencyBlueLight(SUMOTime currentTime)
sets the blue flashing light for emergency vehicles
Definition: MSVehicle.cpp:3560
bool addTraciStop(MSLane *const lane, const double startPos, const double endPos, const SUMOTime duration, const SUMOTime until, const bool parking, const bool triggered, const bool containerTriggered, std::string &errorMsg)
Definition: MSVehicle.cpp:3814
vehicle want&#39;s to change to left lane
Definition: MSVehicle.h:226
void addStops(const bool ignoreStopErrors)
Adds stops to the built vehicle.
Influencer & getInfluencer()
Returns the velocity/lane influencer.
Definition: MSVehicle.cpp:3993
Structure representing possible vehicle parameter.
LaneChangeMode mySublaneLC
changing to the prefered lateral alignment
Definition: MSVehicle.h:1405
double occupation
The overall vehicle sum on consecutive lanes which can be passed without a lane change.
Definition: MSVehicle.h:710
const MSVehicleType & getVehicleType() const
Returns the vehicle&#39;s type definition.
void removeApproachingInformation(DriveItemVector &lfLinks) const
unregister approach from all upcoming links
Definition: MSVehicle.cpp:3688
double processNextStop(double currentVelocity)
Processes stops, returns the velocity needed to reach the stop.
Definition: MSVehicle.cpp:1145
bool containerTriggered
whether an arriving container lets the vehicle continue
Definition: MSVehicle.h:844
void setTentativeLaneAndPosition(MSLane *lane, double pos, double posLat=0)
set tentative lane and position during insertion to ensure that all cfmodels work (some of them requi...
Definition: MSVehicle.cpp:3584
void setVTDState(Position xyPos)
sets position outside the road network
Definition: MSVehicle.cpp:4030
std::vector< std::pair< SUMOTime, double > > mySpeedTimeLine
The velocity time line to apply.
Definition: MSVehicle.h:1356
void workOnMoveReminders(double oldPos, double newPos, double newSpeed)
Processes active move reminder.
Definition: MSVehicle.cpp:715
void checkRewindLinkLanes(const double lengthsInFront, DriveItemVector &lfLinks) const
Definition: MSVehicle.cpp:2492
int mySignals
State of things of the vehicle that can be on or off.
Definition: MSVehicle.h:1548
std::vector< MSLane * > bestContinuations
Definition: MSVehicle.h:722
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:850
double 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
SUMOTime until
The time at which the vehicle may continue its journey.
Definition: MSVehicle.h:840
const MSEdge * getRerouteOrigin() const
Returns the starting point for reroutes (usually the current edge)
Definition: MSVehicle.cpp:809
double getPMxEmissions() const
Returns PMx emission of the current state.
Definition: MSVehicle.cpp:3412
friend class MSVehicle
vehicle sets states directly
Definition: MSVehicle.h:95
MSRouteIterator edge
The edge in the route to stop at.
Definition: MSVehicle.h:822
void activateReminders(const MSMoveReminder::Notification reason, const MSLane *enteredLane=0)
"Activates" all current move reminder
Definition: MSVehicle.cpp:2699
int getContainerNumber() const
Returns the number of containers.
Definition: MSVehicle.cpp:3514
SUMOTime cumulatedWaitingTime(SUMOTime memory=-1) const
Definition: MSVehicle.cpp:174
const MSLane * getBackLane() const
Definition: MSVehicle.cpp:2337
double getTimeGapOnLane() const
Returns the time gap in seconds to the leader of the vehicle on the same lane.
Definition: MSVehicle.cpp:3377
waitingIntervalList myWaitingIntervals
Definition: MSVehicle.h:212
static SUMOTime gWaitingTimeMemory
length of memory for waiting times (in millisecs)
Definition: MSGlobals.h:116
std::vector< DriveProcessItem > DriveItemVector
Container for used Links/visited Lanes during lookForward.
Definition: MSVehicle.h:1626
void setSignals(int signals)
Definition: MSVehicle.h:1342
const MSEdgeWeightsStorage & getWeightsStorage() const
Returns the vehicle&#39;s internal edge travel times/efforts container.
Definition: MSVehicle.cpp:693
double estimateSpeedAfterDistance(const double dist, const double v, const double accel) const
Definition: MSCFModel.cpp:473
vehicle want&#39;s to keep the current lane
Definition: MSVehicle.h:230
double getLastStepDist() const
Get the distance the vehicle covered in the previous timestep.
Definition: MSVehicle.h:382
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:71
double speed() const
Speed of this state.
Definition: MSVehicle.h:118
void switchOffSignal(int signal)
Switches the given signal off.
Definition: MSVehicle.h:1132
static bool gSemiImplicitEulerUpdate
Definition: MSGlobals.h:63
void switchOnSignal(int signal)
Switches the given signal on.
Definition: MSVehicle.h:1124
double getSlope() const
Returns the slope of the road at vehicle&#39;s position.
Definition: MSVehicle.cpp:766
void addPerson(MSTransportable *person)
Adds a passenger.
Definition: MSVehicle.cpp:3436
static std::vector< MSLane * > myEmptyLaneVector
Definition: MSVehicle.h:1528
static bool overlap(const MSVehicle *veh1, const MSVehicle *veh2)
Definition: MSVehicle.h:614
long long int SUMOTime
Definition: TraCIDefs.h:52
bool unsafeLinkAhead(const MSLane *lane) const
whether the vehicle may safely move to the given lane with regard to upcoming links ...
Definition: MSVehicle.cpp:3700
MSEdgeWeightsStorage & _getWeightsStorage() const
Definition: MSVehicle.cpp:705
double getHCEmissions() const
Returns HC emission of the current state.
Definition: MSVehicle.cpp:3400
virtual ~MSVehicle()
Destructor.
Definition: MSVehicle.cpp:575
const std::vector< MSTransportable * > & getPersons() const
retrieve riding persons
Definition: MSVehicle.cpp:3488
bool isStopped() const
Returns whether the vehicle is at a stop.
Definition: MSVehicle.cpp:1115
const std::vector< MSTransportable * > & getContainers() const
retrieve riding containers
Definition: MSVehicle.cpp:3498
bool willPass(const MSEdge *const edge) const
Returns whether the vehicle wil pass the given edge.
Definition: MSVehicle.cpp:672
MSParkingArea * getNextParkingArea()
get the current parking area stop
Definition: MSVehicle.cpp:1101
const Position getBackPosition() const
Definition: MSVehicle.cpp:869
double 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:3600
const std::vector< LaneQ > & getBestLanes() const
Returns the description of best lanes to use in order to continue the route.
Definition: MSVehicle.cpp:2933
SUMOTime getTimeLoss() const
Returns the SUMOTime lost (speed was lesser maximum speed)
Definition: MSVehicle.h:549
bool isParking() const
Returns whether the vehicle is parking.
Definition: MSVehicle.cpp:1127
double endPos
The stopping position end.
Definition: MSVehicle.h:836
double getSpeed() const
Returns the vehicle&#39;s current speed.
Definition: MSVehicle.h:442
State(double pos, double speed, double posLat, double backPos)
Constructor.
Definition: MSVehicle.cpp:146
bool mySpeedAdaptationStarted
Whether influencing the speed has already started.
Definition: MSVehicle.h:1368
double estimateLeaveSpeed(const MSLink *const link, const double vLinkPass) const
estimate leaving speed when accelerating across a link
Definition: MSVehicle.h:1640
int influenceChangeDecision(int state)
allow TraCI to influence a lane change decision
Definition: MSVehicle.cpp:4017
double getLatDist() const
Definition: MSVehicle.h:1350
SUMOTime getLastAccessTimeStep() const
Definition: MSVehicle.h:1326
A red emergency light is on.
Definition: MSVehicle.h:1095
MSStoppingPlace * busstop
(Optional) bus stop if one is assigned to the stop
Definition: MSVehicle.h:826
Representation of a lane in the micro simulation.
Definition: MSLane.h:79
double myBackPos
the stored back position
Definition: MSVehicle.h:151
void adaptLaneEntering2MoveReminder(const MSLane &enteredLane)
Adapts the vehicle&#39;s entering of a new lane.
Definition: MSVehicle.cpp:744
One of the right doors is opened.
Definition: MSVehicle.h:1091
Interface for lane-change models.
double mySpeed
the stored speed (should be >=0 at any time)
Definition: MSVehicle.h:143
bool myConsiderSafeVelocity
Whether the safe velocity shall be regarded.
Definition: MSVehicle.h:1371
void removeTransportable(MSTransportable *t)
removes a person or container
Definition: MSVehicle.cpp:3478
MSDevice_Transportable * myContainerDevice
The containers this vehicle may have.
Definition: MSVehicle.h:1538
The fog lights are on (no visualisation)
Definition: MSVehicle.h:1081
double startPos
The stopping position start.
Definition: MSVehicle.h:834
bool parking
whether the vehicle is removed from the net while stopping
Definition: MSVehicle.h:846
double nextStopDist() const
return the distance to the next stop or doubleMax if there is none.
Definition: MSVehicle.h:917
double getSpeedWithoutTraciInfluence() const
Returns the uninfluenced velocity.
Definition: MSVehicle.cpp:4008
A yellow emergency light is on.
Definition: MSVehicle.h:1097
double pos() const
Position of this state.
Definition: MSVehicle.h:113
bool congested() const
Definition: MSVehicle.h:624