SUMO - Simulation of Urban MObility
MSLane.h
Go to the documentation of this file.
1 /****************************************************************************/
13 // Representation of a lane in the micro simulation
14 /****************************************************************************/
15 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
16 // Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors
17 /****************************************************************************/
18 //
19 // This file is part of SUMO.
20 // SUMO is free software: you can redistribute it and/or modify
21 // it under the terms of the GNU General Public License as published by
22 // the Free Software Foundation, either version 3 of the License, or
23 // (at your option) any later version.
24 //
25 /****************************************************************************/
26 #ifndef MSLane_h
27 #define MSLane_h
28 
29 
30 // ===========================================================================
31 // included modules
32 // ===========================================================================
33 #ifdef _MSC_VER
34 #include <windows_config.h>
35 #else
36 #include <config.h>
37 #endif
38 
39 #include <vector>
40 #include <deque>
41 #include <cassert>
42 #include <utils/common/Named.h>
48 #include "MSLinkCont.h"
49 #include "MSMoveReminder.h"
50 #ifndef NO_TRACI
52 #endif
53 
54 
55 // ===========================================================================
56 // class declarations
57 // ===========================================================================
58 class MSEdge;
59 class MSVehicle;
60 class MSLaneChanger;
61 class MSLink;
62 class MSVehicleTransfer;
63 class MSVehicleControl;
64 class OutputDevice;
65 
66 
67 // ===========================================================================
68 // class definitions
69 // ===========================================================================
77 class MSLane : public Named, public Parameterised {
78 public:
80  friend class MSLaneChanger;
81 
82  friend class MSXMLRawOut;
83 
84  friend class MSQueueExport;
85 
86 
88  typedef std::vector< MSVehicle* > VehCont;
89 
92  struct VehPosition : public std::binary_function < const MSVehicle*, SUMOReal, bool > {
94  bool operator()(const MSVehicle* cmp, SUMOReal pos) const;
95  };
96 
97 public:
110  MSLane(const std::string& id, SUMOReal maxSpeed, SUMOReal length, MSEdge* const edge,
111  unsigned int numericalID, const PositionVector& shape, SUMOReal width,
112  SVCPermissions permissions);
113 
114 
116  virtual ~MSLane();
117 
118 
119 
122 
130  void addLink(MSLink* link);
132 
133 
134 
137 
144  virtual void addMoveReminder(MSMoveReminder* rem);
145 
146 
150  inline const std::vector< MSMoveReminder* >& getMoveReminders() const {
151  return myMoveReminders;
152  }
154 
155 
156 
159 
175  bool insertVehicle(MSVehicle& v);
176 
177 
195  bool isInsertionSuccess(MSVehicle* vehicle, SUMOReal speed, SUMOReal pos,
196  bool recheckNextLanes,
197  MSMoveReminder::Notification notification);
198 
199  bool checkFailure(MSVehicle* aVehicle, SUMOReal& speed, SUMOReal& dist, const SUMOReal nspeed, const bool patchSpeed, const std::string errorMsg) const;
200  bool pWagGenericInsertion(MSVehicle& veh, SUMOReal speed, SUMOReal maxPos, SUMOReal minPos);
201  bool pWagSimpleInsertion(MSVehicle& veh, SUMOReal speed, SUMOReal maxPos, SUMOReal minPos);
202  bool maxSpeedGapInsertion(MSVehicle& veh, SUMOReal mspeed);
203 
211  bool freeInsertion(MSVehicle& veh, SUMOReal speed,
213 
214 
222  void forceVehicleInsertion(MSVehicle* veh, SUMOReal pos);
224 
225 
226 
229 
241  SUMOReal setPartialOccupation(MSVehicle* v, SUMOReal leftVehicleLength);
242 
243 
248 
249 
254  return myInlappingVehicle;
255  }
256 
257 
262  return myInlappingVehicleEnd;
263  }
264 
265 
274  std::pair<MSVehicle*, SUMOReal> getLastVehicleInformation() const;
276 
277 
278 
281 
285  unsigned int getVehicleNumber() const {
286  return (unsigned int) myVehicles.size();
287  }
288 
289 
296  virtual const VehCont& getVehiclesSecure() const {
297  return myVehicles;
298  }
299 
300 
303  virtual void releaseVehicles() const { }
305 
306 
307 
310 
311 
315  inline size_t getNumericalID() const {
316  return myNumericalID;
317  }
318 
319 
323  inline const PositionVector& getShape() const {
324  return myShape;
325  }
326 
329  return myLengthGeometryFactor;
330  }
331 
332  /* @brief fit the given lane position to a visibly suitable geometry position
333  * (lane length might differ from geometry length) */
335  return lanePos * myLengthGeometryFactor;
336  }
337 
338  /* @brief fit the given lane position to a visibly suitable geometry position
339  * and return the coordinates */
340  inline const Position geometryPositionAtOffset(SUMOReal offset) const {
342  }
343 
344  /* @brief fit the given geomtry position to a valid lane position
345  * (lane length might differ from geometry length) */
347  return geometryPos / myLengthGeometryFactor;
348  }
349 
354  inline SUMOReal getVehicleMaxSpeed(const SUMOVehicle* const veh) const {
355  if (myRestrictions != 0) {
356  std::map<SUMOVehicleClass, SUMOReal>::const_iterator r = myRestrictions->find(veh->getVClass());
357  if (r != myRestrictions->end()) {
358  return MIN2(veh->getMaxSpeed(), r->second * veh->getChosenSpeedFactor());
359  }
360  }
361  return MIN2(veh->getMaxSpeed(), myMaxSpeed * veh->getChosenSpeedFactor());
362  }
363 
364 
368  inline SUMOReal getSpeedLimit() const {
369  return myMaxSpeed;
370  }
371 
372 
376  inline SUMOReal getLength() const {
377  return myLength;
378  }
379 
380 
385  return myPermissions;
386  }
387 
388 
392  SUMOReal getWidth() const {
393  return myWidth;
394  }
396 
398  int getCrossingIndex() const;
399 
400 
403 
411  virtual void planMovements(const SUMOTime t);
412 
421  virtual bool executeMovements(SUMOTime t, std::vector<MSLane*>& into);
422 
424  virtual bool integrateNewVehicle(SUMOTime t);
426 
427 
428 
430  virtual void detectCollisions(SUMOTime timestep, const std::string& stage);
431 
432 
435  virtual bool appropriate(const MSVehicle* veh);
436 
437 
439  const MSLinkCont& getLinkCont() const;
440 
441 
443  bool empty() const {
444  assert(myVehBuffer.size() == 0);
445  return myVehicles.empty();
446  }
447 
451  void setMaxSpeed(SUMOReal val);
452 
456  void setLength(SUMOReal val);
457 
461  MSEdge& getEdge() const {
462  return *myEdge;
463  }
464 
465 
469  const MSEdge* getInternalFollower() const;
470 
471 
474 
485  static bool dictionary(const std::string& id, MSLane* lane);
486 
487 
494  static MSLane* dictionary(const std::string& id);
495 
496 
498  static void clear();
499 
500 
504  static size_t dictSize() {
505  return myDict.size();
506  }
507 
508 
512  static void insertIDs(std::vector<std::string>& into);
513 
514 
519  template<class RTREE>
520  static void fill(RTREE& into);
522 
523 
524 
529  static MSLinkCont::const_iterator succLinkSec(const SUMOVehicle& veh,
530  unsigned int nRouteSuccs,
531  const MSLane& succLinkSource,
532  const std::vector<MSLane*>& conts);
533 
534 
537  bool isLinkEnd(MSLinkCont::const_iterator& i) const;
538 
541  bool isLinkEnd(MSLinkCont::iterator& i);
542 
545  bool isEmpty() const;
546 
548  MSVehicle* getLastVehicle() const;
549  MSVehicle* getFirstVehicle() const;
550 
551 
552  /* @brief remove the vehicle from this lane
553  * @param[notify] whether moveReminders of the vehicle shall be triggered
554  */
555  virtual MSVehicle* removeVehicle(MSVehicle* remVehicle, MSMoveReminder::Notification notification, bool notify = true);
556 
559 
560 
561 
562  void leftByLaneChange(MSVehicle* v);
564 
565 
569  MSLane* getParallelLane(int offset) const;
570 
571 
572  inline void setPermissions(SVCPermissions permissions) {
573  myPermissions = permissions;
574  }
575 
576 
577  inline bool allowsVehicleClass(SUMOVehicleClass vclass) const {
578  return (myPermissions & vclass) == vclass;
579  }
580 
581  void addIncomingLane(MSLane* lane, MSLink* viaLink);
582 
583 
588  };
589 
590  const std::vector<IncomingLaneInfo>& getIncomingLanes() const {
591  return myIncomingLanes;
592  }
593 
594 
595  void addApproachingLane(MSLane* lane, bool warnMultiCon);
596  bool isApproachedFrom(MSEdge* const edge);
597  bool isApproachedFrom(MSEdge* const edge, MSLane* const lane);
598 
599 
600 
602  std::pair<MSVehicle* const, SUMOReal> getFollowerOnConsecutive(
603  SUMOReal backOffset, SUMOReal leaderSpeed, SUMOReal leaderMaxDecel) const;
604 
605 
607  SUMOReal getMissingRearGap(SUMOReal backOffset, SUMOReal leaderSpeed, SUMOReal leaderMaxDecel) const;
608 
619  std::pair<MSVehicle* const, SUMOReal> getLeader(const MSVehicle* veh, const SUMOReal vehPos, bool checkNext) const;
620 
643  std::pair<MSVehicle* const, SUMOReal> getLeaderOnConsecutive(SUMOReal dist, SUMOReal seen,
644  SUMOReal speed, const MSVehicle& veh, const std::vector<MSLane*>& bestLaneConts) const;
645 
646 
664  std::pair<MSVehicle* const, SUMOReal> getCriticalLeader(SUMOReal dist, SUMOReal seen, SUMOReal speed, const MSVehicle& veh) const;
665 
666 
671 
674  MSLane* getLogicalPredecessorLane(const MSEdge& fromEdge) const;
675 
678 
680  std::vector<const MSLane*> getOutgoingLanes() const;
681 
683 
684 
688  SUMOReal getMeanSpeed() const;
689 
693  SUMOReal getWaitingSeconds() const;
694 
695 
700 
701 
705  SUMOReal getNettoOccupancy() const;
706 
707 
712 
713 
717  SUMOReal getCO2Emissions() const;
718 
719 
723  SUMOReal getCOEmissions() const;
724 
725 
729  SUMOReal getPMxEmissions() const;
730 
731 
735  SUMOReal getNOxEmissions() const;
736 
737 
741  SUMOReal getHCEmissions() const;
742 
743 
748 
749 
755 
756 
759 
767  void saveState(OutputDevice& out);
768 
780  void loadState(std::vector<std::string>& vehIDs, MSVehicleControl& vc);
782 
783 
784 #ifndef NO_TRACI
785 
792  void visit(const TraCIServerAPI_Lane::StoringVisitor& cont) const {
793  cont.add(this);
794  }
795 #endif
796 
797 protected:
799  virtual void swapAfterLaneChange(SUMOTime t);
800 
811  virtual void incorporateVehicle(MSVehicle* veh, SUMOReal pos, SUMOReal speed,
812  const MSLane::VehCont::iterator& at,
814 
815 
817  bool handleCollision(SUMOTime timestep, const std::string& stage, MSVehicle* collider, MSVehicle* victim, const SUMOReal victimRear);
818 
821 
822  /* @brief determine depart speed and whether it may be patched
823  * @param[in] veh The departing vehicle
824  * @param[out] whether the speed may be patched to account for safety
825  * @return the depart speed
826  */
827  SUMOReal getDepartSpeed(const MSVehicle& veh, bool& patchSpeed);
828 
829 protected:
832 
840  VehCont myVehicles;
841 
844 
847 
849  MSEdge* const myEdge;
850 
853 
856  VehCont myTmpVehicles;
857 
858 
860  std::vector<MSVehicle*> myVehBuffer;
861 
864 
866  const std::map<SUMOVehicleClass, SUMOReal>* myRestrictions;
867 
868  std::vector<IncomingLaneInfo> myIncomingLanes;
870 
871 
874 
877 
880 
883 
884 
888 
889  std::map<MSEdge*, std::vector<MSLane*> > myApproachingLanes;
890 
891  // precomputed myShape.length / myLength
893 
895  typedef std::map< std::string, MSLane* > DictType;
896 
898  static DictType myDict;
899 
900 private:
902  std::vector< MSMoveReminder* > myMoveReminders;
903 
904 
910  public:
912  explicit vehicle_position_sorter() { }
913 
914 
920  int operator()(MSVehicle* v1, MSVehicle* v2) const;
921 
922  };
923 
929  public:
931  explicit by_connections_to_sorter(const MSEdge* const e);
932 
934  int operator()(const MSEdge* const e1, const MSEdge* const e2) const;
935 
936  private:
937  by_connections_to_sorter& operator=(const by_connections_to_sorter&); // just to avoid a compiler warning
938  private:
939  const MSEdge* const myEdge;
941  };
942 
946  class edge_finder {
947  public:
948  edge_finder(MSEdge* e) : myEdge(e) {}
949  bool operator()(const IncomingLaneInfo& ili) const {
950  return &(ili.lane->getEdge()) == myEdge;
951  }
952  private:
953  edge_finder& operator=(const edge_finder&); // just to avoid a compiler warning
954  private:
955  const MSEdge* const myEdge;
956  };
957 
958 private:
960  MSLane(const MSLane&);
961 
963  MSLane& operator=(const MSLane&);
964 
965 
966 };
967 
968 
969 #endif
970 
971 /****************************************************************************/
972 
void forceVehicleInsertion(MSVehicle *veh, SUMOReal pos)
Inserts the given vehicle at the given position.
Definition: MSLane.cpp:633
const std::map< SUMOVehicleClass, SUMOReal > * myRestrictions
The vClass speed restrictions for this lane.
Definition: MSLane.h:866
void loadState(std::vector< std::string > &vehIDs, MSVehicleControl &vc)
Loads the state of this segment with the given parameters.
Definition: MSLane.cpp:1704
SVCPermissions myPermissions
The vClass permissions for this lane.
Definition: MSLane.h:863
VehCont myVehicles
The lane&#39;s vehicles. The entering vehicles are inserted at the front of this container and the leavin...
Definition: MSLane.h:840
MSEdge & getEdge() const
Returns the lane&#39;s edge.
Definition: MSLane.h:461
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:80
bool isLinkEnd(MSLinkCont::const_iterator &i) const
Definition: MSLane.cpp:976
long long int SUMOTime
Definition: SUMOTime.h:43
SUMOReal getWaitingSeconds() const
Returns the overall waiting time on this lane.
Definition: MSLane.cpp:1543
static void insertIDs(std::vector< std::string > &into)
Adds the ids of all stored lanes into the given vector.
Definition: MSLane.cpp:916
const MSEdge * getInternalFollower() const
Returns the lane&#39;s follower if it is an internal lane, the edge of the lane otherwise.
Definition: MSLane.cpp:873
virtual void releaseVehicles() const
Allows to use the container for microsimulation again.
Definition: MSLane.h:303
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
const Position geometryPositionAtOffset(SUMOReal offset) const
Definition: MSLane.h:340
static void fill(RTREE &into)
Fills the given RTree with lane instances.
Definition: MSLane.cpp:924
SUMOReal getLength() const
Returns the lane&#39;s length.
Definition: MSLane.h:376
std::vector< IncomingLaneInfo > myIncomingLanes
Definition: MSLane.h:868
int SVCPermissions
MSVehicle * getFirstVehicle() const
Definition: MSLane.cpp:1001
size_t getNumericalID() const
Returns this lane&#39;s numerical id.
Definition: MSLane.h:315
void setLength(SUMOReal val)
Sets a new length for the lane (used by TraCI only)
Definition: MSLane.cpp:1072
void addLink(MSLink *link)
Delayed initialization.
Definition: MSLane.cpp:108
virtual bool integrateNewVehicle(SUMOTime t)
Insert buffered vehicle into the real lane.
Definition: MSLane.cpp:960
std::vector< MSVehicle * > VehCont
Container for vehicles.
Definition: MSLane.h:88
Notification
Definition of a vehicle state.
SUMOReal getFuelConsumption() const
Returns the sum of last step fuel consumption.
Definition: MSLane.cpp:1632
virtual MSVehicle * removeVehicle(MSVehicle *remVehicle, MSMoveReminder::Notification notification, bool notify=true)
Definition: MSLane.cpp:1086
size_t myNumericalID
Unique numerical ID (set on reading by netload)
Definition: MSLane.h:831
virtual void incorporateVehicle(MSVehicle *veh, SUMOReal pos, SUMOReal speed, 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:126
const MSEdge *const myEdge
Definition: MSLane.h:939
SUMOReal getWidth() const
Returns the lane&#39;s width.
Definition: MSLane.h:392
SUMOReal getMaximumBrakeDist() const
compute maximum braking distance on this lane
Definition: MSLane.cpp:1173
MSLane(const std::string &id, SUMOReal maxSpeed, SUMOReal length, MSEdge *const edge, unsigned int numericalID, const PositionVector &shape, SUMOReal width, SVCPermissions permissions)
Constructor.
Definition: MSLane.cpp:86
void addIncomingLane(MSLane *lane, MSLink *viaLink)
Definition: MSLane.cpp:1109
SUMOReal getNettoOccupancy() const
Returns the netto (excluding minGaps) occupancy of this lane during the last step (including minGaps)...
Definition: MSLane.cpp:1522
Realises dumping the complete network state.
Definition: MSXMLRawOut.h:62
virtual void addMoveReminder(MSMoveReminder *rem)
Add a move-reminder to move-reminder container.
Definition: MSLane.cpp:115
void leftByLaneChange(MSVehicle *v)
Definition: MSLane.cpp:1482
void setPermissions(SVCPermissions permissions)
Definition: MSLane.h:572
virtual SUMOReal getMaxSpeed() const =0
Returns the vehicle&#39;s maximum speed.
bool operator()(const IncomingLaneInfo &ili) const
Definition: MSLane.h:949
std::pair< MSVehicle *const, SUMOReal > getCriticalLeader(SUMOReal dist, SUMOReal seen, SUMOReal speed, const MSVehicle &veh) const
Returns the most dangerous leader and the distance to him.
Definition: MSLane.cpp:1341
const SUMOReal myWidth
Lane width [m].
Definition: MSLane.h:846
bool pWagGenericInsertion(MSVehicle &veh, SUMOReal speed, SUMOReal maxPos, SUMOReal minPos)
Definition: MSLane.cpp:146
bool freeInsertion(MSVehicle &veh, SUMOReal speed, MSMoveReminder::Notification notification=MSMoveReminder::NOTIFICATION_DEPARTED)
Tries to insert the given vehicle on any place.
Definition: MSLane.cpp:276
SUMOReal myMaxSpeed
Lane-wide speedlimit [m/s].
Definition: MSLane.h:852
SUMOReal getBruttoVehLenSum() const
Returns the sum of lengths of vehicles, including their minGaps, which were on the lane during the la...
Definition: MSLane.cpp:1537
SUMOReal setPartialOccupation(MSVehicle *v, SUMOReal leftVehicleLength)
Sets the information about a vehicle lapping into this lane.
Definition: MSLane.cpp:643
static MSLinkCont::const_iterator succLinkSec(const SUMOVehicle &veh, unsigned int nRouteSuccs, const MSLane &succLinkSource, const std::vector< MSLane * > &conts)
Definition: MSLane.cpp:1010
PositionVector myShape
The shape of the lane.
Definition: MSLane.h:558
SUMOReal getHCEmissions() const
Returns the sum of last step HC emissions.
Definition: MSLane.cpp:1620
bool isInsertionSuccess(MSVehicle *vehicle, SUMOReal speed, SUMOReal pos, bool recheckNextLanes, MSMoveReminder::Notification notification)
Tries to insert the given vehicle with the given state (speed and pos)
Definition: MSLane.cpp:453
virtual const VehCont & getVehiclesSecure() const
Returns the vehicles container; locks it for microsimulation.
Definition: MSLane.h:296
void setMaxSpeed(SUMOReal val)
Sets a new maximum speed for the lane (used by TraCI and MSCalibrator)
Definition: MSLane.cpp:1065
SUMOReal getPartialOccupatorEnd() const
Returns the position of the in-lapping vehicle&#39;s end.
Definition: MSLane.h:261
std::map< std::string, MSLane * > DictType
definition of the static dictionary type
Definition: MSLane.h:895
virtual bool executeMovements(SUMOTime t, std::vector< MSLane * > &into)
Executes planned vehicle movements with regards to right-of-way.
Definition: MSLane.cpp:774
MSLinkCont myLinks
Definition: MSLane.h:887
virtual void detectCollisions(SUMOTime timestep, const std::string &stage)
Check if vehicles are too close.
Definition: MSLane.cpp:707
static DictType myDict
Static dictionary to associate string-ids with objects.
Definition: MSLane.h:898
virtual SUMOReal getChosenSpeedFactor() const =0
void addApproachingLane(MSLane *lane, bool warnMultiCon)
Definition: MSLane.cpp:1119
Performs lane changing of vehicles.
Definition: MSLaneChanger.h:55
A road/street connecting two junctions.
Definition: MSEdge.h:81
bool insertVehicle(MSVehicle &v)
Tries to insert the given vehicle.
Definition: MSLane.cpp:386
virtual SUMOVehicleClass getVClass() const =0
Returns the vehicle&#39;s access class.
MSLane * getLogicalPredecessorLane() const
get the most likely precedecessor lane (sorted using by_connections_to_sorter). The result is cached ...
Definition: MSLane.cpp:1420
VehCont myTmpVehicles
Definition: MSLane.h:856
Allows to store the object; used as context while traveling the rtree in TraCI.
bool allowsVehicleClass(SUMOVehicleClass vclass) const
Definition: MSLane.h:577
std::pair< MSVehicle *const, SUMOReal > getLeaderOnConsecutive(SUMOReal dist, SUMOReal seen, SUMOReal speed, const MSVehicle &veh, const std::vector< MSLane * > &bestLaneConts) const
Returns the immediate leader and the distance to him.
Definition: MSLane.cpp:1278
Export the queueing length in front of a junction (very experimental!)
Definition: MSQueueExport.h:57
void resetPartialOccupation(MSVehicle *v)
Removes the information about a vehicle lapping into this lane.
Definition: MSLane.cpp:659
LinkState getIncomingLinkState() const
get the state of the link from the logical predecessor to this lane
Definition: MSLane.cpp:1460
SUMOReal getMissingRearGap(SUMOReal backOffset, SUMOReal leaderSpeed, SUMOReal leaderMaxDecel) const
return by how much further the leader must be inserted to avoid rear end collisions ...
Definition: MSLane.cpp:1157
const MSEdge *const myEdge
Definition: MSLane.h:955
Representation of a vehicle.
Definition: SUMOVehicle.h:65
std::vector< MSVehicle * > myVehBuffer
Definition: MSLane.h:860
void add(const MSLane *const l) const
Adds the given object to the container.
SUMOReal getDepartSpeed(const MSVehicle &veh, bool &patchSpeed)
Definition: MSLane.cpp:359
Sorts vehicles by their position (descending)
Definition: MSLane.h:909
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:46
A list of positions.
void enteredByLaneChange(MSVehicle *v)
Definition: MSLane.cpp:1489
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:1103
SUMOReal getMeanSpeed() const
Returns the mean speed on this lane.
Definition: MSLane.cpp:1556
std::pair< MSVehicle *, SUMOReal > getLastVehicleInformation() const
Returns the last vehicle which is still on the lane.
Definition: MSLane.cpp:675
LinkState
The right-of-way state of a link between two lanes used when constructing a NBTrafficLightLogic, in MSLink and GNEInternalLane.
Position positionAtOffset(SUMOReal pos, SUMOReal lateralOffset=0) const
Returns the position at the given length.
bool handleCollision(SUMOTime timestep, const std::string &stage, MSVehicle *collider, MSVehicle *victim, const SUMOReal victimRear)
detect whether there is a collision. then issue warning and add the vehicle to MSVehicleTransfer ...
Definition: MSLane.cpp:743
T MIN2(T a, T b)
Definition: StdDefs.h:73
SUMOReal getSpeedLimit() const
Returns the lane&#39;s maximum allowed speed.
Definition: MSLane.h:368
MSLane * myLogicalPredecessorLane
Definition: MSLane.h:869
Something on a lane to be noticed about vehicle movement.
std::pair< MSVehicle *const, SUMOReal > getLeader(const MSVehicle *veh, const SUMOReal vehPos, bool checkNext) const
Returns the immediate leader of veh and the distance to veh starting on this lane.
Definition: MSLane.cpp:1247
SUMOReal myLength
Lane length [m].
Definition: MSLane.h:843
bool empty() const
Returns true if there is not a single vehicle on the lane.
Definition: MSLane.h:443
MSVehicle * getLastVehicle() const
returns the last vehicle
Definition: MSLane.cpp:992
SVCPermissions getPermissions() const
Returns the vehicle class permissions for this lane.
Definition: MSLane.h:384
virtual void swapAfterLaneChange(SUMOTime t)
moves myTmpVehicles int myVehicles after a lane change procedure
Definition: MSLane.cpp:1079
SUMOReal getLengthGeometryFactor() const
return shape.length() / myLength
Definition: MSLane.h:328
An upper class for objects with additional parameters.
Definition: Parameterised.h:47
std::map< MSEdge *, std::vector< MSLane * > > myApproachingLanes
Definition: MSLane.h:889
Base class for objects which have an id.
Definition: Named.h:45
std::vector< MSMoveReminder * > myMoveReminders
This lane&#39;s move reminder.
Definition: MSLane.h:902
bool pWagSimpleInsertion(MSVehicle &veh, SUMOReal speed, SUMOReal maxPos, SUMOReal minPos)
Definition: MSLane.cpp:194
const SUMOReal myLengthGeometryFactor
Definition: MSLane.h:892
unsigned int getVehicleNumber() const
Returns the number of vehicles on this lane.
Definition: MSLane.h:285
std::vector< const MSLane * > getOutgoingLanes() const
get the list of outgoing lanes
Definition: MSLane.cpp:1471
static bool dictionary(const std::string &id, MSLane *lane)
Static (sic!) container methods {.
Definition: MSLane.cpp:884
SUMOReal getNOxEmissions() const
Returns the sum of last step NOx emissions.
Definition: MSLane.cpp:1608
SUMOReal getPMxEmissions() const
Returns the sum of last step PMx emissions.
Definition: MSLane.cpp:1596
The vehicle has departed (was inserted into the network)
bool operator()(const MSVehicle *cmp, SUMOReal pos) const
compares vehicle position to the detector position
Definition: MSLane.cpp:1661
MSVehicle * myInlappingVehicle
The vehicle which laps into this lane.
Definition: MSLane.h:882
SUMOReal myBruttoVehicleLengthSum
The current length of all vehicles on this lane, including their minGaps.
Definition: MSLane.h:873
vehicle_position_sorter()
Constructor.
Definition: MSLane.h:912
static void clear()
Clears the dictionary.
Definition: MSLane.cpp:907
bool isEmpty() const
Definition: MSLane.cpp:987
SUMOReal interpolateLanePosToGeometryPos(SUMOReal lanePos) const
Definition: MSLane.h:334
SUMOReal getCO2Emissions() const
Returns the sum of last step CO2 emissions.
Definition: MSLane.cpp:1572
MSEdge *const myEdge
The lane&#39;s edge, for routing only.
Definition: MSLane.h:849
SUMOReal getCOEmissions() const
Returns the sum of last step CO emissions.
Definition: MSLane.cpp:1584
std::pair< MSVehicle *const, SUMOReal > getFollowerOnConsecutive(SUMOReal backOffset, SUMOReal leaderSpeed, SUMOReal leaderMaxDecel) const
return the follower with the largest missing rear gap among all predecessor lanes (within dist) ...
Definition: MSLane.cpp:1182
bool checkFailure(MSVehicle *aVehicle, SUMOReal &speed, SUMOReal &dist, const SUMOReal nspeed, const bool patchSpeed, const std::string errorMsg) const
Definition: MSLane.cpp:435
SUMOReal myInlappingVehicleEnd
End position of a vehicle which laps into this lane.
Definition: MSLane.h:879
bool maxSpeedGapInsertion(MSVehicle &veh, SUMOReal mspeed)
Definition: MSLane.cpp:227
static size_t dictSize()
Returns the number of stored lanes.
Definition: MSLane.h:504
bool isApproachedFrom(MSEdge *const edge)
Definition: MSLane.cpp:1133
MSLane & operator=(const MSLane &)
invalidated assignment operator
void saveState(OutputDevice &out)
Saves the state of this lane into the given stream.
Definition: MSLane.cpp:1694
const PositionVector & getShape() const
Returns this lane&#39;s shape.
Definition: MSLane.h:323
void visit(const TraCIServerAPI_Lane::StoringVisitor &cont) const
Callback for visiting the lane when traversing an RTree.
Definition: MSLane.h:792
MSVehicle * getPartialOccupator() const
Returns the vehicle which laps into this lane.
Definition: MSLane.h:253
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:71
#define SUMOReal
Definition: config.h:214
virtual ~MSLane()
Destructor.
Definition: MSLane.cpp:100
SUMOReal myNettoVehicleLengthSum
The current length of all vehicles on this lane, excluding their minGaps.
Definition: MSLane.h:876
const MSLinkCont & getLinkCont() const
returns the container with all links !!!
Definition: MSLane.cpp:1059
The class responsible for building and deletion of vehicles.
SUMOReal getVehicleMaxSpeed(const SUMOVehicle *const veh) const
Returns the lane&#39;s maximum speed, given a vehicle&#39;s speed limit adaptation.
Definition: MSLane.h:354
SUMOReal getHarmonoise_NoiseEmissions() const
Returns the sum of last step noise emissions.
Definition: MSLane.cpp:1644
const std::vector< IncomingLaneInfo > & getIncomingLanes() const
Definition: MSLane.h:590
SUMOReal interpolateGeometryPosToLanePos(SUMOReal geometryPos) const
Definition: MSLane.h:346
SUMOReal getBruttoOccupancy() const
Returns the brutto (including minGaps) occupancy of this lane during the last step.
Definition: MSLane.cpp:1507
const std::vector< MSMoveReminder * > & getMoveReminders() const
Return the list of this lane&#39;s move reminders.
Definition: MSLane.h:150
Representation of a lane in the micro simulation.
Definition: MSLane.h:77
int getCrossingIndex() const
return the index of the link to the next crossing if this is walkingArea, else -1 ...
Definition: MSLane.cpp:1496
edge_finder(MSEdge *e)
Definition: MSLane.h:948
virtual bool appropriate(const MSVehicle *veh)
Definition: MSLane.cpp:942
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:692