SUMO - Simulation of Urban MObility
MSLane.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2018 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
22 // Representation of a lane in the micro simulation
23 /****************************************************************************/
24 #ifndef MSLane_h
25 #define MSLane_h
26 
27 
28 // ===========================================================================
29 // included modules
30 // ===========================================================================
31 #include <config.h>
32 
33 #include <vector>
34 #include <deque>
35 #include <cassert>
36 #include <utils/common/Named.h>
42 #include "MSLinkCont.h"
43 #include "MSLeaderInfo.h"
44 #include "MSMoveReminder.h"
45 #include <libsumo/Helper.h>
46 
47 
48 // ===========================================================================
49 // class declarations
50 // ===========================================================================
51 class MSEdge;
52 class MSVehicle;
53 class MSLaneChanger;
54 class MSLink;
55 class MSVehicleTransfer;
56 class MSVehicleControl;
57 class OutputDevice;
58 class MSLeaderInfo;
59 
60 
61 // ===========================================================================
62 // class definitions
63 // ===========================================================================
71 class MSLane : public Named, public Parameterised {
72 public:
74  friend class MSLaneChanger;
75  friend class MSLaneChangerSublane;
76 
77  friend class MSXMLRawOut;
78 
79  friend class MSQueueExport;
80  friend class AnyVehicleIterator;
81 
83  typedef std::vector<MSVehicle*> VehCont;
84 
87  struct VehPosition : public std::binary_function < const MSVehicle*, double, bool > {
89  bool operator()(const MSVehicle* cmp, double pos) const;
90  };
91 
92  // TODO: Better documentation
101  public:
103  const MSLane* lane,
104  int i1,
105  int i2,
106  int i3,
107  const int i1End,
108  const int i2End,
109  const int i3End,
110  bool downstream = true) :
111  myLane(lane),
112  myI1(i1),
113  myI2(i2),
114  myI3(i3),
115  myI1End(i1End),
116  myI2End(i2End),
117  myI3End(i3End),
118  myDownstream(downstream),
119  myDirection(downstream ? 1 : -1) {
120  }
121 
122  bool operator== (AnyVehicleIterator const& other) const {
123  return (myI1 == other.myI1
124  && myI2 == other.myI2
125  && myI3 == other.myI3
126  && myI1End == other.myI1End
127  && myI2End == other.myI2End
128  && myI3End == other.myI3End);
129  }
130 
131  bool operator!= (AnyVehicleIterator const& other) const {
132  return !(*this == other);
133  }
134 
136  return **this;
137  }
138 
139  const MSVehicle* operator*();
140 
141  AnyVehicleIterator& operator++();
142 
143  private:
144  bool nextIsMyVehicles() const;
145 
147  const MSLane* myLane;
149  int myI1;
151  int myI2;
153  int myI3;
155  int myI1End;
157  int myI2End;
159  int myI3End;
164 
165  };
166 
167 
168 public:
177  };
178 
193  MSLane(const std::string& id, double maxSpeed, double length, MSEdge* const edge,
194  int numericalID, const PositionVector& shape, double width,
195  SVCPermissions permissions, int index, bool isRampAccel);
196 
197 
199  virtual ~MSLane();
200 
201 
202 
205 
213  void addLink(MSLink* link);
214 
219  void addNeigh(const std::string& id);
221 
222 
223 
226 
233  virtual void addMoveReminder(MSMoveReminder* rem);
234 
235 
239  inline const std::vector< MSMoveReminder* >& getMoveReminders() const {
240  return myMoveReminders;
241  }
243 
244 
245 
248 
264  bool insertVehicle(MSVehicle& v);
265 
266 
285  bool isInsertionSuccess(MSVehicle* vehicle, double speed, double pos, double posLat,
286  bool recheckNextLanes,
287  MSMoveReminder::Notification notification);
288 
289  // XXX: Documentation?
290  bool checkFailure(const MSVehicle* aVehicle, double& speed, double& dist, const double nspeed, const bool patchSpeed, const std::string errorMsg) const;
291 
295  bool lastInsertion(MSVehicle& veh, double mspeed, double posLat, bool patchSpeed);
296 
304  bool freeInsertion(MSVehicle& veh, double speed, double posLat,
306 
307 
317  void forceVehicleInsertion(MSVehicle* veh, double pos, MSMoveReminder::Notification notification, double posLat = 0);
319 
320 
321 
325 
332  virtual double setPartialOccupation(MSVehicle* v);
333 
337  virtual void resetPartialOccupation(MSVehicle* v);
338 
341  virtual void setManeuverReservation(MSVehicle* v);
342 
346  virtual void resetManeuverReservation(MSVehicle* v);
347 
358  const MSLeaderInfo& getLastVehicleInformation(const MSVehicle* ego, double latOffset, double minPos = 0, bool allowCached = true) const;
359 
361  const MSLeaderInfo& getFirstVehicleInformation(const MSVehicle* ego, double latOffset, bool onlyFrontOnLane, double maxPos = std::numeric_limits<double>::max(), bool allowCached = true) const;
362 
364 
367 
372  int getVehicleNumber() const {
373  return (int)myVehicles.size();
374  }
375 
381  return (int)myVehicles.size() + (int)myPartialVehicles.size();
382  }
383 
389  return (int)myPartialVehicles.size();
390  }
391 
392 
399  virtual const VehCont& getVehiclesSecure() const {
400  return myVehicles;
401  }
402 
403 
406  return AnyVehicleIterator(this, 0, 0, 0,
407  (int)myVehicles.size(), (int)myPartialVehicles.size(), (int)myTmpVehicles.size(), true);
408  }
409 
412  return AnyVehicleIterator(this, (int)myVehicles.size(), (int)myPartialVehicles.size(), (int)myTmpVehicles.size(),
413  (int)myVehicles.size(), (int)myPartialVehicles.size(), (int)myTmpVehicles.size(), true);
414  }
415 
418  return AnyVehicleIterator(this, (int)myVehicles.size() - 1, (int)myPartialVehicles.size() - 1, (int)myTmpVehicles.size() - 1,
419  -1, -1, -1, false);
420  }
421 
424  return AnyVehicleIterator(this, -1, -1, -1, -1, -1, -1, false);
425  }
426 
429  virtual void releaseVehicles() const { }
431 
432 
433 
436 
437 
441  inline int getNumericalID() const {
442  return myNumericalID;
443  }
444 
445 
449  inline const PositionVector& getShape() const {
450  return myShape;
451  }
452 
454  inline double getLengthGeometryFactor() const {
455  return myLengthGeometryFactor;
456  }
457 
459  inline bool isAccelLane() const {
460  return myIsRampAccel;
461  }
462 
463  /* @brief fit the given lane position to a visibly suitable geometry position
464  * (lane length might differ from geometry length) */
465  inline double interpolateLanePosToGeometryPos(double lanePos) const {
466  return lanePos * myLengthGeometryFactor;
467  }
468 
469  /* @brief fit the given lane position to a visibly suitable geometry position
470  * and return the coordinates */
471  inline const Position geometryPositionAtOffset(double offset, double lateralOffset = 0) const {
472  return myShape.positionAtOffset(interpolateLanePosToGeometryPos(offset), lateralOffset);
473  }
474 
475  /* @brief fit the given geomtry position to a valid lane position
476  * (lane length might differ from geometry length) */
477  inline double interpolateGeometryPosToLanePos(double geometryPos) const {
478  return geometryPos / myLengthGeometryFactor;
479  }
480 
485  inline double getVehicleMaxSpeed(const SUMOVehicle* const veh) const {
486  if (myRestrictions != 0) {
487  std::map<SUMOVehicleClass, double>::const_iterator r = myRestrictions->find(veh->getVClass());
488  if (r != myRestrictions->end()) {
489  return MIN2(veh->getMaxSpeed(), r->second * veh->getChosenSpeedFactor());
490  }
491  }
492  return MIN2(veh->getMaxSpeed(), myMaxSpeed * veh->getChosenSpeedFactor());
493  }
494 
495 
499  inline double getSpeedLimit() const {
500  return myMaxSpeed;
501  }
502 
503 
507  inline double getLength() const {
508  return myLength;
509  }
510 
511 
516  return myPermissions;
517  }
518 
519 
523  double getWidth() const {
524  return myWidth;
525  }
526 
530  int getIndex() const {
531  return myIndex;
532  }
534 
536  int getCrossingIndex() const;
537 
538 
541 
549  virtual void planMovements(const SUMOTime t);
550 
559  void updateLeaderInfo(const MSVehicle* veh, VehCont::reverse_iterator& vehPart, VehCont::reverse_iterator& vehRes, MSLeaderInfo& ahead) const;
560 
571  virtual bool executeMovements(SUMOTime t, std::vector<MSLane*>& lanesWithVehiclesToIntegrate);
572 
574  virtual bool integrateNewVehicle(SUMOTime t);
576 
577 
578 
580  virtual void detectCollisions(SUMOTime timestep, const std::string& stage);
581 
582 
585  virtual bool appropriate(const MSVehicle* veh);
586 
587 
589  const MSLinkCont& getLinkCont() const;
590 
592  MSLink* getLinkTo(const MSLane*) const;
593 
595  MSLink* getEntryLink() const;
596 
597 
599  bool empty() const {
600  assert(myVehBuffer.size() == 0);
601  return myVehicles.empty();
602  }
603 
607  void setMaxSpeed(double val);
608 
612  void setLength(double val);
613 
617  MSEdge& getEdge() const {
618  return *myEdge;
619  }
620 
621 
625  const MSEdge* getNextNormal() const;
626 
627 
633  const MSLane* getFirstInternalInConnection(double& offset) const;
634 
635 
638 
649  static bool dictionary(const std::string& id, MSLane* lane);
650 
651 
658  static MSLane* dictionary(const std::string& id);
659 
660 
662  static void clear();
663 
664 
668  static int dictSize() {
669  return (int)myDict.size();
670  }
671 
672 
676  static void insertIDs(std::vector<std::string>& into);
677 
678 
683  template<class RTREE>
684  static void fill(RTREE& into);
686 
687 
688 
689  // XXX: succLink does not exist... Documentation?
694  static MSLinkCont::const_iterator succLinkSec(const SUMOVehicle& veh,
695  int nRouteSuccs,
696  const MSLane& succLinkSource,
697  const std::vector<MSLane*>& conts);
698 
699 
702  bool isLinkEnd(MSLinkCont::const_iterator& i) const;
703 
706  bool isLinkEnd(MSLinkCont::iterator& i);
707 
710  bool isEmpty() const;
711 
713  bool isInternal() const;
714 
716  MSVehicle* getLastFullVehicle() const;
717 
720 
722  MSVehicle* getLastAnyVehicle() const;
723 
725  MSVehicle* getFirstAnyVehicle() const;
726 
727  /* @brief remove the vehicle from this lane
728  * @param[notify] whether moveReminders of the vehicle shall be triggered
729  */
730  virtual MSVehicle* removeVehicle(MSVehicle* remVehicle, MSMoveReminder::Notification notification, bool notify = true);
731 
732  void leftByLaneChange(MSVehicle* v);
734 
738  MSLane* getParallelLane(int offset) const;
739 
740 
745  void setPermissions(SVCPermissions permissions, long long transientID);
746  void resetPermissions(long long transientID);
747 
748 
749  inline bool allowsVehicleClass(SUMOVehicleClass vclass) const {
750  return (myPermissions & vclass) == vclass;
751  }
752 
753  void addIncomingLane(MSLane* lane, MSLink* viaLink);
754 
755 
758  double length;
760  };
761 
762  const std::vector<IncomingLaneInfo>& getIncomingLanes() const {
763  return myIncomingLanes;
764  }
765 
766 
767  void addApproachingLane(MSLane* lane, bool warnMultiCon);
768  bool isApproachedFrom(MSEdge* const edge);
769  bool isApproachedFrom(MSEdge* const edge, MSLane* const lane);
770 
772  double getStopOffset(const MSVehicle* veh) const;
773 
775  const std::map<SVCPermissions, double>& getStopOffsets() const {
776  return myStopOffsets;
777  };
778 
780  void setStopOffsets(std::map<SVCPermissions, double> stopOffsets) {
781  myStopOffsets = stopOffsets;
782  };
783 
785  MSLeaderDistanceInfo getFollowersOnConsecutive(const MSVehicle* ego, double backOffset,
786  bool allSublanes, double searchDist = -1, bool ignoreMinorLinks = false) const;
787 
789  double getMissingRearGap(const MSVehicle* leader, double backOffset, double leaderSpeed) const;
790 
803  std::pair<MSVehicle* const, double> getLeader(const MSVehicle* veh, const double vehPos, const std::vector<MSLane*>& bestLaneConts, double dist = -1, bool checkTmpVehicles = false) const;
804 
827  std::pair<MSVehicle* const, double> getLeaderOnConsecutive(double dist, double seen,
828  double speed, const MSVehicle& veh, const std::vector<MSLane*>& bestLaneConts) const;
829 
831  void getLeadersOnConsecutive(double dist, double seen, double speed, const MSVehicle* ego,
832  const std::vector<MSLane*>& bestLaneConts, MSLeaderDistanceInfo& result) const;
833 
851  std::pair<MSVehicle* const, double> getCriticalLeader(double dist, double seen, double speed, const MSVehicle& veh) const;
852 
853  /* @brief return the partial vehicle closest behind ego or 0
854  * if no such vehicle exists */
855  MSVehicle* getPartialBehind(const MSVehicle* ego) const;
856 
859 
864 
867  MSLane* getLogicalPredecessorLane(const MSEdge& fromEdge) const;
868 
869 
876 
877 
884 
887 
889  const std::vector<std::pair<const MSLane*, const MSEdge*> > getOutgoingViaLanes() const;
890 
892 
893 
897  double getMeanSpeed() const;
898 
902  double getWaitingSeconds() const;
903 
904 
908  double getBruttoOccupancy() const;
909 
910 
914  double getNettoOccupancy() const;
915 
916 
920  inline double getBruttoVehLenSum() const {
922  }
923 
924 
928  double getCO2Emissions() const;
929 
930 
934  double getCOEmissions() const;
935 
936 
940  double getPMxEmissions() const;
941 
942 
946  double getNOxEmissions() const;
947 
948 
952  double getHCEmissions() const;
953 
954 
958  double getFuelConsumption() const;
959 
960 
964  double getElectricityConsumption() const;
965 
966 
970  double getHarmonoise_NoiseEmissions() const;
972 
973  void setRightSideOnEdge(double value, int rightmostSublane) {
974  myRightSideOnEdge = value;
975  myRightmostSublane = rightmostSublane;
976  }
977 
979  void initRestrictions();
980 
981  double getRightSideOnEdge() const {
982  return myRightSideOnEdge;
983  }
984 
985  int getRightmostSublane() const {
986  return myRightmostSublane;
987  }
988 
989  double getCenterOnEdge() const {
990  return myRightSideOnEdge + 0.5 * myWidth;
991  }
992 
994  void sortPartialVehicles();
995 
998 
1000  MSLane* getOpposite() const;
1001 
1003  double getOppositePos(double pos) const;
1004 
1005  /* @brief find leader for a vehicle depending on the relative driving direction
1006  * @param[in] ego The ego vehicle
1007  * @param[in] dist The look-ahead distance when looking at consecutive lanes
1008  * @param[in] oppositeDir Whether the lane has the opposite driving direction of ego
1009  * @return the leader vehicle and it's gap to ego
1010  */
1011  std::pair<MSVehicle* const, double> getOppositeLeader(const MSVehicle* ego, double dist, bool oppositeDir) const;
1012 
1013  /* @brief find follower for a vehicle that is located on the opposite of this lane
1014  * @param[in] ego The ego vehicle
1015  * @return the follower vehicle and it's gap to ego
1016  */
1017  std::pair<MSVehicle* const, double> getOppositeFollower(const MSVehicle* ego) const;
1018 
1019 
1027  std::pair<MSVehicle* const, double> getFollower(const MSVehicle* ego, double egoPos, double dist, bool ignoreMinorLinks) const;
1028 
1029 
1031  void addParking(MSVehicle* veh);
1032 
1034  virtual void removeParking(MSVehicle* veh);
1035 
1037  const std::set<const MSVehicle*>& getParkingVehicles() const {
1038  return myParkingVehicles;
1039  }
1040 
1042  virtual bool isSelected() const {
1043  return false;
1044  }
1045 
1048 
1056  void saveState(OutputDevice& out);
1057 
1069  void loadState(std::vector<std::string>& vehIDs, MSVehicleControl& vc);
1071 
1072 
1080  void visit(const LaneStoringVisitor& cont) const {
1081  cont.add(this);
1082  }
1083 
1084  static void initCollisionOptions(const OptionsCont& oc);
1085 
1086  static bool teleportOnCollision() {
1088  }
1089 
1091  return myCollisionAction;
1092  }
1093 
1094  static const long CHANGE_PERMISSIONS_PERMANENT = 0;
1095  static const long CHANGE_PERMISSIONS_GUI = 1;
1096 
1097 protected:
1099  virtual void swapAfterLaneChange(SUMOTime t);
1100 
1112  virtual void incorporateVehicle(MSVehicle* veh, double pos, double speed, double posLat,
1113  const MSLane::VehCont::iterator& at,
1115 
1117  void detectPedestrianJunctionCollision(const MSVehicle* collider, const PositionVector& colliderBoundary, const MSLane* foeLane,
1118  SUMOTime timestep, const std::string& stage);
1119 
1121  bool detectCollisionBetween(SUMOTime timestep, const std::string& stage, MSVehicle* collider, MSVehicle* victim,
1122  std::set<const MSVehicle*, ComparatorIdLess>& toRemove,
1123  std::set<const MSVehicle*>& toTeleport) const;
1124 
1126  void handleCollisionBetween(SUMOTime timestep, const std::string& stage, MSVehicle* collider, MSVehicle* victim,
1127  double gap, double latGap,
1128  std::set<const MSVehicle*, ComparatorIdLess>& toRemove,
1129  std::set<const MSVehicle*>& toTeleport) const;
1130 
1132  double getMaximumBrakeDist() const;
1133 
1134  /* @brief determine depart speed and whether it may be patched
1135  * @param[in] veh The departing vehicle
1136  * @param[out] whether the speed may be patched to account for safety
1137  * @return the depart speed
1138  */
1139  double getDepartSpeed(const MSVehicle& veh, bool& patchSpeed);
1140 
1141  /* @brief determine the lateral depart position
1142  * @param[in] veh The departing vehicle
1143  * @return the lateral depart position
1144  */
1145  double getDepartPosLat(const MSVehicle& veh);
1146 
1149  double safeInsertionSpeed(const MSVehicle* veh, double seen, const MSLeaderInfo& leaders, double speed);
1150 
1152  bool checkForPedestrians(const MSVehicle* aVehicle, double& speed, double& dist, double pos, bool patchSpeed) const;
1153 
1156 
1159 
1161  int myIndex;
1162 
1174  VehCont myVehicles;
1175 
1187 
1190  VehCont myTmpVehicles;
1191 
1194  VehCont myVehBuffer;
1195 
1203 
1204  /* @brief list of vehicles that are parking near this lane
1205  * (not necessarily on the road but having reached their stop on this lane)
1206  * */
1207  std::set<const MSVehicle*> myParkingVehicles;
1208 
1210  double myLength;
1211 
1213  const double myWidth;
1214 
1218  std::map<SVCPermissions, double> myStopOffsets;
1219 
1221  MSEdge* const myEdge;
1222 
1224  double myMaxSpeed;
1225 
1228 
1231 
1233  const std::map<SUMOVehicleClass, double>* myRestrictions;
1234 
1236  std::vector<IncomingLaneInfo> myIncomingLanes;
1237 
1240 
1243 
1246 
1249 
1252 
1256 
1258  std::map<MSEdge*, std::vector<MSLane*> > myApproachingLanes;
1259 
1264 
1266 
1271 
1274 
1276  const bool myIsRampAccel;
1277 
1282 
1283  // @brief the ids of neighboring lanes
1284  std::vector<std::string> myNeighs;
1285 
1286  // @brief transient changes in permissions
1287  std::map<long long, SVCPermissions> myPermissionChanges;
1288 
1290  typedef std::map< std::string, MSLane* > DictType;
1291 
1293  static DictType myDict;
1294 
1295 private:
1297  std::vector< MSMoveReminder* > myMoveReminders;
1298 
1304 
1310  public:
1312  explicit vehicle_position_sorter(const MSLane* lane) :
1313  myLane(lane) {
1314  }
1315 
1316 
1322  int operator()(MSVehicle* v1, MSVehicle* v2) const;
1323 
1324  const MSLane* myLane;
1325 
1326  };
1327 
1333  public:
1335  explicit vehicle_natural_position_sorter(const MSLane* lane) :
1336  myLane(lane) {
1337  }
1338 
1339 
1345  int operator()(MSVehicle* v1, MSVehicle* v2) const;
1346 
1347  const MSLane* myLane;
1348 
1349  };
1350 
1356  public:
1358  explicit by_connections_to_sorter(const MSEdge* const e);
1359 
1361  int operator()(const MSEdge* const e1, const MSEdge* const e2) const;
1362 
1363  private:
1364  by_connections_to_sorter& operator=(const by_connections_to_sorter&); // just to avoid a compiler warning
1365  private:
1366  const MSEdge* const myEdge;
1367  double myLaneDir;
1368  };
1369 
1370 
1371 
1377  public:
1379  explicit incoming_lane_priority_sorter(const MSLane* targetLane);
1380 
1382  int operator()(const IncomingLaneInfo& lane1, const IncomingLaneInfo& lane2) const;
1383 
1384  private:
1385  incoming_lane_priority_sorter& operator=(const incoming_lane_priority_sorter&); // just to avoid a compiler warning
1386  private:
1387  const MSLane* const myLane;
1388  double myLaneDir;
1389  };
1390 
1391 
1397  public:
1399  explicit outgoing_lane_priority_sorter(const MSLane* sourceLane);
1400 
1402  int operator()(const MSLink* link1, const MSLink* link2) const;
1403 
1404  private:
1405  outgoing_lane_priority_sorter& operator=(const outgoing_lane_priority_sorter&); // just to avoid a compiler warning
1406  private:
1407  const MSLane* const myLane;
1408  double myLaneDir;
1409  };
1410 
1414  class edge_finder {
1415  public:
1416  edge_finder(MSEdge* e) : myEdge(e) {}
1417  bool operator()(const IncomingLaneInfo& ili) const {
1418  return &(ili.lane->getEdge()) == myEdge;
1419  }
1420  private:
1421  edge_finder& operator=(const edge_finder&); // just to avoid a compiler warning
1422  private:
1423  const MSEdge* const myEdge;
1424  };
1425 
1426 private:
1428  MSLane(const MSLane&);
1429 
1431  MSLane& operator=(const MSLane&);
1432 
1433 
1434 };
1435 
1436 
1437 #endif
1438 
1439 /****************************************************************************/
1440 
void detectPedestrianJunctionCollision(const MSVehicle *collider, const PositionVector &colliderBoundary, const MSLane *foeLane, SUMOTime timestep, const std::string &stage)
detect whether a vehicle collids with pedestrians on the junction
Definition: MSLane.cpp:1349
const std::vector< IncomingLaneInfo > & getIncomingLanes() const
Definition: MSLane.h:762
std::pair< MSVehicle *const, double > getFollower(const MSVehicle *ego, double egoPos, double dist, bool ignoreMinorLinks) const
Find follower vehicle for the given ego vehicle (which may be on the opposite direction lane) ...
Definition: MSLane.cpp:3174
double getBruttoOccupancy() const
Returns the brutto (including minGaps) occupancy of this lane during the last step.
Definition: MSLane.cpp:2509
void loadState(std::vector< std::string > &vehIDs, MSVehicleControl &vc)
Loads the state of this segment with the given parameters.
Definition: MSLane.cpp:2871
SVCPermissions myPermissions
The vClass permissions for this lane.
Definition: MSLane.h:1227
MSLane * getLogicalPredecessorLane() const
get the most likely precedecessor lane (sorted using by_connections_to_sorter). The result is cached ...
Definition: MSLane.cpp:2382
VehCont myVehicles
The lane&#39;s vehicles. This container holds all vehicles that have their front (longitudinally) and the...
Definition: MSLane.h:1174
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:485
saves leader/follower vehicles and their distances relative to an ego vehicle
Definition: MSLeaderInfo.h:129
double getNOxEmissions() const
Returns the sum of last step NOx emissions.
Definition: MSLane.cpp:2604
MSEdge & getEdge() const
Returns the lane&#39;s edge.
Definition: MSLane.h:617
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:79
long long int SUMOTime
Definition: SUMOTime.h:36
MSVehicle * getFirstFullVehicle() const
returns the first vehicle for which this lane is responsible or 0
Definition: MSLane.cpp:1866
MSLane(const std::string &id, double maxSpeed, double length, MSEdge *const edge, int numericalID, const PositionVector &shape, double width, SVCPermissions permissions, int index, bool isRampAccel)
Constructor.
Definition: MSLane.cpp:167
void sortManeuverReservations()
sorts myManeuverReservations
Definition: MSLane.cpp:1817
const MSEdge * getNextNormal() const
Returns the lane&#39;s follower if it is an internal lane, the edge of the lane otherwise.
Definition: MSLane.cpp:1680
static void insertIDs(std::vector< std::string > &into)
Adds the ids of all stored lanes into the given vector.
Definition: MSLane.cpp:1740
void updateLeaderInfo(const MSVehicle *veh, VehCont::reverse_iterator &vehPart, VehCont::reverse_iterator &vehRes, MSLeaderInfo &ahead) const
This updates the MSLeaderInfo argument with respect to the given MSVehicle. All leader-vehicles on th...
Definition: MSLane.cpp:1134
Sorts lanes (IncomingLaneInfos) by their priority or, if this doesn&#39;t apply, wrt. the angle differenc...
Definition: MSLane.h:1376
virtual void removeParking(MSVehicle *veh)
remove parking vehicle. This must be syncrhonized when running with GUI
Definition: MSLane.cpp:2855
std::pair< MSVehicle *const, double > getOppositeLeader(const MSVehicle *ego, double dist, bool oppositeDir) const
Definition: MSLane.cpp:3193
static bool teleportOnCollision()
Definition: MSLane.h:1086
static const long CHANGE_PERMISSIONS_GUI
Definition: MSLane.h:1095
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
bool checkFailure(const MSVehicle *aVehicle, double &speed, double &dist, const double nspeed, const bool patchSpeed, const std::string errorMsg) const
Definition: MSLane.cpp:564
int myI2
index for myPartialVehicles
Definition: MSLane.h:151
double getFuelConsumption() const
Returns the sum of last step fuel consumption.
Definition: MSLane.cpp:2628
bool isInsertionSuccess(MSVehicle *vehicle, double speed, double pos, double posLat, bool recheckNextLanes, MSMoveReminder::Notification notification)
Tries to insert the given vehicle with the given state (speed and pos)
Definition: MSLane.cpp:593
static void fill(RTREE &into)
Fills the given RTree with lane instances.
Definition: MSLane.cpp:1748
double getMaximumBrakeDist() const
compute maximum braking distance on this lane
Definition: MSLane.cpp:2110
void setMaxSpeed(double val)
Sets a new maximum speed for the lane (used by TraCI and MSCalibrator)
Definition: MSLane.cpp:1997
std::vector< IncomingLaneInfo > myIncomingLanes
All direct predecessor lanes.
Definition: MSLane.h:1236
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
int myI2End
end index for myPartialVehicles
Definition: MSLane.h:157
void addLink(MSLink *link)
Delayed initialization.
Definition: MSLane.cpp:210
MSLane * myCanonicalPredecessorLane
Similar to LogicalPredecessorLane,.
Definition: MSLane.h:1242
int myIndex
The lane index.
Definition: MSLane.h:1161
virtual bool integrateNewVehicle(SUMOTime t)
Insert buffered vehicle into the real lane.
Definition: MSLane.cpp:1782
static double myCollisionMinGapFactor
Definition: MSLane.h:1303
SUMOTime myLeaderInfoTime
time step for which myLeaderInfo was last updated
Definition: MSLane.h:1268
bool operator()(const MSVehicle *cmp, double pos) const
compares vehicle position to the detector position
Definition: MSLane.cpp:2669
AnyVehicleIterator is a structure, which manages the iteration through all vehicles on the lane...
Definition: MSLane.h:100
static SUMOTime myCollisionStopTime
Definition: MSLane.h:1302
Notification
Definition of a vehicle state.
virtual void resetManeuverReservation(MSVehicle *v)
Unregisters a vehicle, which previously registered for maneuvering into this lane.
Definition: MSLane.cpp:276
virtual MSVehicle * removeVehicle(MSVehicle *remVehicle, MSMoveReminder::Notification notification, bool notify=true)
Definition: MSLane.cpp:2022
double myBruttoVehicleLengthSum
The current length of all vehicles on this lane, including their minGaps.
Definition: MSLane.h:1248
MSVehicle * getFirstAnyVehicle() const
returns the first vehicle that is fully or partially on this lane
Definition: MSLane.cpp:1889
const MSEdge *const myEdge
Definition: MSLane.h:1366
std::map< long long, SVCPermissions > myPermissionChanges
Definition: MSLane.h:1287
void addIncomingLane(MSLane *lane, MSLink *viaLink)
Definition: MSLane.cpp:2046
double getPMxEmissions() const
Returns the sum of last step PMx emissions.
Definition: MSLane.cpp:2592
void visit(const LaneStoringVisitor &cont) const
Callback for visiting the lane when traversing an RTree.
Definition: MSLane.h:1080
double getLength() const
Returns the lane&#39;s length.
Definition: MSLane.h:507
virtual const VehCont & getVehiclesSecure() const
Returns the vehicles container; locks it for microsimulation.
Definition: MSLane.h:399
const PositionVector & getShape() const
Returns this lane&#39;s shape.
Definition: MSLane.h:449
bool isLinkEnd(MSLinkCont::const_iterator &i) const
Definition: MSLane.cpp:1836
static void initCollisionOptions(const OptionsCont &oc)
Definition: MSLane.cpp:3245
Realises dumping the complete network state.
Definition: MSXMLRawOut.h:55
virtual void addMoveReminder(MSMoveReminder *rem)
Add a move-reminder to move-reminder container.
Definition: MSLane.cpp:223
MSLink * getLinkTo(const MSLane *) const
returns the link to the given lane or 0, if it is not connected
Definition: MSLane.cpp:1959
void leftByLaneChange(MSVehicle *v)
Definition: MSLane.cpp:2484
MSLane * getCanonicalPredecessorLane() const
Definition: MSLane.cpp:2421
void addNeigh(const std::string &id)
Adds a neighbor to this lane.
Definition: MSLane.cpp:216
const std::vector< MSMoveReminder *> & getMoveReminders() const
Return the list of this lane&#39;s move reminders.
Definition: MSLane.h:239
virtual double setPartialOccupation(MSVehicle *v)
Sets the information about a vehicle lapping into this lane.
Definition: MSLane.cpp:233
VehCont myPartialVehicles
The lane&#39;s partial vehicles. This container holds all vehicles that are partially on this lane but wh...
Definition: MSLane.h:1186
static bool myCheckJunctionCollisions
Definition: MSLane.h:1301
virtual void setManeuverReservation(MSVehicle *v)
Registers the lane change intentions (towards this lane) for the given vehicle.
Definition: MSLane.cpp:265
double getWidth() const
Returns the lane&#39;s width.
Definition: MSLane.h:523
int myI1End
end index for myVehicles
Definition: MSLane.h:155
int myDirection
index delta
Definition: MSLane.h:163
PositionVector myShape
The shape of the lane.
Definition: MSLane.h:1158
int myI3
index for myTmpVehicles
Definition: MSLane.h:153
MSLane * getCanonicalSuccessorLane() const
Definition: MSLane.cpp:2441
std::set< const MSVehicle * > myParkingVehicles
Definition: MSLane.h:1207
void getLeadersOnConsecutive(double dist, double seen, double speed, const MSVehicle *ego, const std::vector< MSLane *> &bestLaneConts, MSLeaderDistanceInfo &result) const
Returns the immediate leaders and the distance to them (as getLeaderOnConsecutive but for the sublane...
Definition: MSLane.cpp:3025
bool myDownstream
iteration direction
Definition: MSLane.h:161
int getVehicleNumberWithPartials() const
Returns the number of vehicles on this lane (including partial occupators)
Definition: MSLane.h:380
Performs lane changing of vehicles.
std::vector< std::string > myNeighs
Definition: MSLane.h:1284
static CollisionAction myCollisionAction
the action to take on collisions
Definition: MSLane.h:1300
int getNumericalID() const
Returns this lane&#39;s numerical id.
Definition: MSLane.h:441
std::map< std::string, MSLane *> DictType
definition of the static dictionary type
Definition: MSLane.h:1290
static CollisionAction getCollisionAction()
Definition: MSLane.h:1090
int getPartialVehicleNumber() const
Returns the number of vehicles partially on this lane (for which this lane is not responsible) ...
Definition: MSLane.h:388
MSLinkCont myLinks
Definition: MSLane.h:1255
virtual void detectCollisions(SUMOTime timestep, const std::string &stage)
Check if vehicles are too close.
Definition: MSLane.cpp:1184
static DictType myDict
Static dictionary to associate string-ids with objects.
Definition: MSLane.h:1293
Sorts lanes (their origin link) by the priority of their noninternal target edges or...
Definition: MSLane.h:1396
bool isInternal() const
Definition: MSLane.cpp:1852
void addApproachingLane(MSLane *lane, bool warnMultiCon)
Definition: MSLane.cpp:2056
Performs lane changing of vehicles.
Definition: MSLaneChanger.h:48
A road/street connecting two junctions.
Definition: MSEdge.h:75
bool insertVehicle(MSVehicle &v)
Tries to insert the given vehicle.
Definition: MSLane.cpp:488
virtual SUMOVehicleClass getVClass() const =0
Returns the vehicle&#39;s access class.
double getBruttoVehLenSum() const
Returns the sum of lengths of vehicles, including their minGaps, which were on the lane during the la...
Definition: MSLane.h:920
double myLength
Lane length [m].
Definition: MSLane.h:1210
int getIndex() const
Returns the lane&#39;s index.
Definition: MSLane.h:530
void resetPermissions(long long transientID)
Definition: MSLane.cpp:3277
VehCont myTmpVehicles
Container for lane-changing vehicles. After completion of lane-change- process, the containers will b...
Definition: MSLane.h:1190
void setPermissions(SVCPermissions permissions, long long transientID)
Sets the permissions to the given value. If a transientID is given, the permissions are recored as te...
Definition: MSLane.cpp:3265
MSLink * getEntryLink() const
Returns the entry link if this is an internal lane, else 0.
Definition: MSLane.cpp:1980
static int dictSize()
Returns the number of stored lanes.
Definition: MSLane.h:668
int getCrossingIndex() const
return the index of the link to the next crossing if this is walkingArea, else -1 ...
Definition: MSLane.cpp:2498
Export the queueing length in front of a junction (very experimental!)
Definition: MSQueueExport.h:50
virtual void resetPartialOccupation(MSVehicle *v)
Removes the information about a vehicle lapping into this lane.
Definition: MSLane.cpp:246
double getCO2Emissions() const
Returns the sum of last step CO2 emissions.
Definition: MSLane.cpp:2568
const bool myIsRampAccel
whether this lane is an acceleration lane
Definition: MSLane.h:1276
const MSEdge *const myEdge
Definition: MSLane.h:1423
Representation of a vehicle.
Definition: SUMOVehicle.h:60
friend class AnyVehicleIterator
Definition: MSLane.h:80
void setLength(double val)
Sets a new length for the lane (used by TraCI only)
Definition: MSLane.cpp:2004
double interpolateGeometryPosToLanePos(double geometryPos) const
Definition: MSLane.h:477
Sorts vehicles by their position (descending)
Definition: MSLane.h:1309
double myRightSideOnEdge
the combined width of all lanes with lower index on myEdge
Definition: MSLane.h:1279
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
double getCenterOnEdge() const
Definition: MSLane.h:989
bool lastInsertion(MSVehicle &veh, double mspeed, double posLat, bool patchSpeed)
inserts vehicle as close as possible to the last vehicle on this lane (or at the end of the lane if t...
Definition: MSLane.cpp:314
SVCPermissions myOriginalPermissions
The original vClass permissions for this lane (before temporary modifications)
Definition: MSLane.h:1230
A list of positions.
void enteredByLaneChange(MSVehicle *v)
Definition: MSLane.cpp:2491
const MSLeaderInfo & getLastVehicleInformation(const MSVehicle *ego, double latOffset, double minPos=0, bool allowCached=true) const
Returns the last vehicles on the lane.
Definition: MSLane.cpp:989
int getVehicleNumber() const
Returns the number of vehicles on this lane (for which this lane is responsible)
Definition: MSLane.h:372
const std::map< SUMOVehicleClass, double > * myRestrictions
The vClass speed restrictions for this lane.
Definition: MSLane.h:1233
bool isEmpty() const
Definition: MSLane.cpp:1847
bool checkForPedestrians(const MSVehicle *aVehicle, double &speed, double &dist, double pos, bool patchSpeed) const
check whether pedestrians on this lane interfere with vehicle insertion
Definition: MSLane.cpp:3292
std::pair< MSVehicle *const, double > getOppositeFollower(const MSVehicle *ego) const
Definition: MSLane.cpp:3216
SVCPermissions getPermissions() const
Returns the vehicle class permissions for this lane.
Definition: MSLane.h:515
double safeInsertionSpeed(const MSVehicle *veh, double seen, const MSLeaderInfo &leaders, double speed)
return the maximum safe speed for insertion behind leaders (a negative value indicates that safe inse...
Definition: MSLane.cpp:960
double getSpeedLimit() const
Returns the lane&#39;s maximum allowed speed.
Definition: MSLane.h:499
LinkState
The right-of-way state of a link between two lanes used when constructing a NBTrafficLightLogic, in MSLink and GNEInternalLane.
Sorts edges by their angle relative to the given edge (straight comes first)
Definition: MSLane.h:1355
void forceVehicleInsertion(MSVehicle *veh, double pos, MSMoveReminder::Notification notification, double posLat=0)
Inserts the given vehicle at the given position.
Definition: MSLane.cpp:951
void setStopOffsets(std::map< SVCPermissions, double > stopOffsets)
Set vehicle class specific stopOffsets.
Definition: MSLane.h:780
void add(const MSLane *const l) const
Adds the given object to the container.
Definition: Helper.cpp:60
T MIN2(T a, T b)
Definition: StdDefs.h:70
MSVehicle * getPartialBehind(const MSVehicle *ego) const
Definition: MSLane.cpp:3115
virtual bool isSelected() const
whether this lane is selected in the GUI
Definition: MSLane.h:1042
AnyVehicleIterator anyVehiclesEnd() const
end iterator for iterating over all vehicles touching this lane in downstream direction ...
Definition: MSLane.h:411
AnyVehicleIterator anyVehiclesBegin() const
begin iterator for iterating over all vehicles touching this lane in downstream direction ...
Definition: MSLane.h:405
LinkState getIncomingLinkState() const
get the state of the link from the logical predecessor to this lane
Definition: MSLane.cpp:2462
virtual bool executeMovements(SUMOTime t, std::vector< MSLane *> &lanesWithVehiclesToIntegrate)
Executes planned vehicle movements with regards to right-of-way.
Definition: MSLane.cpp:1572
std::pair< MSVehicle *const, double > getLeader(const MSVehicle *veh, const double vehPos, const std::vector< MSLane *> &bestLaneConts, double dist=-1, bool checkTmpVehicles=false) const
Returns the immediate leader of veh and the distance to veh starting on this lane.
Definition: MSLane.cpp:2120
CollisionAction
Definition: MSLane.h:172
int myRightmostSublane
the index of the rightmost sublane of this lane on myEdge
Definition: MSLane.h:1281
MSLane * myLogicalPredecessorLane
Definition: MSLane.h:1239
Something on a lane to be noticed about vehicle movement.
const std::vector< std::pair< const MSLane *, const MSEdge * > > getOutgoingViaLanes() const
get the list of outgoing lanes
Definition: MSLane.cpp:2473
MSLane * getOpposite() const
return the opposite direction lane for lane changing or 0
Definition: MSLane.cpp:3153
AnyVehicleIterator anyVehiclesUpstreamBegin() const
begin iterator for iterating over all vehicles touching this lane in upstream direction ...
Definition: MSLane.h:417
virtual void swapAfterLaneChange(SUMOTime t)
moves myTmpVehicles int myVehicles after a lane change procedure
Definition: MSLane.cpp:2011
An upper class for objects with additional parameters.
Definition: Parameterised.h:44
double getHCEmissions() const
Returns the sum of last step HC emissions.
Definition: MSLane.cpp:2616
virtual double getChosenSpeedFactor() const =0
std::map< MSEdge *, std::vector< MSLane * > > myApproachingLanes
All direct internal and direct (disregarding internal predecessors) non-internal predecessor lanes of...
Definition: MSLane.h:1258
std::vector< MSVehicle * > VehCont
Container for vehicles.
Definition: MSLane.h:83
static MSLinkCont::const_iterator succLinkSec(const SUMOVehicle &veh, int nRouteSuccs, const MSLane &succLinkSource, const std::vector< MSLane *> &conts)
Definition: MSLane.cpp:1903
const std::map< SVCPermissions, double > & getStopOffsets() const
Returns vehicle class specific stopOffsets.
Definition: MSLane.h:775
Base class for objects which have an id.
Definition: Named.h:49
std::map< SVCPermissions, double > myStopOffsets
Definition: MSLane.h:1218
int myNumericalID
Unique numerical ID (set on reading by netload)
Definition: MSLane.h:1155
std::vector< MSMoveReminder *> myMoveReminders
This lane&#39;s move reminder.
Definition: MSLane.h:1297
VehCont myManeuverReservations
The vehicles which registered maneuvering into the lane within their current action step...
Definition: MSLane.h:1202
virtual double getMaxSpeed() const =0
Returns the vehicle&#39;s maximum speed.
double getRightSideOnEdge() const
Definition: MSLane.h:981
MSLeaderInfo getPartialBeyond() const
get all vehicles that are inlapping from consecutive edges
Definition: MSLane.cpp:3138
void initRestrictions()
initialized vClass-specific speed limits
Definition: MSLane.cpp:202
double getLengthGeometryFactor() const
return shape.length() / myLength
Definition: MSLane.h:454
AnyVehicleIterator(const MSLane *lane, int i1, int i2, int i3, const int i1End, const int i2End, const int i3End, bool downstream=true)
Definition: MSLane.h:102
int getRightmostSublane() const
Definition: MSLane.h:985
MSVehicle * getLastFullVehicle() const
returns the last vehicle for which this lane is responsible or 0
Definition: MSLane.cpp:1857
void sortPartialVehicles()
sorts myPartialVehicles
Definition: MSLane.cpp:1809
bool freeInsertion(MSVehicle &veh, double speed, double posLat, MSMoveReminder::Notification notification=MSMoveReminder::NOTIFICATION_DEPARTED)
Tries to insert the given vehicle on any place.
Definition: MSLane.cpp:349
double getElectricityConsumption() const
Returns the sum of last step electricity consumption.
Definition: MSLane.cpp:2640
static bool dictionary(const std::string &id, MSLane *lane)
Static (sic!) container methods {.
Definition: MSLane.cpp:1708
The vehicle has departed (was inserted into the network)
double getCOEmissions() const
Returns the sum of last step CO emissions.
Definition: MSLane.cpp:2580
std::pair< MSVehicle *const, double > getLeaderOnConsecutive(double dist, double seen, double speed, const MSVehicle &veh, const std::vector< MSLane *> &bestLaneConts) const
Returns the immediate leader and the distance to him.
Definition: MSLane.cpp:2185
int myI1
index for myVehicles
Definition: MSLane.h:149
double getOppositePos(double pos) const
return the corresponding position on the opposite lane
Definition: MSLane.cpp:3162
bool operator()(const IncomingLaneInfo &ili) const
Definition: MSLane.h:1417
static void clear()
Clears the dictionary.
Definition: MSLane.cpp:1731
const MSLane * getFirstInternalInConnection(double &offset) const
Returns 0 if the lane is not internal. Otherwise the first part of the connection (sequence of intern...
Definition: MSLane.cpp:1690
int myI3End
end index for myTmpVehicles
Definition: MSLane.h:159
MSEdge *const myEdge
The lane&#39;s edge, for routing only.
Definition: MSLane.h:1221
const MSVehicle * operator->()
Definition: MSLane.h:135
bool detectCollisionBetween(SUMOTime timestep, const std::string &stage, MSVehicle *collider, MSVehicle *victim, std::set< const MSVehicle *, ComparatorIdLess > &toRemove, std::set< const MSVehicle *> &toTeleport) const
detect whether there is a collision between the two vehicles
Definition: MSLane.cpp:1382
const MSLane * myLane
the lane that is being iterated
Definition: MSLane.h:147
A storage for options typed value containers)
Definition: OptionsCont.h:92
double interpolateLanePosToGeometryPos(double lanePos) const
Definition: MSLane.h:465
MSVehicle * getLastAnyVehicle() const
returns the last vehicle that is fully or partially on this lane
Definition: MSLane.cpp:1875
const Position geometryPositionAtOffset(double offset, double lateralOffset=0) const
Definition: MSLane.h:471
bool isApproachedFrom(MSEdge *const edge)
Definition: MSLane.cpp:2070
double getHarmonoise_NoiseEmissions() const
Returns the sum of last step noise emissions.
Definition: MSLane.cpp:2652
double getStopOffset(const MSVehicle *veh) const
Returns vehicle class specific stopOffset for the vehicle.
Definition: MSLane.cpp:2886
std::pair< MSVehicle *const, double > getCriticalLeader(double dist, double seen, double speed, const MSVehicle &veh) const
Returns the most dangerous leader and the distance to him.
Definition: MSLane.cpp:2309
AnyVehicleIterator anyVehiclesUpstreamEnd() const
end iterator for iterating over all vehicles touching this lane in upstream direction ...
Definition: MSLane.h:423
const MSLeaderInfo & getFirstVehicleInformation(const MSVehicle *ego, double latOffset, bool onlyFrontOnLane, double maxPos=std::numeric_limits< double >::max(), bool allowCached=true) const
analogue to getLastVehicleInformation but in the upstream direction
Definition: MSLane.cpp:1042
bool allowsVehicleClass(SUMOVehicleClass vclass) const
Definition: MSLane.h:749
MSLane & operator=(const MSLane &)
invalidated assignment operator
const std::set< const MSVehicle * > & getParkingVehicles() const
retrieve the parking vehicles (see GUIParkingArea)
Definition: MSLane.h:1037
void saveState(OutputDevice &out)
Saves the state of this lane into the given stream.
Definition: MSLane.cpp:2860
MSLeaderInfo myLeaderInfo
leaders on all sublanes as seen by approaching vehicles (cached)
Definition: MSLane.h:1261
MSLane * myCanonicalSuccessorLane
Main successor lane,.
Definition: MSLane.h:1245
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:64
double myNettoVehicleLengthSum
The current length of all vehicles on this lane, excluding their minGaps.
Definition: MSLane.h:1251
double getMeanSpeed() const
Returns the mean speed on this lane.
Definition: MSLane.cpp:2552
MSLeaderInfo myFollowerInfo
followers on all sublanes as seen by vehicles on consecutive lanes (cached)
Definition: MSLane.h:1263
virtual ~MSLane()
Destructor.
Definition: MSLane.cpp:194
void addParking(MSVehicle *veh)
add parking vehicle. This should only used during state loading
Definition: MSLane.cpp:2849
The class responsible for building and deletion of vehicles.
double getMissingRearGap(const MSVehicle *leader, double backOffset, double leaderSpeed) const
return by how much further the leader must be inserted to avoid rear end collisions ...
Definition: MSLane.cpp:2094
const double myLengthGeometryFactor
precomputed myShape.length / myLength
Definition: MSLane.h:1273
MSLeaderInfo myLeaderInfoTmp
Definition: MSLane.h:1265
const MSLinkCont & getLinkCont() const
returns the container with all links !!!
Definition: MSLane.cpp:1952
VehCont myVehBuffer
Buffer for vehicles that moved from their previous lane onto this one. Integrated after all vehicles ...
Definition: MSLane.h:1194
double getDepartPosLat(const MSVehicle &veh)
Definition: MSLane.cpp:464
static const long CHANGE_PERMISSIONS_PERMANENT
Definition: MSLane.h:1094
MSLeaderDistanceInfo getFollowersOnConsecutive(const MSVehicle *ego, double backOffset, bool allSublanes, double searchDist=-1, bool ignoreMinorLinks=false) const
return the sublane followers with the largest missing rear gap among all predecessor lanes (within di...
Definition: MSLane.cpp:2900
bool empty() const
Returns true if there is not a single vehicle on the lane.
Definition: MSLane.h:599
SUMOTime myFollowerInfoTime
time step for which myFollowerInfo was last updated
Definition: MSLane.h:1270
virtual void releaseVehicles() const
Allows to use the container for microsimulation again.
Definition: MSLane.h:429
void handleCollisionBetween(SUMOTime timestep, const std::string &stage, MSVehicle *collider, MSVehicle *victim, double gap, double latGap, std::set< const MSVehicle *, ComparatorIdLess > &toRemove, std::set< const MSVehicle *> &toTeleport) const
take action upon collision
Definition: MSLane.cpp:1448
double myMaxSpeed
Lane-wide speedlimit [m/s].
Definition: MSLane.h:1224
double getNettoOccupancy() const
Returns the netto (excluding minGaps) occupancy of this lane during the last step (including minGaps)...
Definition: MSLane.cpp:2524
Position positionAtOffset(double pos, double lateralOffset=0) const
Returns the position at the given length.
Representation of a lane in the micro simulation.
Definition: MSLane.h:71
double getWaitingSeconds() const
Returns the overall waiting time on this lane.
Definition: MSLane.cpp:2539
const double myWidth
Lane width [m].
Definition: MSLane.h:1213
edge_finder(MSEdge *e)
Definition: MSLane.h:1416
void setRightSideOnEdge(double value, int rightmostSublane)
Definition: MSLane.h:973
bool isAccelLane() const
return whether this lane is an acceleration lane
Definition: MSLane.h:459
virtual void incorporateVehicle(MSVehicle *veh, double pos, double speed, double posLat, const MSLane::VehCont::iterator &at, MSMoveReminder::Notification notification=MSMoveReminder::NOTIFICATION_DEPARTED)
Inserts the vehicle into this lane, and informs it about entering the network.
Definition: MSLane.cpp:294
virtual bool appropriate(const MSVehicle *veh)
Definition: MSLane.cpp:1764
virtual void planMovements(const SUMOTime t)
Compute safe velocities for all vehicles based on positions and speeds from the last time step...
Definition: MSLane.cpp:1094
MSLane * getParallelLane(int offset) const
Returns the lane with the given offset parallel to this one or 0 if it does not exist.
Definition: MSLane.cpp:2040
vehicle_position_sorter(const MSLane *lane)
Constructor.
Definition: MSLane.h:1312
vehicle_natural_position_sorter(const MSLane *lane)
Constructor.
Definition: MSLane.h:1335
double getDepartSpeed(const MSVehicle &veh, bool &patchSpeed)
Definition: MSLane.cpp:437