Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
MSVehicle.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2024 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
27// Representation of a vehicle in the micro simulation
28/****************************************************************************/
29#pragma once
30#include <config.h>
31
32#include <list>
33#include <deque>
34#include <map>
35#include <set>
36#include <string>
37#include <vector>
38#include <memory>
39#include "MSGlobals.h"
40#include "MSBaseVehicle.h"
41#include "MSNet.h"
42
43#define INVALID_SPEED 299792458 + 1 // nothing can go faster than the speed of light! Refs. #2577
44
45// ===========================================================================
46// class declarations
47// ===========================================================================
49class MSMoveReminder;
50class MSLaneChanger;
53class MSStoppingPlace;
54class MSStop;
56class MSOverheadWire;
57class MSParkingArea;
58class MSPerson;
59class MSDevice;
60class OutputDevice;
61class Position;
62class MSJunction;
63class MSLeaderInfo;
68
69
70// ===========================================================================
71// class definitions
72// ===========================================================================
77class MSVehicle : public MSBaseVehicle {
78public:
79
81 friend class MSLaneChanger;
83
87 class State {
89 friend class MSVehicle;
90 friend class MSLaneChanger;
92
93 public:
95 State(double pos, double speed, double posLat, double backPos, double previousSpeed);
96
98 State(const State& state);
99
101 State& operator=(const State& state);
102
104 bool operator!=(const State& state);
105
107 double pos() const {
108 return myPos;
109 }
110
112 double speed() const {
113 return mySpeed;
114 };
115
117 double posLat() const {
118 return myPosLat;
119 }
120
122 double backPos() const {
123 return myBackPos;
124 }
125
127 double lastCoveredDist() const {
128 return myLastCoveredDist;
129 }
130
131
132 private:
134 double myPos;
135
137 double mySpeed;
138
140 double myPosLat;
141
143 // if the vehicle occupies multiple lanes, this is the position relative
144 // to the lane occupied by its back
145 double myBackPos;
146
149
155
156 };
157
158
163 public:
166
167 // return the waiting time within the last memory millisecs
168 SUMOTime cumulatedWaitingTime(SUMOTime memory = -1) const;
169
170 // process time passing for dt millisecs
171 void passTime(SUMOTime dt, bool waiting);
172
173 const std::string getState() const;
174
175 void setState(const std::string& state);
176
177 private:
180
184 std::deque<std::pair<SUMOTime, SUMOTime> > myWaitingIntervals;
185 };
186
187
201
210 MSVehicleType* type, const double speedFactor);
211
213 virtual ~MSVehicle();
214
215 void initDevices();
216
218 bool hasValidRouteStart(std::string& msg);
219
221
222
232
233
234
236
237
241 bool hasArrived() const;
242
253 bool replaceRoute(ConstMSRoutePtr route, const std::string& info, bool onInit = false, int offset = 0, bool addStops = true, bool removeStops = true, std::string* msgReturn = nullptr);
254
256
257
259
260
278 void workOnMoveReminders(double oldPos, double newPos, double newSpeed);
280
286 void workOnIdleReminders();
287
293 bool checkActionStep(const SUMOTime t);
294
300 void resetActionOffset(const SUMOTime timeUntilNextAction = 0);
301
302
312 void updateActionOffset(const SUMOTime oldActionStepLength, const SUMOTime newActionStepLength);
313
314
332 void planMove(const SUMOTime t, const MSLeaderInfo& ahead, const double lengthsInFront);
333
337
339 void registerInsertionApproach(MSLink* link, double dist);
340
341
354 bool executeMove();
355
357 void executeFractionalMove(double dist);
358
365 double getDeltaPos(const double accel) const;
366
367
369
370
374 double getPositionOnLane() const {
375 return myState.myPos;
376 }
377
381 double getLastStepDist() const {
382 return myState.lastCoveredDist();
383 }
384
388 double getPositionOnLane(const MSLane* lane) const;
389
398 inline double getBackPositionOnLane(const MSLane* lane) const {
399 return getBackPositionOnLane(lane, false);
400 }
401
405 double getBackPositionOnLane() const {
407 }
408
414 return myState.myPosLat;
415 }
416
417 void setLateralPositionOnLane(double posLat) {
418 myState.myPosLat = posLat;
419 }
420
424
429 double getRightSideOnLane() const;
430
435 double getLeftSideOnLane() const;
436
441 double getRightSideOnLane(const MSLane* lane) const;
442
447 double getLeftSideOnLane(const MSLane* lane) const;
448
452 double lateralDistanceToLane(const int offset) const;
453
455 double getLateralOverlap() const;
456 double getLateralOverlap(const MSLane* lane) const;
457 double getLateralOverlap(double posLat, const MSLane* lane) const;
458
464 double getLeftSideOnEdge(const MSLane* lane = 0) const;
465
471 double getRightSideOnEdge(const MSLane* lane = 0) const;
472
478 double getCenterOnEdge(const MSLane* lane = 0) const;
479
485 double getLatOffset(const MSLane* lane) const;
486
490 double getSpeed() const {
491 return myState.mySpeed;
492 }
493
494
498 double getPreviousSpeed() const {
500 }
501
502
507 void setPreviousSpeed(double prevSpeed, double prevAcceleration);
508
509
514 double getAcceleration() const {
515 return myAcceleration;
516 }
517
519 double getCurrentApparentDecel() const;
520
528
533 double getActionStepLengthSecs() const {
535 }
536
537
542 return myLastActionTime;
543 }
544
546
547
548
550
551
555 double getSlope() const;
556
557
565 Position getPosition(const double offset = 0) const;
566
567
575 Position getPositionAlongBestLanes(double offset) const;
576
577
581 const MSLane* getLane() const {
582 return myLane;
583 }
584
590 return myLane;
591 }
592
593 // @brief return the lane on which the back of this vehicle resides
594 const MSLane* getBackLane() const;
595
600 double getMaxSpeedOnLane() const;
601
605 inline bool isOnRoad() const {
606 return myAmOnNet;
607 }
608
612 void
613 setIdling(bool amIdling) {
614 myAmIdling = amIdling;
615 }
616
621 inline bool isIdling() const {
622 return myAmIdling;
623 }
624
628 inline bool isActive() const {
629 return myActionStep;
630 }
631
635 inline bool isActionStep(SUMOTime t) const {
636 return (t - myLastActionTime) % getActionStepLength() == 0;
637// return t%getActionStepLength() == 0; // synchronized actions for all vehicles with identical actionsteplengths
638 }
639
640
644 bool isFrontOnLane(const MSLane* lane) const;
645
649 const MSEdge* getCurrentEdge() const;
650
652 const MSEdge* getNextEdgePtr() const;
653
660 ConstMSEdgeVector::const_iterator getRerouteOrigin() const;
661
662
670 SUMOTime getWaitingTime(const bool accumulated = false) const {
671 if (!accumulated) {
672 return myWaitingTime;
673 }
675 }
676
678 SUMOTime getWaitingTimeFor(const MSLink* link) const;
679
680
690
691 inline double getTimeSinceStartupSeconds() const {
693 }
694
705 return TIME2STEPS(myTimeLoss);
706 }
707
708
715 return STEPS2TIME(getWaitingTime(true));
716 }
717
720 double getTimeLossSeconds() const {
721 return myTimeLoss;
722 }
723
726 double getStopDelay() const;
727
730 double getStopArrivalDelay() const;
731
735 double getAngle() const {
736 return myAngle;
737 }
738
739
744 return Position(std::cos(myAngle) * myState.speed(), std::sin(myAngle) * myState.speed());
745 }
747
749 double computeAngle() const;
750
752 void setAngle(double angle, bool straightenFurther = false);
753
760 void setActionStepLength(double actionStepLength, bool resetActionOffset = true);
761
763 static bool overlap(const MSVehicle* veh1, const MSVehicle* veh2) {
764 if (veh1->myState.myPos < veh2->myState.myPos) {
765 return veh2->myState.myPos - veh2->getVehicleType().getLengthWithGap() < veh1->myState.myPos;
766 }
767 return veh1->myState.myPos - veh1->getVehicleType().getLengthWithGap() < veh2->myState.myPos;
768 }
769
772 bool congested() const;
773
774
781 void enterLaneAtMove(MSLane* enteredLane, bool onTeleporting = false);
782
783
784
793 void enterLaneAtInsertion(MSLane* enteredLane, double pos, double speed, double posLat,
794 MSMoveReminder::Notification notification);
795
800 void setTentativeLaneAndPosition(MSLane* lane, double pos, double posLat = 0);
801
806 void enterLaneAtLaneChange(MSLane* enteredLane);
807
808
810 void leaveLane(const MSMoveReminder::Notification reason, const MSLane* approachedLane = 0);
811
814 void leaveLaneBack(const MSMoveReminder::Notification reason, const MSLane* leftLane);
815
822 void updateDriveItems();
823
827 const std::pair<double, const MSLink*>& getNextTurn() {
828 return myNextTurn;
829 }
830
831
834
835 const std::vector<MSLane*>& getFurtherLanes() const {
836 return myFurtherLanes;
837 }
838
839 const std::vector<double>& getFurtherLanesPosLat() const {
841 }
842
843
845 bool onFurtherEdge(const MSEdge* edge) const;
846
848 bool isBidiOn(const MSLane* lane) const;
849
852
853 //
857 struct LaneQ {
859 MSLane* lane = nullptr;
861 double length;
872 /* @brief Longest sequence of (normal-edge) lanes that can be followed without a lane change
873 * The 'length' attribute is the sum of these lane lengths
874 * (There may be alternative sequences that have equal length)
875 * It is the 'best' in the strategic sense of reducing required lane-changes
876 */
877 std::vector<MSLane*> bestContinuations;
878 };
879
883 const std::vector<LaneQ>& getBestLanes() const;
884
902 void updateBestLanes(bool forceRebuild = false, const MSLane* startLane = 0);
903
906 void updateLaneBruttoSum();
907
911 const std::vector<MSLane*>& getBestLanesContinuation() const;
912
913
917 const std::vector<MSLane*>& getBestLanesContinuation(const MSLane* const l) const;
918
925 const std::vector<const MSLane*> getUpcomingLanesUntil(double distance) const;
926
932 const std::vector<const MSLane*> getPastLanesUntil(double distance) const;
933
938 const std::vector<MSLane*> getUpstreamOppositeLanes() const;
939
940 /* @brief returns the current signed offset from the lane that is most
941 * suited for continuing the current route (in the strategic sense of reducing lane-changes)
942 * - 0 if the vehicle is on its best lane
943 * - negative if the vehicle should change to the right
944 * - positive if the vehicle should change to the left
945 */
946 int getBestLaneOffset() const;
947
949 double getBestLaneDist() const;
950
952 void adaptBestLanesOccupation(int laneIndex, double density);
953
955
957 void fixPosition();
958
960 std::pair<const MSLane*, double> getLanePosAfterDist(double distance) const;
961
969 inline const MSCFModel& getCarFollowModel() const {
970 return myType->getCarFollowModel();
971 }
972
978 std::shared_ptr<MSSimpleDriverState> getDriverState() const;
979
984 double getFriction() const;
985
993
996 inline bool hasDriverState() const {
997 return myDriverState != nullptr;
998 }
1000
1001
1004
1007 bool willStop() const;
1008
1010 bool isStoppedOnLane() const;
1011
1013 bool keepStopping(bool afterProcessing = false) const;
1014
1019
1022 bool brokeDown() const;
1023
1027 bool isRemoteControlled() const;
1028
1032 bool wasRemoteControlled(SUMOTime lookBack = DELTA_T) const;
1033
1035 double nextStopDist() const {
1036 return myStopDist;
1037 }
1039
1040 int getLaneIndex() const;
1041
1051 double getDistanceToPosition(double destPos, const MSLane* destLane) const;
1052
1053
1061 double processNextStop(double currentVelocity);
1062
1063
1071 std::pair<const MSVehicle* const, double> getLeader(double dist = 0) const;
1072
1081 std::pair<const MSVehicle* const, double> getFollower(double dist = 0) const;
1082
1089 double getTimeGapOnLane() const;
1090
1091
1096 void addTransportable(MSTransportable* transportable);
1097
1100
1136
1137
1143 LC_NEVER = 0, // lcModel shall never trigger changes at this level
1144 LC_NOCONFLICT = 1, // lcModel may trigger changes if not in conflict with TraCI request
1145 LC_ALWAYS = 2 // lcModel may always trigger changes of this level regardless of requests
1147
1148
1151 LCP_ALWAYS = 0, // change regardless of blockers, adapt own speed and speed of blockers
1152 LCP_NOOVERLAP = 1, // change unless overlapping with blockers, adapt own speed and speed of blockers
1153 LCP_URGENT = 2, // change if not blocked, adapt own speed and speed of blockers
1154 LCP_OPPORTUNISTIC = 3 // change if not blocked
1156
1157
1161 void switchOnSignal(int signal) {
1162 mySignals |= signal;
1163 }
1164
1165
1169 void switchOffSignal(int signal) {
1170 mySignals &= ~signal;
1171 }
1172
1173
1177 int getSignals() const {
1178 return mySignals;
1179 }
1180
1181
1186 bool signalSet(int which) const {
1187 return (mySignals & which) != 0;
1188 }
1190
1191
1193 bool unsafeLinkAhead(const MSLane* lane) const;
1194
1196 bool passingMinor() const;
1197
1198
1199
1207 double getSpeedWithoutTraciInfluence() const;
1208
1213 bool rerouteParkingArea(const std::string& parkingAreaID, std::string& errorMsg);
1214
1221 bool addTraciStop(SUMOVehicleParameter::Stop stop, std::string& errorMsg);
1222
1223 bool handleCollisionStop(MSStop& stop, const double distToStop);
1224
1229 bool resumeFromStopping();
1230
1232 double updateFurtherLanes(std::vector<MSLane*>& furtherLanes,
1233 std::vector<double>& furtherLanesPosLat,
1234 const std::vector<MSLane*>& passedLanes);
1235
1237 PositionVector getBoundingBox(double offset = 0) const;
1238
1240 PositionVector getBoundingPoly(double offset = 0) const;
1241
1253
1256 bool setExitManoeuvre();
1259
1261 bool manoeuvreIsComplete() const;
1264
1265
1273
1274 public:
1276 Manoeuvre();
1277
1279 Manoeuvre(const Manoeuvre& manoeuvre);
1280
1282 Manoeuvre& operator=(const Manoeuvre& manoeuvre);
1283
1285 bool operator!=(const Manoeuvre& manoeuvre);
1286
1289
1292
1295
1297 bool
1298 manoeuvreIsComplete(const ManoeuvreType checkType) const;
1299
1301 bool
1302 manoeuvreIsComplete() const;
1303
1305 double getGUIIncrement() const;
1306
1309
1312
1313 private:
1316
1318 std::string myManoeuvreStop;
1319
1322
1325
1328
1329 // @brief Angle (radians) through which parking vehicle moves in each sim step
1331 };
1332
1333 // Current or previous (completed) manoeuvre
1335
1349 private:
1350
1360 void vehicleStateChanged(const SUMOVehicle* const vehicle, MSNet::VehicleState to, const std::string& info = "");
1361 };
1362
1363
1367 virtual ~GapControlState();
1369 static void init();
1371 static void cleanup();
1373 void activate(double tauOriginal, double tauTarget, double additionalGap, double duration, double changeRate, double maxDecel, const MSVehicle* refVeh);
1375 void deactivate();
1392 double maxDecel;
1405
1407 static std::map<const MSVehicle*, GapControlState*> refVehMap;
1408
1409 private:
1411 };
1412
1413
1414 public:
1416 Influencer();
1417
1419 ~Influencer();
1420
1422 static void cleanup();
1423
1427 void setSpeedTimeLine(const std::vector<std::pair<SUMOTime, double> >& speedTimeLine);
1428
1431 void activateGapController(double originalTau, double newTimeHeadway, double newSpaceHeadway, double duration, double changeRate, double maxDecel, MSVehicle* refVeh = nullptr);
1432
1436
1440 void setLaneTimeLine(const std::vector<std::pair<SUMOTime, int> >& laneTimeLine);
1441
1445 void adaptLaneTimeLine(int indexShift);
1446
1450 void setSublaneChange(double latDist);
1451
1453 int getSpeedMode() const;
1454
1456 int getLaneChangeMode() const;
1457
1459
1461
1473 double influenceSpeed(SUMOTime currentTime, double speed, double vSafe, double vMin, double vMax);
1474
1487 double gapControlSpeed(SUMOTime currentTime, const SUMOVehicle* veh, double speed, double vSafe, double vMin, double vMax);
1488
1496 int influenceChangeDecision(const SUMOTime currentTime, const MSEdge& currentEdge, const int currentLaneIndex, int state);
1497
1498
1504 double changeRequestRemainingSeconds(const SUMOTime currentTime) const;
1505
1510 inline bool getRespectJunctionPriority() const {
1512 }
1513
1514
1518 inline bool getEmergencyBrakeRedLight() const {
1520 }
1521
1529
1530
1534 }
1535
1539 void setSpeedMode(int speedMode);
1540
1544 void setLaneChangeMode(int value);
1545
1549 double getOriginalSpeed() const;
1550
1552 void setOriginalSpeed(double speed);
1553
1554 void setRemoteControlled(Position xyPos, MSLane* l, double pos, double posLat, double angle, int edgeOffset, const ConstMSEdgeVector& route, SUMOTime t);
1555
1559
1562
1565
1567 double implicitSpeedRemote(const MSVehicle* veh, double oldSpeed);
1568
1570 double implicitDeltaPosRemote(const MSVehicle* veh);
1571
1572 bool isRemoteControlled() const;
1573
1574 bool isRemoteAffected(SUMOTime t) const;
1575
1576 void setSignals(int signals) {
1577 myTraCISignals = signals;
1578 }
1579
1580 int getSignals() const {
1581 return myTraCISignals;
1582 }
1583
1584 double getLatDist() const {
1585 return myLatDist;
1586 }
1587
1589 myLatDist = 0.;
1590 }
1591
1592 bool ignoreOverlap() const {
1594 }
1595
1596 private:
1597
1599 void init();
1600
1601 private:
1603 std::vector<std::pair<SUMOTime, double> > mySpeedTimeLine;
1604
1606 std::vector<std::pair<SUMOTime, int> > myLaneTimeLine;
1607
1609 std::shared_ptr<GapControlState> myGapControlState;
1610
1613
1616
1619
1622
1625
1628
1631
1634
1637
1646
1648
1649
1660
1662
1663 // @brief the signals set via TraCI
1665
1666 };
1667
1668
1676
1677 const BaseInfluencer* getBaseInfluencer() const;
1678 const Influencer* getInfluencer() const;
1679
1680 bool hasInfluencer() const {
1681 return myInfluencer != nullptr;
1682 }
1683
1685 int influenceChangeDecision(int state);
1686
1688 void setRemoteState(Position xyPos);
1689
1691 static int nextLinkPriority(const std::vector<MSLane*>& conts);
1692
1694 bool isLeader(const MSLink* link, const MSVehicle* veh, const double gap) const;
1695
1696 // @brief get the position of the back bumper;
1697 const Position getBackPosition() const;
1698
1700 bool ignoreCollision() const;
1701
1703 void updateParkingState();
1704
1710
1712 double getBrakeGap(bool delayed = false) const;
1713
1715
1716
1718 void saveState(OutputDevice& out);
1719
1722 void loadState(const SUMOSAXAttributes& attrs, const SUMOTime offset);
1723
1724 void loadPreviousApproaching(MSLink* link, bool setRequest,
1725 SUMOTime arrivalTime, double arrivalSpeed,
1726 double arrivalSpeedBraking,
1727 double dist, double leaveSpeed);
1729
1730protected:
1731
1734
1750 void adaptLaneEntering2MoveReminder(const MSLane& enteredLane);
1752
1753
1761 void processLinkApproaches(double& vSafe, double& vSafeMin, double& vSafeMinDist);
1762
1763
1771 void processLaneAdvances(std::vector<MSLane*>& passedLanes, std::string& emergencyReason);
1772
1773
1781 double processTraCISpeedControl(double vSafe, double vNext);
1782
1783
1791
1794 void updateWaitingTime(double vNext);
1795
1798 void updateTimeLoss(double vNext);
1799
1800 /* @brief Check whether the vehicle is a train that can reverse its direction at the current point in its route
1801 * and return the speed in preparation for reversal
1802 *
1803 * @param[out] canReverse
1804 * @param[in] speedThreshold
1805 * @return speed for reversal
1806 */
1807 double checkReversal(bool& canReverse, double speedThreshold = SUMO_const_haltingSpeed, double seen = 0) const;
1808
1811 void setBrakingSignals(double vNext) ;
1812
1815 void setBlinkerInformation();
1816
1819 void setEmergencyBlueLight(SUMOTime currentTime);
1820
1822 void computeFurtherLanes(MSLane* enteredLane, double pos, bool collision = false);
1823
1825 void updateOccupancyAndCurrentBestLane(const MSLane* startLane);
1826
1828 Position validatePosition(Position result, double offset = 0) const;
1829
1831 virtual void drawOutsideNetwork(bool /*add*/) {};
1832
1834 void boardTransportables(MSStop& stop);
1835
1837 bool joinTrainPart(MSVehicle* veh);
1838
1840 bool joinTrainPartFront(MSVehicle* veh);
1841
1843 double slowDownForSchedule(double vMinComfortable) const;
1844
1846 void interpolateLateralZ(Position& pos, double offset, double posLat) const;
1847
1851 double getDistanceToLeaveJunction() const;
1852
1853protected:
1854
1858
1861
1864
1867
1870
1876
1877
1878
1881
1883
1886
1887 /* @brief Complex data structure for keeping and updating LaneQ:
1888 * Each element of the outer vector corresponds to an upcoming edge on the vehicles route
1889 * The first element corresponds to the current edge and is returned in getBestLanes()
1890 * The other elements are only used as a temporary structure in updateBestLanes();
1891 */
1892 std::vector<std::vector<LaneQ> > myBestLanes;
1893
1894 /* @brief iterator to speed up retrieval of the current lane's LaneQ in getBestLaneOffset() and getBestLanesContinuation()
1895 * This is updated in updateOccupancyAndCurrentBestLane()
1896 */
1897 std::vector<LaneQ>::iterator myCurrentLaneInBestLanes;
1898
1899 static std::vector<MSLane*> myEmptyLaneVector;
1900
1903
1906 std::pair<double, const MSLink*> myNextTurn;
1907
1909 std::vector<MSLane*> myFurtherLanes;
1911 std::vector<double> myFurtherLanesPosLat;
1912
1915
1918
1921
1923
1925 double myAngle;
1926
1929
1932
1934
1939
1943
1944protected:
1945
1958 double accelV;
1961
1962 DriveProcessItem(MSLink* link, double vPass, double vWait, bool setRequest,
1963 SUMOTime arrivalTime, double arrivalSpeed,
1964 double arrivalSpeedBraking,
1965 double distance,
1966 double leaveSpeed) :
1967 myLink(link), myVLinkPass(vPass), myVLinkWait(vWait), mySetRequest(setRequest),
1968 myArrivalTime(arrivalTime), myArrivalSpeed(arrivalSpeed),
1969 myArrivalSpeedBraking(arrivalSpeedBraking),
1970 myDistance(distance),
1971 accelV(leaveSpeed), hadStoppedVehicle(false), availableSpace(0) {
1972 assert(vWait >= 0 || !MSGlobals::gSemiImplicitEulerUpdate);
1973 assert(vPass >= 0 || !MSGlobals::gSemiImplicitEulerUpdate);
1974 };
1975
1976
1978 DriveProcessItem(double vWait, double distance, double _availableSpace = 0) :
1979 myLink(0), myVLinkPass(vWait), myVLinkWait(vWait), mySetRequest(false),
1982 myDistance(distance),
1983 accelV(-1), hadStoppedVehicle(false), availableSpace(_availableSpace) {
1984 assert(vWait >= 0 || !MSGlobals::gSemiImplicitEulerUpdate);
1985 };
1986
1987
1988 inline void adaptLeaveSpeed(const double v) {
1989 if (accelV < 0) {
1990 accelV = v;
1991 } else {
1992 accelV = MIN2(accelV, v);
1993 }
1994 }
1995
1996 inline void adaptStopSpeed(const double v) {
1998 }
1999
2000 inline double getLeaveSpeed() const {
2001 return accelV < 0 ? myVLinkPass : accelV;
2002 }
2003 };
2004
2006 // TODO: Consider making LFLinkLanes a std::deque for efficient front removal (needs refactoring in checkRewindLinkLanes()...)
2007 typedef std::vector< DriveProcessItem > DriveItemVector;
2008
2011
2014
2020 DriveItemVector::iterator myNextDriveItem;
2021
2023 void planMoveInternal(const SUMOTime t, MSLeaderInfo ahead, DriveItemVector& lfLinks, double& myStopDist, std::pair<double, const MSLink*>& myNextTurn) const;
2024
2026 void checkRewindLinkLanes(const double lengthsInFront, DriveItemVector& lfLinks) const;
2027
2029 void removeApproachingInformation(const DriveItemVector& lfLinks) const;
2030
2031 /* @brief adapt safe velocity in accordance to a moving obstacle:
2032 * - a leader vehicle
2033 * - a vehicle or pedestrian that crosses this vehicles path on an upcoming intersection
2034 * @param[in] leaderInfo The leading vehicle and the (virtual) distance to it
2035 * @param[in] lastLink the lastLink index
2036 * @param[in,out] the safe velocity for driving
2037 * @param[in,out] the safe velocity for arriving at the next link
2038 */
2039 void adaptToLeader(const std::pair<const MSVehicle*, double> leaderInfo,
2040 double seen,
2041 DriveProcessItem* const lastLink,
2042 double& v, double& vLinkPass) const;
2043
2045 bool brakeForOverlap(const MSLink* link, const MSLane* lane) const;
2046
2047public:
2048 void adaptToJunctionLeader(const std::pair<const MSVehicle*, double> leaderInfo,
2049 const double seen, DriveProcessItem* const lastLink,
2050 const MSLane* const lane, double& v, double& vLinkPass,
2051 double distToCrossing = -1) const;
2052
2053 void adaptToOncomingLeader(const std::pair<const MSVehicle*, double> leaderInfo,
2054 DriveProcessItem* const lastLink,
2055 double& v, double& vLinkPass) const;
2056
2058 bool ignoreRed(const MSLink* link, bool canBrake) const;
2059
2061 bool ignoreFoe(const SUMOTrafficObject* foe) const;
2062
2064 inline double accelThresholdForWaiting() const {
2065 return 0.5 * getCarFollowModel().getMaxAccel();
2066 }
2067
2068 /* @brief return the previous lane in this vehicles route including internal lanes
2069 * @param[in] current The lane of which the predecessor should be returned
2070 * @param[in,out] routeIndex The index of the current or previous non-internal edge in the route
2071 */
2072 const MSLane* getPreviousLane(const MSLane* current, int& furtherIndex) const;
2073
2075 void checkLinkLeader(const MSLink* link, const MSLane* lane, double seen,
2076 DriveProcessItem* const lastLink, double& v, double& vLinkPass, double& vLinkWait, bool& setRequest,
2077 bool isShadowLink = false) const;
2078protected:
2079
2080 /* @brief adapt safe velocity in accordance to multiple vehicles ahead:
2081 * @param[in] ahead The leader information according to the current lateral-resolution
2082 * @param[in] latOffset the lateral offset for locating the ego vehicle on the given lane
2083 * @param[in] seen the distance to the end of the current lane
2084 * @param[in] lastLink the lastLink index
2085 * @param[in] lane The current Lane the vehicle is on
2086 * @param[in,out] the safe velocity for driving
2087 * @param[in,out] the safe velocity for arriving at the next link
2088 */
2089 void adaptToLeaders(const MSLeaderInfo& ahead,
2090 double latOffset,
2091 const double seen, DriveProcessItem* const lastLink,
2092 const MSLane* const lane, double& v, double& vLinkPass) const;
2093
2094 void adaptToLeaderDistance(const MSLeaderDistanceInfo& ahead, double latOffset,
2095 double seen,
2096 DriveProcessItem* const lastLink,
2097 double& v, double& vLinkPass) const;
2098
2099
2101 void checkLinkLeaderCurrentAndParallel(const MSLink* link, const MSLane* lane, double seen,
2102 DriveProcessItem* const lastLink, double& v, double& vLinkPass, double& vLinkWait, bool& setRequest) const;
2103
2104
2112 void updateState(double vNext);
2113
2114
2116 bool keepClear(const MSLink* link) const;
2117
2119 std::pair<double, double> estimateTimeToNextStop() const;
2120
2121 /* @brief special considerations for opposite direction driving so that the
2122 * result can be used directly by getPositionOnLane(...) */
2123 double getBackPositionOnLane(const MSLane* lane, bool calledByGetPosition) const;
2124
2131 bool hasArrivedInternal(bool oppositeTransformed = true) const;
2132
2133
2134 SUMOTime getArrivalTime(SUMOTime t, double seen, double v, double arrivalSpeed) const;
2135
2137 bool isOppositeLane(const MSLane* lane) const;
2138
2140 void cleanupFurtherLanes();
2141
2143 bool betterContinuation(const LaneQ* bestConnectedNext, const LaneQ& m) const;
2144
2145private:
2148
2151
2152
2153private:
2156
2159
2162
2163};
long long int SUMOTime
Definition GUI.h:36
std::vector< const MSEdge * > ConstMSEdgeVector
Definition MSEdge.h:74
std::shared_ptr< const MSRoute > ConstMSRoutePtr
Definition Route.h:32
SUMOTime DELTA_T
Definition SUMOTime.cpp:38
#define STEPS2TIME(x)
Definition SUMOTime.h:55
#define TIME2STEPS(x)
Definition SUMOTime.h:57
T MIN2(T a, T b)
Definition StdDefs.h:76
const double SUMO_const_haltingSpeed
the speed threshold at which vehicles are considered as halting
Definition StdDefs.h:58
Interface for lane-change models.
The base class for microscopic and mesoscopic vehicles.
MSVehicleType * myType
This vehicle's type.
void addStops(const bool ignoreStopErrors, MSRouteIterator *searchStart=nullptr, bool addRouteStops=true)
Adds stops to the built vehicle.
const MSVehicleType & getVehicleType() const
Returns the vehicle's type definition.
The car-following model abstraction.
Definition MSCFModel.h:55
double getMaxAccel() const
Get the vehicle type's maximum acceleration [m/s^2].
Definition MSCFModel.h:256
The ToC Device controls transition of control between automated and manual driving.
A device which collects info on current friction Coefficient on the road.
Abstract in-vehicle / in-person device.
Definition MSDevice.h:62
A road/street connecting two junctions.
Definition MSEdge.h:77
static bool gSemiImplicitEulerUpdate
Definition MSGlobals.h:53
static SUMOTime gWaitingTimeMemory
length of memory for waiting times (in millisecs)
Definition MSGlobals.h:115
The base class for an intersection.
Definition MSJunction.h:58
Performs lane changing of vehicles.
Performs lane changing of vehicles.
Representation of a lane in the micro simulation.
Definition MSLane.h:84
saves leader/follower vehicles and their distances relative to an ego vehicle
Something on a lane to be noticed about vehicle movement.
Notification
Definition of a vehicle state.
Interface for objects listening to vehicle state changes.
Definition MSNet.h:641
VehicleState
Definition of a vehicle state.
Definition MSNet.h:608
Definition of overhead wire segment.
A lane area vehicles can halt at.
Provides an interface to an error whose fluctuation is controlled via the driver's 'awareness',...
A lane area vehicles can halt at.
A static instance of this class in GapControlState deactivates gap control for vehicles whose referen...
Definition MSVehicle.h:1353
void vehicleStateChanged(const SUMOVehicle *const vehicle, MSNet::VehicleState to, const std::string &info="")
Called if a vehicle changes its state.
Changes the wished vehicle speed / lanes.
Definition MSVehicle.h:1348
void setLaneChangeMode(int value)
Sets lane changing behavior.
TraciLaneChangePriority myTraciLaneChangePriority
flags for determining the priority of traci lane change requests
Definition MSVehicle.h:1661
bool getEmergencyBrakeRedLight() const
Returns whether red lights shall be a reason to brake.
Definition MSVehicle.h:1518
SUMOTime getLaneTimeLineEnd()
void adaptLaneTimeLine(int indexShift)
Adapts lane timeline when moving to a new lane and the lane index changes.
void setRemoteControlled(Position xyPos, MSLane *l, double pos, double posLat, double angle, int edgeOffset, const ConstMSEdgeVector &route, SUMOTime t)
bool isRemoteAffected(SUMOTime t) const
int getSpeedMode() const
return the current speed mode
void deactivateGapController()
Deactivates the gap control.
Influencer()
Constructor.
void setSpeedMode(int speedMode)
Sets speed-constraining behaviors.
std::shared_ptr< GapControlState > myGapControlState
The gap control state.
Definition MSVehicle.h:1609
bool considerSafeVelocity() const
Returns whether safe velocities shall be considered.
Definition MSVehicle.h:1532
int getSignals() const
Definition MSVehicle.h:1580
bool myConsiderMaxDeceleration
Whether the maximum deceleration shall be regarded.
Definition MSVehicle.h:1627
ConstMSEdgeVector myRemoteRoute
Definition MSVehicle.h:1644
void setLaneTimeLine(const std::vector< std::pair< SUMOTime, int > > &laneTimeLine)
Sets a new lane timeline.
bool myRespectJunctionLeaderPriority
Whether the junction priority rules are respected (within)
Definition MSVehicle.h:1636
void setOriginalSpeed(double speed)
Stores the originally longitudinal speed.
double myOriginalSpeed
The velocity before influence.
Definition MSVehicle.h:1612
double getLatDist() const
Definition MSVehicle.h:1584
double implicitDeltaPosRemote(const MSVehicle *veh)
return the change in longitudinal position that is implicit in the new remote position
double implicitSpeedRemote(const MSVehicle *veh, double oldSpeed)
return the speed that is implicit in the new remote position
void postProcessRemoteControl(MSVehicle *v)
update position from remote control
double gapControlSpeed(SUMOTime currentTime, const SUMOVehicle *veh, double speed, double vSafe, double vMin, double vMax)
Applies gap control logic on the speed.
void setSublaneChange(double latDist)
Sets a new sublane-change request.
double getOriginalSpeed() const
Returns the originally longitudinal speed to use.
SUMOTime myLastRemoteAccess
Definition MSVehicle.h:1645
std::vector< std::pair< SUMOTime, int > > myLaneTimeLine
The lane usage time line to apply.
Definition MSVehicle.h:1606
bool getRespectJunctionLeaderPriority() const
Returns whether junction priority rules within the junction shall be respected (concerns vehicles wit...
Definition MSVehicle.h:1526
LaneChangeMode myStrategicLC
lane changing which is necessary to follow the current route
Definition MSVehicle.h:1650
LaneChangeMode mySpeedGainLC
lane changing to travel with higher speed
Definition MSVehicle.h:1654
void init()
Static initalization.
LaneChangeMode mySublaneLC
changing to the prefered lateral alignment
Definition MSVehicle.h:1658
bool getRespectJunctionPriority() const
Returns whether junction priority rules shall be respected (concerns approaching vehicles outside the...
Definition MSVehicle.h:1510
static void cleanup()
Static cleanup.
int getLaneChangeMode() const
return the current lane change mode
SUMOTime getLaneTimeLineDuration()
double influenceSpeed(SUMOTime currentTime, double speed, double vSafe, double vMin, double vMax)
Applies stored velocity information on the speed to use.
double changeRequestRemainingSeconds(const SUMOTime currentTime) const
Return the remaining number of seconds of the current laneTimeLine assuming one exists.
bool myConsiderSafeVelocity
Whether the safe velocity shall be regarded.
Definition MSVehicle.h:1621
bool mySpeedAdaptationStarted
Whether influencing the speed has already started.
Definition MSVehicle.h:1618
~Influencer()
Destructor.
void setSignals(int signals)
Definition MSVehicle.h:1576
double myLatDist
The requested lateral change.
Definition MSVehicle.h:1615
bool myEmergencyBrakeRedLight
Whether red lights are a reason to brake.
Definition MSVehicle.h:1633
LaneChangeMode myRightDriveLC
changing to the rightmost lane
Definition MSVehicle.h:1656
void setSpeedTimeLine(const std::vector< std::pair< SUMOTime, double > > &speedTimeLine)
Sets a new velocity timeline.
void updateRemoteControlRoute(MSVehicle *v)
update route if provided by remote control
std::vector< std::pair< SUMOTime, double > > mySpeedTimeLine
The velocity time line to apply.
Definition MSVehicle.h:1603
SUMOTime getLastAccessTimeStep() const
Definition MSVehicle.h:1556
bool myConsiderMaxAcceleration
Whether the maximum acceleration shall be regarded.
Definition MSVehicle.h:1624
LaneChangeMode myCooperativeLC
lane changing with the intent to help other vehicles
Definition MSVehicle.h:1652
bool isRemoteControlled() const
bool ignoreOverlap() const
Definition MSVehicle.h:1592
bool myRespectJunctionPriority
Whether the junction priority rules are respected (approaching)
Definition MSVehicle.h:1630
int influenceChangeDecision(const SUMOTime currentTime, const MSEdge &currentEdge, const int currentLaneIndex, int state)
Applies stored LaneChangeMode information and laneTimeLine.
void activateGapController(double originalTau, double newTimeHeadway, double newSpaceHeadway, double duration, double changeRate, double maxDecel, MSVehicle *refVeh=nullptr)
Activates the gap control with the given parameters,.
Container for manouevering time associated with stopping.
Definition MSVehicle.h:1272
SUMOTime myManoeuvreCompleteTime
Time at which this manoeuvre should complete.
Definition MSVehicle.h:1324
MSVehicle::ManoeuvreType getManoeuvreType() const
Accessor (get) for manoeuvre type.
std::string myManoeuvreStop
The name of the stop associated with the Manoeuvre - for debug output.
Definition MSVehicle.h:1318
bool manoeuvreIsComplete() const
Check if any manoeuver is ongoing and whether the completion time is beyond currentTime.
bool configureExitManoeuvre(MSVehicle *veh)
Setup the myManoeuvre for exiting (Sets completion time and manoeuvre type)
void setManoeuvreType(const MSVehicle::ManoeuvreType mType)
Accessor (set) for manoeuvre type.
Manoeuvre & operator=(const Manoeuvre &manoeuvre)
Assignment operator.
Manoeuvre()
Constructor.
std::string myManoeuvreVehicleID
The name of the vehicle associated with the Manoeuvre - for debug output.
Definition MSVehicle.h:1315
ManoeuvreType myManoeuvreType
Manoeuvre type - currently entry, exit or none.
Definition MSVehicle.h:1327
double getGUIIncrement() const
Accessor for GUI rotation step when parking (radians)
SUMOTime myManoeuvreStartTime
Time at which the Manoeuvre for this stop started.
Definition MSVehicle.h:1321
bool operator!=(const Manoeuvre &manoeuvre)
Operator !=.
bool entryManoeuvreIsComplete(MSVehicle *veh)
Configure an entry manoeuvre if nothing is configured - otherwise check if complete.
bool configureEntryManoeuvre(MSVehicle *veh)
Setup the entry manoeuvre for this vehicle (Sets completion time and manoeuvre type)
Container that holds the vehicles driving state (position+speed).
Definition MSVehicle.h:87
double lastCoveredDist() const
previous Speed of this state
Definition MSVehicle.h:127
double myPosLat
the stored lateral position
Definition MSVehicle.h:140
double myPreviousSpeed
the speed at the begin of the previous time step
Definition MSVehicle.h:148
double myPos
the stored position
Definition MSVehicle.h:134
bool operator!=(const State &state)
Operator !=.
double myLastCoveredDist
Definition MSVehicle.h:154
double mySpeed
the stored speed (should be >=0 at any time)
Definition MSVehicle.h:137
State & operator=(const State &state)
Assignment operator.
double posLat() const
Lateral Position of this state (m relative to the centerline of the lane).
Definition MSVehicle.h:117
double pos() const
Position of this state.
Definition MSVehicle.h:107
double speed() const
Speed of this state.
Definition MSVehicle.h:112
double backPos() const
back Position of this state
Definition MSVehicle.h:122
double myBackPos
the stored back position
Definition MSVehicle.h:145
Stores the waiting intervals over the previous seconds (memory is to be specified in ms....
Definition MSVehicle.h:162
void passTime(SUMOTime dt, bool waiting)
const std::string getState() const
SUMOTime cumulatedWaitingTime(SUMOTime memory=-1) const
std::deque< std::pair< SUMOTime, SUMOTime > > myWaitingIntervals
Definition MSVehicle.h:184
void setState(const std::string &state)
SUMOTime myMemorySize
the maximal memory to store
Definition MSVehicle.h:179
Representation of a vehicle in the micro simulation.
Definition MSVehicle.h:77
void setManoeuvreType(const MSVehicle::ManoeuvreType mType)
accessor function to myManoeuvre equivalent
TraciLaneChangePriority
modes for prioritizing traci lane change requests
Definition MSVehicle.h:1150
@ LCP_OPPORTUNISTIC
Definition MSVehicle.h:1154
const std::vector< double > & getFurtherLanesPosLat() const
Definition MSVehicle.h:839
double 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)
bool wasRemoteControlled(SUMOTime lookBack=DELTA_T) const
Returns the information whether the vehicle is fully controlled via TraCI within the lookBack time.
void processLinkApproaches(double &vSafe, double &vSafeMin, double &vSafeMinDist)
This method iterates through the driveprocess items for the vehicle and adapts the given in/out param...
SUMOTime getTimeSinceStartup() const
Returns the SUMOTime spent driving since startup (speed was larger than 0.1m/s)
Definition MSVehicle.h:687
const MSLane * getPreviousLane(const MSLane *current, int &furtherIndex) const
void checkLinkLeader(const MSLink *link, const MSLane *lane, double seen, DriveProcessItem *const lastLink, double &v, double &vLinkPass, double &vLinkWait, bool &setRequest, bool isShadowLink=false) const
checks for link leaders on the given link
void checkRewindLinkLanes(const double lengthsInFront, DriveItemVector &lfLinks) const
runs heuristic for keeping the intersection clear in case of downstream jamming
MSVehicle(const MSVehicle &)
invalidated copy constructor
bool willStop() const
Returns whether the vehicle will stop on the current edge.
bool hasDriverState() const
Whether this vehicle is equipped with a MSDriverState.
Definition MSVehicle.h:996
static int nextLinkPriority(const std::vector< MSLane * > &conts)
get a numerical value for the priority of the upcoming link
double getTimeGapOnLane() const
Returns the time gap in seconds to the leader of the vehicle on the same lane.
void updateBestLanes(bool forceRebuild=false, const MSLane *startLane=0)
computes the best lanes to use in order to continue the route
bool myAmIdling
Whether the vehicle is trying to enter the network (eg after parking so engine is running)
Definition MSVehicle.h:1920
SUMOTime myWaitingTime
The time the vehicle waits (is not faster than 0.1m/s) in seconds.
Definition MSVehicle.h:1856
double getStopDelay() const
Returns the public transport stop delay in seconds.
double computeAngle() const
compute the current vehicle angle
double myTimeLoss
the time loss in seconds due to driving with less than maximum speed
Definition MSVehicle.h:1860
SUMOTime myLastActionTime
Action offset (actions are taken at time myActionOffset + N*getActionStepLength()) Initialized to 0,...
Definition MSVehicle.h:1875
ConstMSEdgeVector::const_iterator getRerouteOrigin() const
Returns the starting point for reroutes (usually the current edge)
bool hasArrivedInternal(bool oppositeTransformed=true) const
Returns whether this vehicle has already arived (reached the arrivalPosition on its final edge) metho...
double getFriction() const
Returns the current friction on the road as perceived by the friction device.
bool ignoreFoe(const SUMOTrafficObject *foe) const
decide whether a given foe object may be ignored
void boardTransportables(MSStop &stop)
board persons and load transportables at the given stop
const std::vector< const MSLane * > getUpcomingLanesUntil(double distance) const
Returns the upcoming (best followed by default 0) sequence of lanes to continue the route starting at...
bool isOnRoad() const
Returns the information whether the vehicle is on a road (is simulated)
Definition MSVehicle.h:605
void adaptLaneEntering2MoveReminder(const MSLane &enteredLane)
Adapts the vehicle's entering of a new lane.
void addTransportable(MSTransportable *transportable)
Adds a person or container to this vehicle.
SUMOTime myJunctionConflictEntryTime
Definition MSVehicle.h:1938
SUMOTime getLastActionTime() const
Returns the time of the vehicle's last action point.
Definition MSVehicle.h:541
double getLeftSideOnEdge(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)
PositionVector getBoundingPoly(double offset=0) const
get bounding polygon
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...
bool brakeForOverlap(const MSLink *link, const MSLane *lane) const
handle with transitions
void workOnMoveReminders(double oldPos, double newPos, double newSpeed)
Processes active move reminder.
bool isStoppedOnLane() const
double getDistanceToPosition(double destPos, const MSLane *destLane) const
bool brokeDown() const
Returns how long the vehicle has been stopped already due to lack of energy.
double myAcceleration
The current acceleration after dawdling in m/s.
Definition MSVehicle.h:1902
void registerInsertionApproach(MSLink *link, double dist)
register approach on insertion
SUMOTime getTimeLoss() const
Returns the SUMOTime lost (speed was lesser maximum speed)
Definition MSVehicle.h:704
void cleanupFurtherLanes()
remove vehicle from further lanes (on leaving the network)
void adaptToLeaders(const MSLeaderInfo &ahead, double latOffset, const double seen, DriveProcessItem *const lastLink, const MSLane *const lane, double &v, double &vLinkPass) const
bool isActive() const
Returns whether the current simulation step is an action point for the vehicle.
Definition MSVehicle.h:628
const MSLane * getBackLane() const
Returns the lane the where the rear of the object is currently at.
double getTimeLossSeconds() const
Returns the time loss in seconds.
Definition MSVehicle.h:720
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.
double getBackPositionOnLane() const
Get the vehicle's position relative to its current lane.
Definition MSVehicle.h:405
void setPreviousSpeed(double prevSpeed, double prevAcceleration)
Sets the influenced previous speed.
const std::pair< double, const MSLink * > & getNextTurn()
Get the distance and direction of the next upcoming turn for the vehicle (within its look-ahead range...
Definition MSVehicle.h:827
SUMOTime getArrivalTime(SUMOTime t, double seen, double v, double arrivalSpeed) const
double getAccumulatedWaitingSeconds() const
Returns the number of seconds waited (speed was lesser than 0.1m/s) within the last millisecs.
Definition MSVehicle.h:714
SUMOTime getWaitingTime(const bool accumulated=false) const
Returns the SUMOTime waited (speed was lesser than 0.1m/s)
Definition MSVehicle.h:670
bool isFrontOnLane(const MSLane *lane) const
Returns the information whether the front of the vehicle is on the given lane.
virtual ~MSVehicle()
Destructor.
double getTimeSinceStartupSeconds() const
Definition MSVehicle.h:691
void processLaneAdvances(std::vector< MSLane * > &passedLanes, std::string &emergencyReason)
This method checks if the vehicle has advanced over one or several lanes along its route and triggers...
MSAbstractLaneChangeModel & getLaneChangeModel()
void setEmergencyBlueLight(SUMOTime currentTime)
sets the blue flashing light for emergency vehicles
bool isActionStep(SUMOTime t) const
Returns whether the next simulation step will be an action point for the vehicle.
Definition MSVehicle.h:635
MSAbstractLaneChangeModel * myLaneChangeModel
Definition MSVehicle.h:1882
Position getPositionAlongBestLanes(double offset) const
Return the (x,y)-position, which the vehicle would reach if it continued along its best continuation ...
bool hasValidRouteStart(std::string &msg)
checks wether the vehicle can depart on the first edge
double getLeftSideOnLane() const
Get the lateral position of the vehicles left side on the lane:
std::vector< MSLane * > myFurtherLanes
The information into which lanes the vehicle laps into.
Definition MSVehicle.h:1909
bool signalSet(int which) const
Returns whether the given signal is on.
Definition MSVehicle.h:1186
MSCFModel::VehicleVariables * myCFVariables
The per vehicle variables of the car following model.
Definition MSVehicle.h:2147
bool betterContinuation(const LaneQ *bestConnectedNext, const LaneQ &m) const
comparison between different continuations from the same lane
double getActionStepLengthSecs() const
Returns the vehicle's action step length in secs, i.e. the interval between two action points.
Definition MSVehicle.h:533
bool addTraciStop(SUMOVehicleParameter::Stop stop, std::string &errorMsg)
void checkLinkLeaderCurrentAndParallel(const MSLink *link, const MSLane *lane, double seen, DriveProcessItem *const lastLink, double &v, double &vLinkPass, double &vLinkWait, bool &setRequest) const
checks for link leaders of the current link as well as the parallel link (if there is one)
void planMoveInternal(const SUMOTime t, MSLeaderInfo ahead, DriveItemVector &lfLinks, double &myStopDist, std::pair< double, const MSLink * > &myNextTurn) const
std::pair< double, const MSLink * > myNextTurn
the upcoming turn for the vehicle
Definition MSVehicle.h:1906
double getDistanceToLeaveJunction() const
get the distance from the start of this lane to the start of the next normal lane (or 0 if this lane ...
int influenceChangeDecision(int state)
allow TraCI to influence a lane change decision
double getMaxSpeedOnLane() const
Returns the maximal speed for the vehicle on its current lane (including speed factor and deviation,...
bool isRemoteControlled() const
Returns the information whether the vehicle is fully controlled via TraCI.
bool myAmOnNet
Whether the vehicle is on the network (not parking, teleported, vaporized, or arrived)
Definition MSVehicle.h:1917
double nextStopDist() const
return the distance to the next stop or doubleMax if there is none.
Definition MSVehicle.h:1035
void enterLaneAtMove(MSLane *enteredLane, bool onTeleporting=false)
Update when the vehicle enters a new lane in the move step.
void adaptBestLanesOccupation(int laneIndex, double density)
update occupation from MSLaneChanger
std::pair< double, double > estimateTimeToNextStop() const
return time (s) and distance to the next stop
double accelThresholdForWaiting() const
maximum acceleration to consider a vehicle as 'waiting' at low speed
Definition MSVehicle.h:2064
void setAngle(double angle, bool straightenFurther=false)
Set a custom vehicle angle in rad, optionally updates furtherLanePosLat.
std::vector< LaneQ >::iterator myCurrentLaneInBestLanes
Definition MSVehicle.h:1897
MSVehicle & operator=(const MSVehicle &)
invalidated assignment operator
double getDeltaPos(const double accel) const
calculates the distance covered in the next integration step given an acceleration and assuming the c...
const MSLane * myLastBestLanesInternalLane
Definition MSVehicle.h:1885
void updateOccupancyAndCurrentBestLane(const MSLane *startLane)
updates LaneQ::nextOccupation and myCurrentLaneInBestLanes
const std::vector< MSLane * > getUpstreamOppositeLanes() const
Returns the sequence of opposite lanes corresponding to past lanes.
WaitingTimeCollector myWaitingTimeCollector
Definition MSVehicle.h:1857
void setRemoteState(Position xyPos)
sets position outside the road network
void fixPosition()
repair errors in vehicle position after changing between internal edges
double 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:514
double getSpeedWithoutTraciInfluence() const
Returns the uninfluenced velocity.
PositionVector getBoundingBox(double offset=0) const
get bounding rectangle
ManoeuvreType
flag identifying which, if any, manoeuvre is in progress
Definition MSVehicle.h:1245
@ MANOEUVRE_ENTRY
Manoeuvre into stopping place.
Definition MSVehicle.h:1247
@ MANOEUVRE_NONE
not manouevring
Definition MSVehicle.h:1251
@ MANOEUVRE_EXIT
Manoeuvre out of stopping place.
Definition MSVehicle.h:1249
const MSEdge * getNextEdgePtr() const
returns the next edge (possibly an internal edge)
Position getPosition(const double offset=0) const
Return current position (x/y, cartesian)
void setBrakingSignals(double vNext)
sets the braking lights on/off
const std::vector< MSLane * > & getBestLanesContinuation() const
Returns the best sequence of lanes to continue the route starting at myLane.
const MSEdge * myLastBestLanesEdge
Definition MSVehicle.h:1884
bool ignoreCollision() const
whether this vehicle is except from collision checks
Influencer * myInfluencer
An instance of a velocity/lane influencing instance; built in "getInfluencer".
Definition MSVehicle.h:2150
void saveState(OutputDevice &out)
Saves the states of a vehicle.
void setIdling(bool amIdling)
access function for Idling flag used to record whether vehicle is waiting to enter lane (after parkin...
Definition MSVehicle.h:613
void onRemovalFromNet(const MSMoveReminder::Notification reason)
Called when the vehicle is removed from the network.
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....
bool resumeFromStopping()
int getBestLaneOffset() const
void adaptToJunctionLeader(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
double lateralDistanceToLane(const int offset) const
Get the minimal lateral distance required to move fully onto the lane at given offset.
double getBackPositionOnLane(const MSLane *lane) const
Get the vehicle's position relative to the given lane.
Definition MSVehicle.h:398
void leaveLaneBack(const MSMoveReminder::Notification reason, const MSLane *leftLane)
Update of reminders if vehicle back leaves a lane during (during forward movement.
void resetActionOffset(const SUMOTime timeUntilNextAction=0)
Resets the action offset for the vehicle.
std::vector< DriveProcessItem > DriveItemVector
Container for used Links/visited Lanes during planMove() and executeMove.
Definition MSVehicle.h:2007
void interpolateLateralZ(Position &pos, double offset, double posLat) const
perform lateral z interpolation in elevated networks
void setBlinkerInformation()
sets the blue flashing light for emergency vehicles
const MSEdge * getCurrentEdge() const
Returns the edge the vehicle is currently at (possibly an internal edge or nullptr)
void adaptToLeaderDistance(const MSLeaderDistanceInfo &ahead, double latOffset, double seen, DriveProcessItem *const lastLink, double &v, double &vLinkPass) const
DriveItemVector::iterator myNextDriveItem
iterator pointing to the next item in myLFLinkLanes
Definition MSVehicle.h:2020
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.
const MSLink * myHaveStoppedFor
Definition MSVehicle.h:1942
bool isIdling() const
Returns whether a sim vehicle is waiting to enter a lane (after parking has completed)
Definition MSVehicle.h:621
std::shared_ptr< MSSimpleDriverState > getDriverState() const
Returns the vehicle driver's state.
void removeApproachingInformation(const DriveItemVector &lfLinks) const
unregister approach from all upcoming links
void replaceVehicleType(MSVehicleType *type)
Replaces the current vehicle type by the one given.
SUMOTime myJunctionEntryTimeNeverYield
Definition MSVehicle.h:1937
double getLatOffset(const MSLane *lane) const
Get the offset that that must be added to interpret myState.myPosLat for the given lane.
bool rerouteParkingArea(const std::string &parkingAreaID, std::string &errorMsg)
bool hasArrived() const
Returns whether this vehicle has already arived (reached the arrivalPosition on its final edge)
void switchOffSignal(int signal)
Switches the given signal off.
Definition MSVehicle.h:1169
void updateState(double vNext)
updates the vehicles state, given a next value for its speed. This value can be negative in case of t...
double getStopArrivalDelay() const
Returns the estimated public transport stop arrival delay in seconds.
int getSignals() const
Returns the signals.
Definition MSVehicle.h:1177
int mySignals
State of things of the vehicle that can be on or off.
Definition MSVehicle.h:1914
bool setExitManoeuvre()
accessor function to myManoeuvre equivalent
bool isOppositeLane(const MSLane *lane) const
whether the give lane is reverse direction of the current route or not
double myStopDist
distance to the next stop or doubleMax if there is none
Definition MSVehicle.h:1928
Signalling
Some boolean values which describe the state of some vehicle parts.
Definition MSVehicle.h:1104
@ VEH_SIGNAL_EMERGENCY_RED
A red emergency light is on.
Definition MSVehicle.h:1132
@ VEH_SIGNAL_NONE
Everything is switched off.
Definition MSVehicle.h:1106
@ VEH_SIGNAL_FOGLIGHT
The fog lights are on (no visualisation)
Definition MSVehicle.h:1118
@ VEH_SIGNAL_FRONTLIGHT
The front lights are on (no visualisation)
Definition MSVehicle.h:1116
@ VEH_SIGNAL_DOOR_OPEN_LEFT
One of the left doors is opened.
Definition MSVehicle.h:1126
@ VEH_SIGNAL_BLINKER_RIGHT
Right blinker lights are switched on.
Definition MSVehicle.h:1108
@ VEH_SIGNAL_BRAKELIGHT
The brake lights are on.
Definition MSVehicle.h:1114
@ VEH_SIGNAL_BACKDRIVE
The backwards driving lights are on (no visualisation)
Definition MSVehicle.h:1122
@ VEH_SIGNAL_EMERGENCY_BLUE
A blue emergency light is on.
Definition MSVehicle.h:1130
@ VEH_SIGNAL_BLINKER_LEFT
Left blinker lights are switched on.
Definition MSVehicle.h:1110
@ VEH_SIGNAL_DOOR_OPEN_RIGHT
One of the right doors is opened.
Definition MSVehicle.h:1128
@ VEH_SIGNAL_BLINKER_EMERGENCY
Blinker lights on both sides are switched on.
Definition MSVehicle.h:1112
@ VEH_SIGNAL_WIPER
The wipers are on.
Definition MSVehicle.h:1124
@ VEH_SIGNAL_EMERGENCY_YELLOW
A yellow emergency light is on.
Definition MSVehicle.h:1134
@ VEH_SIGNAL_HIGHBEAM
The high beam lights are on (no visualisation)
Definition MSVehicle.h:1120
SUMOTime getActionStepLength() const
Returns the vehicle's action step length in millisecs, i.e. the interval between two action points.
Definition MSVehicle.h:525
bool myHaveToWaitOnNextLink
Definition MSVehicle.h:1922
SUMOTime collisionStopTime() const
Returns the remaining time a vehicle needs to stop due to a collision. A negative value indicates tha...
const std::vector< const MSLane * > getPastLanesUntil(double distance) const
Returns the sequence of past lanes (right-most on edge) based on the route starting at the current la...
double getBestLaneDist() const
returns the distance that can be driven without lane change
std::pair< const MSVehicle *const, double > getLeader(double dist=0) const
Returns the leader of the vehicle looking for a fixed distance.
double slowDownForSchedule(double vMinComfortable) const
optionally return an upper bound on speed to stay within the schedule
bool executeMove()
Executes planned vehicle movements with regards to right-of-way.
const MSLane * getLane() const
Returns the lane the vehicle is on.
Definition MSVehicle.h:581
std::pair< const MSVehicle *const, double > getFollower(double dist=0) const
Returns the follower of the vehicle looking for a fixed distance.
SUMOTime getWaitingTimeFor(const MSLink *link) const
getWaitingTime, but taking into account having stopped for a stop-link
double getLastStepDist() const
Get the distance the vehicle covered in the previous timestep.
Definition MSVehicle.h:381
void invalidateCachedPosition()
Definition MSVehicle.h:421
ChangeRequest
Requests set via TraCI.
Definition MSVehicle.h:191
@ REQUEST_HOLD
vehicle want's to keep the current lane
Definition MSVehicle.h:199
@ REQUEST_LEFT
vehicle want's to change to left lane
Definition MSVehicle.h:195
@ REQUEST_NONE
vehicle doesn't want to change
Definition MSVehicle.h:193
@ REQUEST_RIGHT
vehicle want's to change to right lane
Definition MSVehicle.h:197
bool isLeader(const MSLink *link, const MSVehicle *veh, const double gap) const
whether the given vehicle must be followed at the given junction
void computeFurtherLanes(MSLane *enteredLane, double pos, bool collision=false)
updates myFurtherLanes on lane insertion or after collision
MSLane * getMutableLane() const
Returns the lane the vehicle is on Non const version indicates that something volatile is going on.
Definition MSVehicle.h:589
std::pair< const MSLane *, double > getLanePosAfterDist(double distance) const
return lane and position along bestlanes at the given distance
SUMOTime myCollisionImmunity
amount of time for which the vehicle is immune from collisions
Definition MSVehicle.h:1931
bool passingMinor() const
decide whether the vehicle is passing a minor link or has comitted to do so
void updateWaitingTime(double vNext)
Updates the vehicle's waiting time counters (accumulated and consecutive)
void enterLaneAtLaneChange(MSLane *enteredLane)
Update when the vehicle enters a new lane in the laneChange step.
BaseInfluencer & getBaseInfluencer()
Returns the velocity/lane influencer.
Influencer & getInfluencer()
bool isBidiOn(const MSLane *lane) const
whether this vehicle is driving against lane
double getRightSideOnLane() const
Get the lateral position of the vehicles right side on the lane:
bool unsafeLinkAhead(const MSLane *lane) const
whether the vehicle may safely move to the given lane with regard to upcoming links
double getCurrentApparentDecel() const
get apparent deceleration based on vType parameters and current acceleration
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
DriveItemVector myLFLinkLanesPrev
planned speeds from the previous step for un-registering from junctions after the new container is fi...
Definition MSVehicle.h:2013
std::vector< std::vector< LaneQ > > myBestLanes
Definition MSVehicle.h:1892
void setActionStepLength(double actionStepLength, bool resetActionOffset=true)
Sets the action steplength of the vehicle.
double getLateralPositionOnLane() const
Get the vehicle's lateral position on the lane.
Definition MSVehicle.h:413
double getSlope() const
Returns the slope of the road at vehicle's position in degrees.
bool myActionStep
The flag myActionStep indicates whether the current time step is an action point for the vehicle.
Definition MSVehicle.h:1872
const Position getBackPosition() const
bool congested() const
void loadState(const SUMOSAXAttributes &attrs, const SUMOTime offset)
Loads the state of this vehicle from the given description.
SUMOTime myTimeSinceStartup
duration of driving (speed > SUMO_const_haltingSpeed) after the last halting episode
Definition MSVehicle.h:1941
double getSpeed() const
Returns the vehicle's current speed.
Definition MSVehicle.h:490
void setApproachingForAllLinks(const SUMOTime t)
Register junction approaches for all link items in the current plan.
SUMOTime remainingStopDuration() const
Returns the remaining stop duration for a stopped vehicle or 0.
bool keepStopping(bool afterProcessing=false) const
Returns whether the vehicle is stopped and must continue to do so.
void workOnIdleReminders()
cycle through vehicle devices invoking notifyIdle
static std::vector< MSLane * > myEmptyLaneVector
Definition MSVehicle.h:1899
Position myCachedPosition
Definition MSVehicle.h:1933
bool replaceRoute(ConstMSRoutePtr route, const std::string &info, bool onInit=false, int offset=0, bool addStops=true, bool removeStops=true, std::string *msgReturn=nullptr)
Replaces the current route by the given one.
MSVehicle::ManoeuvreType getManoeuvreType() const
accessor function to myManoeuvre equivalent
double checkReversal(bool &canReverse, double speedThreshold=SUMO_const_haltingSpeed, double seen=0) const
void updateLaneBruttoSum()
Update the lane brutto occupancy after a change in minGap.
void removePassedDriveItems()
Erase passed drive items from myLFLinkLanes (and unregister approaching information for corresponding...
const std::vector< MSLane * > & getFurtherLanes() const
Definition MSVehicle.h:835
const std::vector< LaneQ > & getBestLanes() const
Returns the description of best lanes to use in order to continue the route.
std::vector< double > myFurtherLanesPosLat
lateral positions on further lanes
Definition MSVehicle.h:1911
bool checkActionStep(const SUMOTime t)
Returns whether the vehicle is supposed to take action in the current simulation step Updates myActio...
const MSCFModel & getCarFollowModel() const
Returns the vehicle's car following model definition.
Definition MSVehicle.h:969
Position validatePosition(Position result, double offset=0) const
ensure that a vehicle-relative position is not invalid
void loadPreviousApproaching(MSLink *link, bool setRequest, SUMOTime arrivalTime, double arrivalSpeed, double arrivalSpeedBraking, double dist, double leaveSpeed)
bool keepClear(const MSLink *link) const
decide whether the given link must be kept clear
bool manoeuvreIsComplete() const
accessor function to myManoeuvre equivalent
double processNextStop(double currentVelocity)
Processes stops, returns the velocity needed to reach the stop.
double myAngle
the angle in radians (
Definition MSVehicle.h:1925
bool ignoreRed(const MSLink *link, bool canBrake) const
decide whether a red (or yellow light) may be ignored
double getPositionOnLane() const
Get the vehicle's position along the lane.
Definition MSVehicle.h:374
void updateTimeLoss(double vNext)
Updates the vehicle's time loss.
MSDevice_DriverState * myDriverState
This vehicle's driver state.
Definition MSVehicle.h:1866
bool joinTrainPart(MSVehicle *veh)
try joining the given vehicle to the rear of this one (to resolve joinTriggered)
MSLane * myLane
The lane the vehicle is on.
Definition MSVehicle.h:1880
bool onFurtherEdge(const MSEdge *edge) const
whether this vehicle has its back (and no its front) on the given edge
double processTraCISpeedControl(double vSafe, double vNext)
Check for speed advices from the traci client and adjust the speed vNext in the current (euler) / aft...
Manoeuvre myManoeuvre
Definition MSVehicle.h:1334
double getLateralOverlap() const
return the amount by which the vehicle extends laterally outside it's primary lane
double getAngle() const
Returns the vehicle's direction in radians.
Definition MSVehicle.h:735
bool handleCollisionStop(MSStop &stop, const double distToStop)
bool hasInfluencer() const
whether the vehicle is individually influenced (via TraCI or special parameters)
Definition MSVehicle.h:1680
MSDevice_Friction * myFrictionDevice
This vehicle's friction perception.
Definition MSVehicle.h:1869
double getPreviousSpeed() const
Returns the vehicle's speed before the previous time step.
Definition MSVehicle.h:498
MSCFModel::VehicleVariables * getCarFollowVariables() const
Returns the vehicle's car following model variables.
Definition MSVehicle.h:990
MSVehicle()
invalidated default constructor
bool joinTrainPartFront(MSVehicle *veh)
try joining the given vehicle to the front of this one (to resolve joinTriggered)
void updateActionOffset(const SUMOTime oldActionStepLength, const SUMOTime newActionStepLength)
Process an updated action step length value (only affects the vehicle's action offset,...
double getBrakeGap(bool delayed=false) const
get distance for coming to a stop (used for rerouting checks)
void executeFractionalMove(double dist)
move vehicle forward by the given distance during insertion
LaneChangeMode
modes for resolving conflicts between external control (traci) and vehicle control over lane changing...
Definition MSVehicle.h:1142
virtual void drawOutsideNetwork(bool)
register vehicle for drawing while outside the network
Definition MSVehicle.h:1831
void initDevices()
void adaptToOncomingLeader(const std::pair< const MSVehicle *, double > leaderInfo, DriveProcessItem *const lastLink, double &v, double &vLinkPass) const
State myState
This Vehicles driving state (pos and speed)
Definition MSVehicle.h:1863
double 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)
void setLateralPositionOnLane(double posLat)
Definition MSVehicle.h:417
void adaptToLeader(const std::pair< const MSVehicle *, double > leaderInfo, double seen, DriveProcessItem *const lastLink, double &v, double &vLinkPass) const
void switchOnSignal(int signal)
Switches the given signal on.
Definition MSVehicle.h:1161
static bool overlap(const MSVehicle *veh1, const MSVehicle *veh2)
Definition MSVehicle.h:763
int getLaneIndex() const
void updateParkingState()
update state while parking
DriveItemVector myLFLinkLanes
container for the planned speeds in the current step
Definition MSVehicle.h:2010
void updateDriveItems()
Check whether the drive items (myLFLinkLanes) are up to date, and update them if required.
Position getVelocityVector() const
Returns the vehicle's direction in radians.
Definition MSVehicle.h:743
SUMOTime myJunctionEntryTime
time at which the current junction was entered
Definition MSVehicle.h:1936
The car-following model and parameter.
double getLengthWithGap() const
Get vehicle's length including the minimum gap [m].
double getActionStepLengthSecs() const
Returns this type's default action step length in seconds.
const MSCFModel & getCarFollowModel() const
Returns the vehicle type's car following model definition (const version)
SUMOTime getActionStepLength() const
Returns this type's default action step length.
Static storage of an output device and its base (abstract) implementation.
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37
static const Position INVALID
used to indicate that a position is valid
Definition Position.h:322
A list of positions.
Encapsulated SAX-Attributes.
Representation of a vehicle, person, or container.
Representation of a vehicle.
Definition SUMOVehicle.h:62
Definition of vehicle stop (position and duration)
Structure representing possible vehicle parameter.
Drive process items represent bounds on the safe velocity corresponding to the upcoming links.
Definition MSVehicle.h:1949
void adaptStopSpeed(const double v)
Definition MSVehicle.h:1996
DriveProcessItem(MSLink *link, double vPass, double vWait, bool setRequest, SUMOTime arrivalTime, double arrivalSpeed, double arrivalSpeedBraking, double distance, double leaveSpeed)
Definition MSVehicle.h:1962
double getLeaveSpeed() const
Definition MSVehicle.h:2000
DriveProcessItem(double vWait, double distance, double _availableSpace=0)
constructor if the link shall not be passed
Definition MSVehicle.h:1978
void adaptLeaveSpeed(const double v)
Definition MSVehicle.h:1988
Container for state and parameters of the gap control.
Definition MSVehicle.h:1365
bool active
Whether the gap control is active.
Definition MSVehicle.h:1396
static std::map< const MSVehicle *, GapControlState * > refVehMap
stores reference vehicles currently in use by a gapController
Definition MSVehicle.h:1407
SUMOTime lastUpdate
Time of the last update of the gap control.
Definition MSVehicle.h:1402
double changeRate
Rate by which the current time and space headways are changed towards the target value....
Definition MSVehicle.h:1390
double addGapTarget
Target value for the desired space headway.
Definition MSVehicle.h:1385
static GapControlVehStateListener * myVehStateListener
Definition MSVehicle.h:1410
double timeHeadwayIncrement
cache storage for the headway increments of the current operation
Definition MSVehicle.h:1404
double tauOriginal
Original value for the desired headway (will be reset after duration has expired)
Definition MSVehicle.h:1377
double tauCurrent
Current, interpolated value for the desired time headway.
Definition MSVehicle.h:1379
double remainingDuration
Remaining duration for keeping the target headway.
Definition MSVehicle.h:1387
void activate(double tauOriginal, double tauTarget, double additionalGap, double duration, double changeRate, double maxDecel, const MSVehicle *refVeh)
Start gap control with given params.
double addGapCurrent
Current, interpolated value for the desired space headway.
Definition MSVehicle.h:1383
static void cleanup()
Static cleanup (removes vehicle state listener)
double tauTarget
Target value for the desired time headway.
Definition MSVehicle.h:1381
void deactivate()
Stop gap control.
const MSVehicle * referenceVeh
reference vehicle for the gap - if it is null, the current leader on the ego's lane is used as a refe...
Definition MSVehicle.h:1394
double maxDecel
Maximal deceleration to be applied due to the adapted headway.
Definition MSVehicle.h:1392
bool gapAttained
Whether the desired gap was attained during the current activity phase (induces the remaining duratio...
Definition MSVehicle.h:1398
const MSVehicle * prevLeader
The last recognized leader.
Definition MSVehicle.h:1400
static void init()
Static initalization (adds vehicle state listener)
A structure representing the best lanes for continuing the current route starting at 'lane'.
Definition MSVehicle.h:857
double length
The overall length which may be driven when using this lane without a lane change.
Definition MSVehicle.h:861
bool allowsContinuation
Whether this lane allows to continue the drive.
Definition MSVehicle.h:871
double nextOccupation
As occupation, but without the first lane.
Definition MSVehicle.h:867
std::vector< MSLane * > bestContinuations
Definition MSVehicle.h:877
MSLane * lane
The described lane.
Definition MSVehicle.h:859
double currentLength
The length which may be driven on this lane.
Definition MSVehicle.h:863
int bestLaneOffset
The (signed) number of lanes to be crossed to get to the lane which allows to continue the drive.
Definition MSVehicle.h:869
double occupation
The overall vehicle sum on consecutive lanes which can be passed without a lane change.
Definition MSVehicle.h:865