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-2016 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:
111  MSLane(const std::string& id, SUMOReal maxSpeed, SUMOReal length, MSEdge* const edge,
112  unsigned int numericalID, const PositionVector& shape, SUMOReal width,
113  SVCPermissions permissions, int index);
114 
115 
117  virtual ~MSLane();
118 
119 
120 
123 
131  void addLink(MSLink* link);
133 
134 
135 
138 
145  virtual void addMoveReminder(MSMoveReminder* rem);
146 
147 
151  inline const std::vector< MSMoveReminder* >& getMoveReminders() const {
152  return myMoveReminders;
153  }
155 
156 
157 
160 
176  bool insertVehicle(MSVehicle& v);
177 
178 
196  bool isInsertionSuccess(MSVehicle* vehicle, SUMOReal speed, SUMOReal pos,
197  bool recheckNextLanes,
198  MSMoveReminder::Notification notification);
199 
200  bool checkFailure(MSVehicle* aVehicle, SUMOReal& speed, SUMOReal& dist, const SUMOReal nspeed, const bool patchSpeed, const std::string errorMsg) const;
201  bool lastInsertion(MSVehicle& veh, SUMOReal mspeed);
202 
210  bool freeInsertion(MSVehicle& veh, SUMOReal speed,
212 
213 
221  void forceVehicleInsertion(MSVehicle* veh, SUMOReal pos);
223 
224 
225 
228 
240  SUMOReal setPartialOccupation(MSVehicle* v, SUMOReal leftVehicleLength);
241 
242 
247 
248 
253  return myInlappingVehicle;
254  }
255 
256 
261  return myInlappingVehicleEnd;
262  }
263 
264 
273  std::pair<MSVehicle*, SUMOReal> getLastVehicleInformation() const;
275 
276 
277 
280 
284  unsigned int getVehicleNumber() const {
285  return (unsigned int) myVehicles.size();
286  }
287 
288 
295  virtual const VehCont& getVehiclesSecure() const {
296  return myVehicles;
297  }
298 
299 
302  virtual void releaseVehicles() const { }
304 
305 
306 
309 
310 
314  inline size_t getNumericalID() const {
315  return myNumericalID;
316  }
317 
318 
322  inline const PositionVector& getShape() const {
323  return myShape;
324  }
325 
328  return myLengthGeometryFactor;
329  }
330 
331  /* @brief fit the given lane position to a visibly suitable geometry position
332  * (lane length might differ from geometry length) */
334  return lanePos * myLengthGeometryFactor;
335  }
336 
337  /* @brief fit the given lane position to a visibly suitable geometry position
338  * and return the coordinates */
339  inline const Position geometryPositionAtOffset(SUMOReal offset) const {
341  }
342 
343  /* @brief fit the given geomtry position to a valid lane position
344  * (lane length might differ from geometry length) */
346  return geometryPos / myLengthGeometryFactor;
347  }
348 
353  inline SUMOReal getVehicleMaxSpeed(const SUMOVehicle* const veh) const {
354  if (myRestrictions != 0) {
355  std::map<SUMOVehicleClass, SUMOReal>::const_iterator r = myRestrictions->find(veh->getVClass());
356  if (r != myRestrictions->end()) {
357  return MIN2(veh->getMaxSpeed(), r->second * veh->getChosenSpeedFactor());
358  }
359  }
360  return MIN2(veh->getMaxSpeed(), myMaxSpeed * veh->getChosenSpeedFactor());
361  }
362 
363 
367  inline SUMOReal getSpeedLimit() const {
368  return myMaxSpeed;
369  }
370 
371 
375  inline SUMOReal getLength() const {
376  return myLength;
377  }
378 
379 
384  return myPermissions;
385  }
386 
387 
391  SUMOReal getWidth() const {
392  return myWidth;
393  }
394 
398  int getIndex() const {
399  return myIndex;
400  }
402 
404  int getCrossingIndex() const;
405 
406 
409 
417  virtual void planMovements(const SUMOTime t);
418 
427  virtual bool executeMovements(SUMOTime t, std::vector<MSLane*>& into);
428 
430  virtual bool integrateNewVehicle(SUMOTime t);
432 
433 
434 
436  virtual void detectCollisions(SUMOTime timestep, const std::string& stage);
437 
438 
441  virtual bool appropriate(const MSVehicle* veh);
442 
443 
445  const MSLinkCont& getLinkCont() const;
446 
447 
449  bool empty() const {
450  assert(myVehBuffer.size() == 0);
451  return myVehicles.empty();
452  }
453 
457  void setMaxSpeed(SUMOReal val);
458 
462  void setLength(SUMOReal val);
463 
467  MSEdge& getEdge() const {
468  return *myEdge;
469  }
470 
471 
475  const MSEdge* getInternalFollower() const;
476 
477 
480 
491  static bool dictionary(const std::string& id, MSLane* lane);
492 
493 
500  static MSLane* dictionary(const std::string& id);
501 
502 
504  static void clear();
505 
506 
510  static size_t dictSize() {
511  return myDict.size();
512  }
513 
514 
518  static void insertIDs(std::vector<std::string>& into);
519 
520 
525  template<class RTREE>
526  static void fill(RTREE& into);
528 
529 
530 
535  static MSLinkCont::const_iterator succLinkSec(const SUMOVehicle& veh,
536  unsigned int nRouteSuccs,
537  const MSLane& succLinkSource,
538  const std::vector<MSLane*>& conts);
539 
540 
543  bool isLinkEnd(MSLinkCont::const_iterator& i) const;
544 
547  bool isLinkEnd(MSLinkCont::iterator& i);
548 
551  bool isEmpty() const;
552 
554  MSVehicle* getLastVehicle() const;
555  MSVehicle* getFirstVehicle() const;
556 
557  /* @brief remove the vehicle from this lane
558  * @param[notify] whether moveReminders of the vehicle shall be triggered
559  */
560  virtual MSVehicle* removeVehicle(MSVehicle* remVehicle, MSMoveReminder::Notification notification, bool notify = true);
561 
562  void leftByLaneChange(MSVehicle* v);
564 
568  MSLane* getParallelLane(int offset) const;
569 
570 
571  inline void setPermissions(SVCPermissions permissions) {
572  myPermissions = permissions;
573  }
574 
575 
576  inline bool allowsVehicleClass(SUMOVehicleClass vclass) const {
577  return (myPermissions & vclass) == vclass;
578  }
579 
580  void addIncomingLane(MSLane* lane, MSLink* viaLink);
581 
582 
587  };
588 
589  const std::vector<IncomingLaneInfo>& getIncomingLanes() const {
590  return myIncomingLanes;
591  }
592 
593 
594  void addApproachingLane(MSLane* lane, bool warnMultiCon);
595  bool isApproachedFrom(MSEdge* const edge);
596  bool isApproachedFrom(MSEdge* const edge, MSLane* const lane);
597 
598 
599 
601  std::pair<MSVehicle* const, SUMOReal> getFollowerOnConsecutive(
602  SUMOReal backOffset, SUMOReal leaderSpeed, SUMOReal leaderMaxDecel) const;
603 
604 
606  SUMOReal getMissingRearGap(SUMOReal backOffset, SUMOReal leaderSpeed, SUMOReal leaderMaxDecel) const;
607 
618  std::pair<MSVehicle* const, SUMOReal> getLeader(const MSVehicle* veh, const SUMOReal vehPos, bool checkNext) const;
619 
642  std::pair<MSVehicle* const, SUMOReal> getLeaderOnConsecutive(SUMOReal dist, SUMOReal seen,
643  SUMOReal speed, const MSVehicle& veh, const std::vector<MSLane*>& bestLaneConts) const;
644 
645 
663  std::pair<MSVehicle* const, SUMOReal> getCriticalLeader(SUMOReal dist, SUMOReal seen, SUMOReal speed, const MSVehicle& veh) const;
664 
665 
670 
673  MSLane* getLogicalPredecessorLane(const MSEdge& fromEdge) const;
674 
677 
679  std::vector<const MSLane*> getOutgoingLanes() const;
680 
682 
683 
687  SUMOReal getMeanSpeed() const;
688 
692  SUMOReal getWaitingSeconds() const;
693 
694 
699 
700 
704  SUMOReal getNettoOccupancy() const;
705 
706 
711 
712 
716  SUMOReal getCO2Emissions() const;
717 
718 
722  SUMOReal getCOEmissions() const;
723 
724 
728  SUMOReal getPMxEmissions() const;
729 
730 
734  SUMOReal getNOxEmissions() const;
735 
736 
740  SUMOReal getHCEmissions() const;
741 
742 
747 
748 
753 
754 
760 
761 
764 
772  void saveState(OutputDevice& out);
773 
785  void loadState(std::vector<std::string>& vehIDs, MSVehicleControl& vc);
787 
788 
789 #ifndef NO_TRACI
790 
797  void visit(const TraCIServerAPI_Lane::StoringVisitor& cont) const {
798  cont.add(this);
799  }
800 #endif
801 
802 protected:
804  virtual void swapAfterLaneChange(SUMOTime t);
805 
816  virtual void incorporateVehicle(MSVehicle* veh, SUMOReal pos, SUMOReal speed,
817  const MSLane::VehCont::iterator& at,
819 
820 
822  bool handleCollision(SUMOTime timestep, const std::string& stage, MSVehicle* collider, MSVehicle* victim, const SUMOReal victimRear);
823 
826 
827  /* @brief determine depart speed and whether it may be patched
828  * @param[in] veh The departing vehicle
829  * @param[out] whether the speed may be patched to account for safety
830  * @return the depart speed
831  */
832  SUMOReal getDepartSpeed(const MSVehicle& veh, bool& patchSpeed);
833 
835  SUMOReal basePos(const MSVehicle& veh) const;
836 
837 protected:
840 
843 
845  int myIndex;
846 
854  VehCont myVehicles;
855 
858 
861 
863  MSEdge* const myEdge;
864 
867 
870  VehCont myTmpVehicles;
871 
872 
874  std::vector<MSVehicle*> myVehBuffer;
875 
878 
880  const std::map<SUMOVehicleClass, SUMOReal>* myRestrictions;
881 
882  std::vector<IncomingLaneInfo> myIncomingLanes;
884 
885 
888 
891 
894 
897 
898 
902 
903  std::map<MSEdge*, std::vector<MSLane*> > myApproachingLanes;
904 
905  // precomputed myShape.length / myLength
907 
909  typedef std::map< std::string, MSLane* > DictType;
910 
912  static DictType myDict;
913 
914 private:
916  std::vector< MSMoveReminder* > myMoveReminders;
917 
918 
924  public:
926  explicit vehicle_position_sorter() { }
927 
928 
934  int operator()(MSVehicle* v1, MSVehicle* v2) const;
935 
936  };
937 
943  public:
945  explicit by_connections_to_sorter(const MSEdge* const e);
946 
948  int operator()(const MSEdge* const e1, const MSEdge* const e2) const;
949 
950  private:
951  by_connections_to_sorter& operator=(const by_connections_to_sorter&); // just to avoid a compiler warning
952  private:
953  const MSEdge* const myEdge;
955  };
956 
960  class edge_finder {
961  public:
962  edge_finder(MSEdge* e) : myEdge(e) {}
963  bool operator()(const IncomingLaneInfo& ili) const {
964  return &(ili.lane->getEdge()) == myEdge;
965  }
966  private:
967  edge_finder& operator=(const edge_finder&); // just to avoid a compiler warning
968  private:
969  const MSEdge* const myEdge;
970  };
971 
972 private:
974  MSLane(const MSLane&);
975 
977  MSLane& operator=(const MSLane&);
978 
979 
980 };
981 
982 
983 #endif
984 
985 /****************************************************************************/
986 
void forceVehicleInsertion(MSVehicle *veh, SUMOReal pos)
Inserts the given vehicle at the given position.
Definition: MSLane.cpp:521
const std::map< SUMOVehicleClass, SUMOReal > * myRestrictions
The vClass speed restrictions for this lane.
Definition: MSLane.h:880
void loadState(std::vector< std::string > &vehIDs, MSVehicleControl &vc)
Loads the state of this segment with the given parameters.
Definition: MSLane.cpp:1605
SVCPermissions myPermissions
The vClass permissions for this lane.
Definition: MSLane.h:877
VehCont myVehicles
The lane&#39;s vehicles. The entering vehicles are inserted at the front of this container and the leavin...
Definition: MSLane.h:854
MSEdge & getEdge() const
Returns the lane&#39;s edge.
Definition: MSLane.h:467
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:80
bool isLinkEnd(MSLinkCont::const_iterator &i) const
Definition: MSLane.cpp:864
long long int SUMOTime
Definition: SUMOTime.h:43
SUMOReal getWaitingSeconds() const
Returns the overall waiting time on this lane.
Definition: MSLane.cpp:1431
static void insertIDs(std::vector< std::string > &into)
Adds the ids of all stored lanes into the given vector.
Definition: MSLane.cpp:804
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:761
virtual void releaseVehicles() const
Allows to use the container for microsimulation again.
Definition: MSLane.h:302
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
MSLane(const std::string &id, SUMOReal maxSpeed, SUMOReal length, MSEdge *const edge, unsigned int numericalID, const PositionVector &shape, SUMOReal width, SVCPermissions permissions, int index)
Constructor.
Definition: MSLane.cpp:86
const Position geometryPositionAtOffset(SUMOReal offset) const
Definition: MSLane.h:339
static void fill(RTREE &into)
Fills the given RTree with lane instances.
Definition: MSLane.cpp:812
SUMOReal getLength() const
Returns the lane&#39;s length.
Definition: MSLane.h:375
std::vector< IncomingLaneInfo > myIncomingLanes
Definition: MSLane.h:882
int SVCPermissions
MSVehicle * getFirstVehicle() const
Definition: MSLane.cpp:889
size_t getNumericalID() const
Returns this lane&#39;s numerical id.
Definition: MSLane.h:314
void setLength(SUMOReal val)
Sets a new length for the lane (used by TraCI only)
Definition: MSLane.cpp:960
void addLink(MSLink *link)
Delayed initialization.
Definition: MSLane.cpp:108
int myIndex
The lane index.
Definition: MSLane.h:845
virtual bool integrateNewVehicle(SUMOTime t)
Insert buffered vehicle into the real lane.
Definition: MSLane.cpp:848
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:1520
virtual MSVehicle * removeVehicle(MSVehicle *remVehicle, MSMoveReminder::Notification notification, bool notify=true)
Definition: MSLane.cpp:974
size_t myNumericalID
Unique numerical ID (set on reading by netload)
Definition: MSLane.h:839
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:953
SUMOReal getWidth() const
Returns the lane&#39;s width.
Definition: MSLane.h:391
SUMOReal getMaximumBrakeDist() const
compute maximum braking distance on this lane
Definition: MSLane.cpp:1061
void addIncomingLane(MSLane *lane, MSLink *viaLink)
Definition: MSLane.cpp:997
SUMOReal getNettoOccupancy() const
Returns the netto (excluding minGaps) occupancy of this lane during the last step (including minGaps)...
Definition: MSLane.cpp:1410
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:1370
void setPermissions(SVCPermissions permissions)
Definition: MSLane.h:571
SUMOReal getElectricityConsumption() const
Returns the sum of last step electricity consumption.
Definition: MSLane.cpp:1532
virtual SUMOReal getMaxSpeed() const =0
Returns the vehicle&#39;s maximum speed.
bool operator()(const IncomingLaneInfo &ili) const
Definition: MSLane.h:963
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:1229
const SUMOReal myWidth
Lane width [m].
Definition: MSLane.h:860
bool freeInsertion(MSVehicle &veh, SUMOReal speed, MSMoveReminder::Notification notification=MSMoveReminder::NOTIFICATION_DEPARTED)
Tries to insert the given vehicle on any place.
Definition: MSLane.cpp:163
SUMOReal myMaxSpeed
Lane-wide speedlimit [m/s].
Definition: MSLane.h:866
SUMOReal getBruttoVehLenSum() const
Returns the sum of lengths of vehicles, including their minGaps, which were on the lane during the la...
Definition: MSLane.cpp:1425
SUMOReal setPartialOccupation(MSVehicle *v, SUMOReal leftVehicleLength)
Sets the information about a vehicle lapping into this lane.
Definition: MSLane.cpp:531
static MSLinkCont::const_iterator succLinkSec(const SUMOVehicle &veh, unsigned int nRouteSuccs, const MSLane &succLinkSource, const std::vector< MSLane * > &conts)
Definition: MSLane.cpp:898
PositionVector myShape
The shape of the lane.
Definition: MSLane.h:842
SUMOReal getHCEmissions() const
Returns the sum of last step HC emissions.
Definition: MSLane.cpp:1508
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:341
virtual const VehCont & getVehiclesSecure() const
Returns the vehicles container; locks it for microsimulation.
Definition: MSLane.h:295
void setMaxSpeed(SUMOReal val)
Sets a new maximum speed for the lane (used by TraCI and MSCalibrator)
Definition: MSLane.cpp:953
SUMOReal getPartialOccupatorEnd() const
Returns the position of the in-lapping vehicle&#39;s end.
Definition: MSLane.h:260
std::map< std::string, MSLane * > DictType
definition of the static dictionary type
Definition: MSLane.h:909
virtual bool executeMovements(SUMOTime t, std::vector< MSLane * > &into)
Executes planned vehicle movements with regards to right-of-way.
Definition: MSLane.cpp:662
bool lastInsertion(MSVehicle &veh, SUMOReal mspeed)
Definition: MSLane.cpp:146
MSLinkCont myLinks
Definition: MSLane.h:901
virtual void detectCollisions(SUMOTime timestep, const std::string &stage)
Check if vehicles are too close.
Definition: MSLane.cpp:595
static DictType myDict
Static dictionary to associate string-ids with objects.
Definition: MSLane.h:912
virtual SUMOReal getChosenSpeedFactor() const =0
void addApproachingLane(MSLane *lane, bool warnMultiCon)
Definition: MSLane.cpp:1007
Performs lane changing of vehicles.
Definition: MSLaneChanger.h:55
A road/street connecting two junctions.
Definition: MSEdge.h:80
bool insertVehicle(MSVehicle &v)
Tries to insert the given vehicle.
Definition: MSLane.cpp:273
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:1308
VehCont myTmpVehicles
Definition: MSLane.h:870
Allows to store the object; used as context while traveling the rtree in TraCI.
bool allowsVehicleClass(SUMOVehicleClass vclass) const
Definition: MSLane.h:576
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:1166
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:547
LinkState getIncomingLinkState() const
get the state of the link from the logical predecessor to this lane
Definition: MSLane.cpp:1348
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:1045
SUMOReal basePos(const MSVehicle &veh) const
departure position where the vehicle fits fully onto the lane (if possible)
Definition: MSLane.cpp:318
const MSEdge *const myEdge
Definition: MSLane.h:969
Representation of a vehicle.
Definition: SUMOVehicle.h:65
std::vector< MSVehicle * > myVehBuffer
Definition: MSLane.h:874
void add(const MSLane *const l) const
Adds the given object to the container.
SUMOReal getDepartSpeed(const MSVehicle &veh, bool &patchSpeed)
Definition: MSLane.cpp:246
Sorts vehicles by their position (descending)
Definition: MSLane.h:923
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:1377
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:991
SUMOReal getMeanSpeed() const
Returns the mean speed on this lane.
Definition: MSLane.cpp:1444
std::pair< MSVehicle *, SUMOReal > getLastVehicleInformation() const
Returns the last vehicle which is still on the lane.
Definition: MSLane.cpp:563
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:631
T MIN2(T a, T b)
Definition: StdDefs.h:69
SUMOReal getSpeedLimit() const
Returns the lane&#39;s maximum allowed speed.
Definition: MSLane.h:367
MSLane * myLogicalPredecessorLane
Definition: MSLane.h:883
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:1135
SUMOReal myLength
Lane length [m].
Definition: MSLane.h:857
bool empty() const
Returns true if there is not a single vehicle on the lane.
Definition: MSLane.h:449
MSVehicle * getLastVehicle() const
returns the last vehicle
Definition: MSLane.cpp:880
SVCPermissions getPermissions() const
Returns the vehicle class permissions for this lane.
Definition: MSLane.h:383
virtual void swapAfterLaneChange(SUMOTime t)
moves myTmpVehicles int myVehicles after a lane change procedure
Definition: MSLane.cpp:967
SUMOReal getLengthGeometryFactor() const
return shape.length() / myLength
Definition: MSLane.h:327
int getIndex() const
Returns the lane&#39;s index.
Definition: MSLane.h:398
An upper class for objects with additional parameters.
Definition: Parameterised.h:47
std::map< MSEdge *, std::vector< MSLane * > > myApproachingLanes
Definition: MSLane.h:903
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:916
const SUMOReal myLengthGeometryFactor
Definition: MSLane.h:906
unsigned int getVehicleNumber() const
Returns the number of vehicles on this lane.
Definition: MSLane.h:284
std::vector< const MSLane * > getOutgoingLanes() const
get the list of outgoing lanes
Definition: MSLane.cpp:1359
static bool dictionary(const std::string &id, MSLane *lane)
Static (sic!) container methods {.
Definition: MSLane.cpp:772
SUMOReal getNOxEmissions() const
Returns the sum of last step NOx emissions.
Definition: MSLane.cpp:1496
SUMOReal getPMxEmissions() const
Returns the sum of last step PMx emissions.
Definition: MSLane.cpp:1484
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:1561
MSVehicle * myInlappingVehicle
The vehicle which laps into this lane.
Definition: MSLane.h:896
SUMOReal myBruttoVehicleLengthSum
The current length of all vehicles on this lane, including their minGaps.
Definition: MSLane.h:887
vehicle_position_sorter()
Constructor.
Definition: MSLane.h:926
static void clear()
Clears the dictionary.
Definition: MSLane.cpp:795
bool isEmpty() const
Definition: MSLane.cpp:875
SUMOReal interpolateLanePosToGeometryPos(SUMOReal lanePos) const
Definition: MSLane.h:333
SUMOReal getCO2Emissions() const
Returns the sum of last step CO2 emissions.
Definition: MSLane.cpp:1460
MSEdge *const myEdge
The lane&#39;s edge, for routing only.
Definition: MSLane.h:863
SUMOReal getCOEmissions() const
Returns the sum of last step CO emissions.
Definition: MSLane.cpp:1472
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:1070
bool checkFailure(MSVehicle *aVehicle, SUMOReal &speed, SUMOReal &dist, const SUMOReal nspeed, const bool patchSpeed, const std::string errorMsg) const
Definition: MSLane.cpp:323
SUMOReal myInlappingVehicleEnd
End position of a vehicle which laps into this lane.
Definition: MSLane.h:893
static size_t dictSize()
Returns the number of stored lanes.
Definition: MSLane.h:510
bool isApproachedFrom(MSEdge *const edge)
Definition: MSLane.cpp:1021
MSLane & operator=(const MSLane &)
invalidated assignment operator
void saveState(OutputDevice &out)
Saves the state of this lane into the given stream.
Definition: MSLane.cpp:1594
const PositionVector & getShape() const
Returns this lane&#39;s shape.
Definition: MSLane.h:322
void visit(const TraCIServerAPI_Lane::StoringVisitor &cont) const
Callback for visiting the lane when traversing an RTree.
Definition: MSLane.h:797
MSVehicle * getPartialOccupator() const
Returns the vehicle which laps into this lane.
Definition: MSLane.h:252
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:71
#define SUMOReal
Definition: config.h:213
virtual ~MSLane()
Destructor.
Definition: MSLane.cpp:100
SUMOReal myNettoVehicleLengthSum
The current length of all vehicles on this lane, excluding their minGaps.
Definition: MSLane.h:890
const MSLinkCont & getLinkCont() const
returns the container with all links !!!
Definition: MSLane.cpp:947
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:353
SUMOReal getHarmonoise_NoiseEmissions() const
Returns the sum of last step noise emissions.
Definition: MSLane.cpp:1544
const std::vector< IncomingLaneInfo > & getIncomingLanes() const
Definition: MSLane.h:589
SUMOReal interpolateGeometryPosToLanePos(SUMOReal geometryPos) const
Definition: MSLane.h:345
SUMOReal getBruttoOccupancy() const
Returns the brutto (including minGaps) occupancy of this lane during the last step.
Definition: MSLane.cpp:1395
const std::vector< MSMoveReminder * > & getMoveReminders() const
Return the list of this lane&#39;s move reminders.
Definition: MSLane.h:151
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:1384
edge_finder(MSEdge *e)
Definition: MSLane.h:962
virtual bool appropriate(const MSVehicle *veh)
Definition: MSLane.cpp:830
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:580