SUMO - Simulation of Urban MObility
MSEdge.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 /****************************************************************************/
19 // A road/street connecting two junctions
20 /****************************************************************************/
21 #ifndef MSEdge_h
22 #define MSEdge_h
23 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #include <config.h>
29 
30 #include <vector>
31 #include <map>
32 #include <string>
33 #include <iostream>
34 #include <utils/common/Named.h>
36 #include <utils/common/SUMOTime.h>
38 #include <utils/geom/Boundary.h>
40 #include "MSNet.h"
41 
42 
43 // ===========================================================================
44 // class declarations
45 // ===========================================================================
46 class Boundary;
47 class OutputDevice;
48 class SUMOVehicle;
50 class MSVehicle;
51 class MSLane;
52 class MSLaneChanger;
53 class MSPerson;
54 class MSJunction;
55 class MSEdge;
56 class MSContainer;
57 class MSTransportable;
58 
59 
60 // ===========================================================================
61 // class definitions
62 // ===========================================================================
71 typedef std::vector<MSEdge*> MSEdgeVector;
72 typedef std::vector<const MSEdge*> ConstMSEdgeVector;
73 typedef std::vector<std::pair<const MSEdge*, const MSEdge*> > MSConstEdgePairVector;
74 
75 class MSEdge : public Named, public Parameterised {
76 public:
78  typedef std::map< const MSEdge*, std::vector<MSLane*>* > AllowedLanesCont;
79 
81  typedef std::map< SUMOVehicleClass, AllowedLanesCont > ClassedAllowedLanesCont;
82 
83 
84 public:
96  MSEdge(const std::string& id, int numericalID, const SumoXMLEdgeFunc function,
97  const std::string& streetName, const std::string& edgeType, int priority);
98 
99 
101  virtual ~MSEdge();
102 
103 
109  void initialize(const std::vector<MSLane*>* lanes);
110 
111 
114  void recalcCache();
115 
116 
118  void closeBuilding();
119 
121  void buildLaneChanger();
122 
123  /* @brief returns whether initizliaing a lane change is permitted on this edge
124  * @note Has to be called after all sucessors and predecessors have been set (after closeBuilding())
125  */
126  bool allowsLaneChanging();
127 
130 
137  MSLane* leftLane(const MSLane* const lane) const;
138 
139 
146  MSLane* rightLane(const MSLane* const lane) const;
147 
148 
155  MSLane* parallelLane(const MSLane* const lane, int offset) const;
156 
157 
162  const std::vector<MSLane*>& getLanes() const {
163  return *myLanes;
164  }
165 
171  inline const std::set<MSTransportable*>& getPersons() const {
172  return myPersons;
173  }
174 
179  std::vector<MSTransportable*> getSortedPersons(SUMOTime timestep, bool includeRiding = false) const;
180 
181 
186  std::vector<MSTransportable*> getSortedContainers(SUMOTime timestep, bool includeRiding = false) const;
187 
196  const std::vector<MSLane*>* allowedLanes(const MSEdge& destination,
197  SUMOVehicleClass vclass = SVC_IGNORING) const;
198 
199 
207  const std::vector<MSLane*>* allowedLanes(SUMOVehicleClass vclass = SVC_IGNORING) const;
209 
210 
211 
214 
219  inline SumoXMLEdgeFunc getFunction() const {
220  return myFunction;
221  }
222 
224  inline bool isInternal() const {
225  return myFunction == EDGEFUNC_INTERNAL;
226  }
227 
229  inline bool isCrossing() const {
230  return myFunction == EDGEFUNC_CROSSING;
231  }
232 
233 
236 
238  inline const MSEdge* getBidiEdge() const {
239  return myBidiEdge;
240  }
241 
243  inline bool isWalkingArea() const {
245  }
246 
247  inline bool isTazConnector() const {
248  return myFunction == EDGEFUNC_CONNECTOR;
249  }
250 
254  inline int getNumericalID() const {
255  return myNumericalID;
256  }
257 
258 
261  const std::string& getStreetName() const {
262  return myStreetName;
263  }
264 
267  const std::string& getEdgeType() const {
268  return myEdgeType;
269  }
270 
273  int getPriority() const {
274  return myPriority;
275  }
277 
281  void setCrossingEdges(const std::vector<std::string>& crossingEdges) {
282  myCrossingEdges.clear();
283  myCrossingEdges.insert(myCrossingEdges.begin(), crossingEdges.begin(), crossingEdges.end());
284  }
285 
289  const std::vector<std::string>& getCrossingEdges() const {
290  return myCrossingEdges;
291  }
292 
293 
296 
302  void addSuccessor(MSEdge* edge, const MSEdge* via = nullptr);
303 
307  int getNumSuccessors() const {
308  return (int) mySuccessors.size();
309  }
310 
311 
317 
323 
324 
329  int getNumPredecessors() const {
330  return (int) myPredecessors.size();
331  }
332 
333 
337  const MSEdgeVector& getPredecessors() const {
338  return myPredecessors;
339  }
340 
341 
342  const MSJunction* getFromJunction() const {
343  return myFromJunction;
344  }
345 
346  const MSJunction* getToJunction() const {
347  return myToJunction;
348  }
349 
350 
351  void setJunctions(MSJunction* from, MSJunction* to) {
352  myFromJunction = from;
353  myToJunction = to;
354  }
356 
357 
358 
361 
365  bool isVaporizing() const {
366  return myVaporizationRequests > 0;
367  }
368 
369 
380 
381 
393 
394 
403  double getCurrentTravelTime(const double minSpeed = NUMERICAL_EPS) const;
404 
405 
407  inline double getMinimumTravelTime(const SUMOVehicle* const veh) const {
409  return 0;
410  } else if (veh != 0) {
411  return getLength() / getVehicleMaxSpeed(veh);
412  } else {
413  return getLength() / getSpeedLimit();
414  }
415  }
416 
417 
425  static inline double getTravelTimeStatic(const MSEdge* const edge, const SUMOVehicle* const veh, double time) {
426  return MSNet::getInstance()->getTravelTime(edge, veh, time);
427  }
428 
431  double getRoutingSpeed() const;
432 
433 
436 
456  bool insertVehicle(SUMOVehicle& v, SUMOTime time, const bool checkOnly = false, const bool forceCheck = false) const;
457 
458 
478  MSLane* getFreeLane(const std::vector<MSLane*>* allowed, const SUMOVehicleClass vclass, double departPos) const;
479 
480 
491  MSLane* getDepartLane(MSVehicle& veh) const;
492 
493 
499  }
500 
501 
505  inline void setLastFailedInsertionTime(SUMOTime time) const {
507  }
509 
510 
512  virtual void changeLanes(SUMOTime t);
513 
514 
516  const MSEdge* getInternalFollowingEdge(const MSEdge* followerAfterInternal) const;
517 
518 
520  double getInternalFollowingLengthTo(const MSEdge* followerAfterInternal) const;
521 
523  const MSEdge* getNormalBefore() const;
524 
526  inline bool prohibits(const SUMOVehicle* const vehicle) const {
527  if (vehicle == 0) {
528  return false;
529  }
530  const SUMOVehicleClass svc = vehicle->getVClass();
531  return (myCombinedPermissions & svc) != svc;
532  }
533 
535  return myCombinedPermissions;
536  }
537 
541  double getWidth() const {
542  return myWidth;
543  }
544 
546  const std::vector<double> getSubLaneSides() const {
547  return mySublaneSides;
548  }
549 
550  void rebuildAllowedLanes();
551 
552 
557  double getDistanceTo(const MSEdge* other) const;
558 
559 
563  inline double getLength() const {
564  return myLength;
565  }
566 
567 
572  double getSpeedLimit() const;
573 
575  double getLengthGeometryFactor() const;
576 
580  void setMaxSpeed(double val) const;
581 
587  double getVehicleMaxSpeed(const SUMOVehicle* const veh) const;
588 
589 
590  virtual void addPerson(MSTransportable* p) const {
591  myPersons.insert(p);
592  }
593 
594  virtual void removePerson(MSTransportable* p) const {
595  std::set<MSTransportable*>::iterator i = myPersons.find(p);
596  if (i != myPersons.end()) {
597  myPersons.erase(i);
598  }
599  }
600 
602  virtual void addContainer(MSTransportable* container) const {
603  myContainers.insert(container);
604  }
605 
607  virtual void removeContainer(MSTransportable* container) const {
608  std::set<MSTransportable*>::iterator i = myContainers.find(container);
609  if (i != myContainers.end()) {
610  myContainers.erase(i);
611  }
612  }
613 
614  inline bool isRoundabout() const {
615  return myAmRoundabout;
616  }
617 
619  myAmRoundabout = true;
620  }
621 
622  void markDelayed() const {
623  myAmDelayed = true;
624  }
625 
626  // return whether there have been vehicles on this edge at least once
627  inline bool isDelayed() const {
628  return myAmDelayed;
629  }
630 
631  bool hasLaneChanger() const {
632  return myLaneChanger != 0;
633  }
634 
636  bool canChangeToOpposite();
637 
639  const MSEdge* getOppositeEdge() const;
640 
642  double getMeanSpeed() const;
643 
645  bool hasMinorLink() const;
646 
648  bool isFringe() const {
649  return myAmFringe;
650  }
651 
653  virtual bool isSelected() const {
654  return false;
655  }
656 
658  virtual void lock() const {}
659 
661  virtual void unlock() const {};
662 
666  static bool dictionary(const std::string& id, MSEdge* edge);
667 
669  static MSEdge* dictionary(const std::string& id);
670 
672  static int dictSize();
673 
675  static const MSEdgeVector& getAllEdges();
676 
678  static void clear();
679 
681  static void insertIDs(std::vector<std::string>& into);
682 
683 
684 public:
687 
696  static void parseEdgesList(const std::string& desc, ConstMSEdgeVector& into,
697  const std::string& rid);
698 
699 
706  static void parseEdgesList(const std::vector<std::string>& desc, ConstMSEdgeVector& into,
707  const std::string& rid);
709 
710 
711 protected:
715  class by_id_sorter {
716  public:
718  explicit by_id_sorter() { }
719 
721  int operator()(const MSEdge* const e1, const MSEdge* const e2) const {
722  return e1->getID() < e2->getID();
723  }
724 
725  };
726 
731  public:
733  explicit transportable_by_position_sorter(SUMOTime timestep): myTime(timestep) { }
734 
736  int operator()(const MSTransportable* const c1, const MSTransportable* const c2) const;
737  private:
739  };
740 
741 
750  const std::vector<MSLane*>* allowedLanes(const MSEdge* destination,
751  SUMOVehicleClass vclass = SVC_IGNORING) const;
752 
753 
755  const std::vector<MSLane*>* getAllowedLanesWithDefault(const AllowedLanesCont& c, const MSEdge* dest) const;
756 
758  double getDepartPosBound(const MSVehicle& veh, bool upper = true) const;
759 
760 protected:
762  const int myNumericalID;
763 
765  const std::vector<MSLane*>* myLanes;
766 
769 
772 
775 
778 
782  mutable std::set<int> myFailedInsertionMemory;
783 
785  std::vector<std::string> myCrossingEdges;
786 
789 
791 
794 
798 
800  mutable std::set<MSTransportable*> myPersons;
801 
803  mutable std::set<MSTransportable*> myContainers;
804 
807 
809  AllowedLanesCont myAllowed;
810 
812  // @note: this map is filled on demand
813  mutable ClassedAllowedLanesCont myClassedAllowed;
814 
820 
822  std::string myStreetName;
823 
825  std::string myEdgeType;
826 
828  const int myPriority;
829 
831  double myWidth;
832 
834  double myLength;
835 
838 
840  mutable bool myAmDelayed;
841 
844 
847 
849  std::vector<double> mySublaneSides;
850 
853 
855  typedef std::map< std::string, MSEdge* > DictType;
856 
860  static DictType myDict;
861 
867 
868 
870  mutable std::map<SUMOVehicleClass, MSEdgeVector> myClassesSuccessorMap;
871 
873  mutable std::map<SUMOVehicleClass, MSConstEdgePairVector> myClassesViaSuccessorMap;
874 
877 
878 private:
879 
882 
884  MSEdge(const MSEdge&);
885 
887  MSEdge& operator=(const MSEdge&);
888 
889  bool isSuperposable(const MSEdge* other);
890 };
891 
892 
893 #endif
894 
895 /****************************************************************************/
896 
const SumoXMLEdgeFunc myFunction
the purpose of the edge
Definition: MSEdge.h:771
virtual bool isSelected() const
whether this lane is selected in the GUI
Definition: MSEdge.h:653
bool myAmDelayed
whether this edge had a vehicle with less than max speed on it
Definition: MSEdge.h:840
double getDepartPosBound(const MSVehicle &veh, bool upper=true) const
return upper bound for the depart position on this edge
Definition: MSEdge.cpp:419
int getNumPredecessors() const
Returns the number of edges this edge is connected to.
Definition: MSEdge.h:329
const std::vector< double > getSubLaneSides() const
Returns the right side offsets of this edge&#39;s sublanes.
Definition: MSEdge.h:546
bool allowsLaneChanging()
Definition: MSEdge.cpp:218
bool insertVehicle(SUMOVehicle &v, SUMOTime time, const bool checkOnly=false, const bool forceCheck=false) const
Tries to insert the given vehicle into the network.
Definition: MSEdge.cpp:526
std::set< MSTransportable * > myContainers
Containers on the edge.
Definition: MSEdge.h:803
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:79
static void insertIDs(std::vector< std::string > &into)
Inserts IDs of all known edges into the given vector.
Definition: MSEdge.cpp:791
long long int SUMOTime
Definition: SUMOTime.h:36
Sorts edges by their ids.
Definition: MSEdge.h:715
int getPriority() const
Returns the priority of the edge.
Definition: MSEdge.h:273
MSEdge(const std::string &id, int numericalID, const SumoXMLEdgeFunc function, const std::string &streetName, const std::string &edgeType, int priority)
Constructor.
Definition: MSEdge.cpp:64
MSLane * parallelLane(const MSLane *const lane, int offset) const
Returns the lane with the given offset parallel to the given lane one or 0 if it does not exist...
Definition: MSEdge.cpp:275
double getLengthGeometryFactor() const
return shape.length() / myLength
Definition: MSEdge.cpp:851
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
static int dictSize()
Returns the number of edges.
Definition: MSEdge.cpp:769
void addSuccessor(MSEdge *edge, const MSEdge *via=nullptr)
Adds an edge to the list of edges which may be reached from this edge and to the incoming of the othe...
Definition: MSEdge.cpp:911
virtual void unlock() const
release exclusive access to the mesoscopic state
Definition: MSEdge.h:661
void recalcCache()
Recalculates the cached values.
Definition: MSEdge.cpp:122
const MSEdgeVector & getPredecessors() const
Definition: MSEdge.h:337
The base class for an intersection.
Definition: MSJunction.h:60
static MSEdgeVector myEdges
Static list of edges.
Definition: MSEdge.h:865
std::vector< std::pair< const MSEdge *, const MSEdge * > > MSConstEdgePairVector
Definition: MSEdge.h:73
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
void setCrossingEdges(const std::vector< std::string > &crossingEdges)
Sets the crossed edge ids for a crossing edge.
Definition: MSEdge.h:281
ClassedAllowedLanesCont myClassedAllowed
From vehicle class to lanes allowed to be used by it.
Definition: MSEdge.h:813
void closeBuilding()
Definition: MSEdge.cpp:153
virtual ~MSEdge()
Destructor.
Definition: MSEdge.cpp:85
const std::vector< MSLane * > * allowedLanes(const MSEdge &destination, SUMOVehicleClass vclass=SVC_IGNORING) const
Get the allowed lanes to reach the destination-edge.
Definition: MSEdge.cpp:290
bool isRoundabout() const
Definition: MSEdge.h:614
const std::vector< MSLane * > & getLanes() const
Returns this edge&#39;s lanes.
Definition: MSEdge.h:162
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
Definition: MSNet.cpp:160
std::string myEdgeType
the type of the edge (optionally used during network creation)
Definition: MSEdge.h:825
const std::vector< std::string > & getCrossingEdges() const
Gets the crossed edge ids.
Definition: MSEdge.h:289
double getMeanSpeed() const
get the mean speed
Definition: MSEdge.cpp:696
transportable_by_position_sorter(SUMOTime timestep)
constructor
Definition: MSEdge.h:733
static bool dictionary(const std::string &id, MSEdge *edge)
Inserts edge into the static dictionary Returns true if the key id isn&#39;t already in the dictionary...
Definition: MSEdge.cpp:742
std::vector< double > mySublaneSides
the right side for each sublane on this edge
Definition: MSEdge.h:849
const int myNumericalID
This edge&#39;s numerical id.
Definition: MSEdge.h:762
SUMOTime incVaporization(SUMOTime t)
Enables vaporization.
Definition: MSEdge.cpp:373
void initialize(const std::vector< MSLane *> *lanes)
Initialize the edge.
Definition: MSEdge.cpp:101
std::vector< const MSEdge * > ConstMSEdgeVector
Definition: MSEdge.h:72
const std::string & getID() const
Returns the id.
Definition: Named.h:69
MSConstEdgePairVector myViaSuccessors
Definition: MSEdge.h:790
int myVaporizationRequests
Vaporizer counter.
Definition: MSEdge.h:774
double getLength() const
return the length of the edge
Definition: MSEdge.h:563
const MSJunction * getToJunction() const
Definition: MSEdge.h:346
std::vector< MSTransportable * > getSortedPersons(SUMOTime timestep, bool includeRiding=false) const
Returns this edge&#39;s persons sorted by pos.
Definition: MSEdge.cpp:874
SUMOTime decVaporization(SUMOTime t)
Disables vaporization.
Definition: MSEdge.cpp:380
int getNumericalID() const
Returns the numerical id of the edge.
Definition: MSEdge.h:254
double getSpeedLimit() const
Returns the speed limit of the edge The speed limit of the first lane is retured; should probably be...
Definition: MSEdge.cpp:844
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:42
const MSEdge * getBidiEdge() const
return opposite superposable/congruent edge, if it exist and 0 else
Definition: MSEdge.h:238
bool hasLaneChanger() const
Definition: MSEdge.h:631
std::map< std::string, MSEdge *> DictType
definition of the static dictionary type
Definition: MSEdge.h:855
bool isVaporizing() const
Returns whether vehicles on this edge shall be vaporized.
Definition: MSEdge.h:365
int getNumSuccessors() const
Returns the number of edges that may be reached from this edge.
Definition: MSEdge.h:307
const std::string & getEdgeType() const
Returns the type of the edge.
Definition: MSEdge.h:267
int operator()(const MSEdge *const e1, const MSEdge *const e2) const
comparing operator
Definition: MSEdge.h:721
double getCurrentTravelTime(const double minSpeed=NUMERICAL_EPS) const
Computes and returns the current travel time for this edge.
Definition: MSEdge.cpp:725
void checkAndRegisterBiDirEdge()
check and register the opposite superposable edge if any
Definition: MSEdge.cpp:1037
MSEdge & operator=(const MSEdge &)
assignment operator.
Performs lane changing of vehicles.
Definition: MSLaneChanger.h:48
bool isDelayed() const
Definition: MSEdge.h:627
A road/street connecting two junctions.
Definition: MSEdge.h:75
virtual SUMOVehicleClass getVClass() const =0
Returns the vehicle&#39;s access class.
SUMOTime myLastFailedInsertionTime
The time of last insertion failure.
Definition: MSEdge.h:777
std::map< SUMOVehicleClass, MSEdgeVector > myClassesSuccessorMap
The successors available for a given vClass.
Definition: MSEdge.h:870
void rebuildAllowedLanes()
Definition: MSEdge.cpp:241
double myLength
the length of the edge (cached value for speedup)
Definition: MSEdge.h:834
Representation of a vehicle.
Definition: SUMOVehicle.h:60
static double getTravelTimeStatic(const MSEdge *const edge, const SUMOVehicle *const veh, double time)
Returns the travel time for the given edge.
Definition: MSEdge.h:425
static double getTravelTime(const MSEdge *const e, const SUMOVehicle *const v, double t)
Returns the travel time to pass an edge.
Definition: MSNet.cpp:143
AllowedLanesCont myAllowed
Associative container from destination-edge to allowed-lanes.
Definition: MSEdge.h:809
bool hasMinorLink() const
whether any lane has a minor link
Definition: MSEdge.cpp:1024
const MSEdge * getOppositeEdge() const
Returns the opposite direction edge if on exists else a nullptr.
Definition: MSEdge.cpp:1014
std::map< SUMOVehicleClass, AllowedLanesCont > ClassedAllowedLanesCont
Map from vehicle types to lanes that may be used to reach one of the next edges.
Definition: MSEdge.h:81
static void clear()
Clears the dictionary.
Definition: MSEdge.cpp:781
SVCPermissions myMinimumPermissions
The intersection of lane permissions for this edge.
Definition: MSEdge.h:816
virtual void addPerson(MSTransportable *p) const
Definition: MSEdge.h:590
const std::set< MSTransportable * > & getPersons() const
Returns this edge&#39;s persons set.
Definition: MSEdge.h:171
MSEdgeVector mySuccessors
The succeeding edges.
Definition: MSEdge.h:788
double getMinimumTravelTime(const SUMOVehicle *const veh) const
returns the minimum travel time for the given vehicle
Definition: MSEdge.h:407
MSJunction * myToJunction
Definition: MSEdge.h:797
MSLaneChanger * myLaneChanger
This member will do the lane-change.
Definition: MSEdge.h:768
double getRoutingSpeed() const
Returns the averaged speed used by the routing device.
Definition: MSEdge.cpp:735
MSLane * leftLane(const MSLane *const lane) const
Returns the lane left to the one given, 0 if the given lane is leftmost.
Definition: MSEdge.cpp:263
const MSEdge * getNormalBefore() const
if this edge is an internal edge, return its first normal predecessor, otherwise the edge itself ...
Definition: MSEdge.cpp:686
bool myAmFringe
whether this edge is at the network fringe
Definition: MSEdge.h:846
MSLane * getDepartLane(MSVehicle &veh) const
Finds a depart lane for the given vehicle parameters.
Definition: MSEdge.cpp:463
virtual void removePerson(MSTransportable *p) const
Definition: MSEdge.h:594
SUMOTime getLastFailedInsertionTime() const
Returns the last time a vehicle could not be inserted.
Definition: MSEdge.h:497
const MSConstEdgePairVector & getViaSuccessors(SUMOVehicleClass vClass=SVC_IGNORING) const
Returns the following edges with internal vias, restricted by vClass.
Definition: MSEdge.cpp:963
const std::vector< MSLane * > * myLanes
Container for the edge&#39;s lane; should be sorted: (right-hand-traffic) the more left the lane...
Definition: MSEdge.h:765
bool isCrossing() const
return whether this edge is a pedestrian crossing
Definition: MSEdge.h:229
bool isFringe() const
return whether this edge is at the fringe of the network
Definition: MSEdge.h:648
const MSEdge * myBidiEdge
the oppositing superposble edge
Definition: MSEdge.h:881
bool isInternal() const
return whether this edge is an internal edge
Definition: MSEdge.h:224
An upper class for objects with additional parameters.
Definition: Parameterised.h:44
bool isSuperposable(const MSEdge *other)
Definition: MSEdge.cpp:1055
virtual void removeContainer(MSTransportable *container) const
Remove container from myContainers.
Definition: MSEdge.h:607
bool canChangeToOpposite()
whether this edge allows changing to the opposite direction edge
Definition: MSEdge.cpp:1005
const std::string & getStreetName() const
Returns the street name of the edge.
Definition: MSEdge.h:261
Base class for objects which have an id.
Definition: Named.h:49
const MSEdge * getInternalFollowingEdge(const MSEdge *followerAfterInternal) const
Definition: MSEdge.cpp:652
double getVehicleMaxSpeed(const SUMOVehicle *const veh) const
Returns the maximum speed the vehicle may use on this edge.
Definition: MSEdge.cpp:856
SVCPermissions myCombinedPermissions
The union of lane permissions for this edge.
Definition: MSEdge.h:818
const MSEdgeVector & getSuccessors(SUMOVehicleClass vClass=SVC_IGNORING) const
Returns the following edges, restricted by vClass.
Definition: MSEdge.cpp:926
void markDelayed() const
Definition: MSEdge.h:622
void buildLaneChanger()
Has to be called after all sucessors and predecessors have been set (after closeBuilding()) ...
Definition: MSEdge.cpp:200
Structure representing possible vehicle parameter.
bool prohibits(const SUMOVehicle *const vehicle) const
Returns whether the vehicle (class) is not allowed on the edge.
Definition: MSEdge.h:526
bool isTazConnector() const
Definition: MSEdge.h:247
std::map< SUMOVehicleClass, MSConstEdgePairVector > myClassesViaSuccessorMap
The successors available for a given vClass.
Definition: MSEdge.h:873
virtual void addContainer(MSTransportable *container) const
Add a container to myContainers.
Definition: MSEdge.h:602
static const MSEdgeVector & getAllEdges()
Returns all edges with a numerical id.
Definition: MSEdge.cpp:775
virtual void changeLanes(SUMOTime t)
Performs lane changing on this edge.
Definition: MSEdge.cpp:642
const MSJunction * getFromJunction() const
Definition: MSEdge.h:342
bool myAmRoundabout
whether this edge belongs to a roundabout
Definition: MSEdge.h:843
double myWidth
Edge width [m].
Definition: MSEdge.h:831
SumoXMLEdgeFunc
Numbers representing special SUMO-XML-attribute values for representing edge functions used in netbui...
std::string myStreetName
the real-world name of this edge (need not be unique)
Definition: MSEdge.h:822
MSJunction * myFromJunction
the junctions for this edge
Definition: MSEdge.h:796
double getInternalFollowingLengthTo(const MSEdge *followerAfterInternal) const
returns the length of all internal edges on the junction until reaching the non-internal edge followe...
Definition: MSEdge.cpp:672
void setMaxSpeed(double val) const
Sets a new maximum speed for all lanes (used by TraCI and MSCalibrator)
Definition: MSEdge.cpp:863
void setJunctions(MSJunction *from, MSJunction *to)
Definition: MSEdge.h:351
virtual void lock() const
grant exclusive access to the mesoscopic state
Definition: MSEdge.h:658
by_id_sorter()
constructor
Definition: MSEdge.h:718
std::map< const MSEdge *, std::vector< MSLane * > *> AllowedLanesCont
Suceeding edges (keys) and allowed lanes to reach these edges (values).
Definition: MSEdge.h:78
const int myPriority
the priority of the edge (used during network creation)
Definition: MSEdge.h:828
bool isWalkingArea() const
return whether this edge is walking area
Definition: MSEdge.h:243
std::vector< std::string > myCrossingEdges
The crossed edges id for a crossing edge. On not crossing edges it is empty.
Definition: MSEdge.h:785
static DictType myDict
Static dictionary to associate string-ids with objects.
Definition: MSEdge.h:860
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:64
Sorts transportables by their positions.
Definition: MSEdge.h:730
double getDistanceTo(const MSEdge *other) const
optimistic air distance heuristic for use in routing
Definition: MSEdge.cpp:829
#define NUMERICAL_EPS
Definition: config.h:148
std::vector< MSEdge * > MSEdgeVector
Definition: MSEdge.h:71
SVCPermissions getPermissions() const
Definition: MSEdge.h:534
void markAsRoundabout()
Definition: MSEdge.h:618
Boundary myTazBoundary
The bounding rectangle of incoming or outgoing edges for taz connectors.
Definition: MSEdge.h:876
MSEdgeVector myPredecessors
The preceeding edges.
Definition: MSEdge.h:793
std::vector< MSTransportable * > getSortedContainers(SUMOTime timestep, bool includeRiding=false) const
Returns this edge&#39;s containers sorted by pos.
Definition: MSEdge.cpp:892
Representation of a lane in the micro simulation.
Definition: MSLane.h:71
MSLane * rightLane(const MSLane *const lane) const
Returns the lane right to the one given, 0 if the given lane is rightmost.
Definition: MSEdge.cpp:269
double myEmptyTraveltime
the traveltime on the empty edge (cached value for speedup)
Definition: MSEdge.h:837
MSLane * getFreeLane(const std::vector< MSLane *> *allowed, const SUMOVehicleClass vclass, double departPos) const
Finds the emptiest lane allowing the vehicle class.
Definition: MSEdge.cpp:387
static void parseEdgesList(const std::string &desc, ConstMSEdgeVector &into, const std::string &rid)
Parses the given string assuming it contains a list of edge ids divided by spaces.
Definition: MSEdge.cpp:799
const std::vector< MSLane * > * getAllowedLanesWithDefault(const AllowedLanesCont &c, const MSEdge *dest) const
lookup in map and return 0 if not found
Definition: MSEdge.cpp:302
SumoXMLEdgeFunc getFunction() const
Returns the edge type (SumoXMLEdgeFunc)
Definition: MSEdge.h:219
vehicles ignoring classes
std::set< int > myFailedInsertionMemory
A cache for the rejected insertion attempts. Used to assure that no further insertion attempts are ma...
Definition: MSEdge.h:782
std::set< MSTransportable * > myPersons
Persons on the edge for drawing and pushbutton.
Definition: MSEdge.h:800
void setLastFailedInsertionTime(SUMOTime time) const
Sets the last time a vehicle could not be inserted.
Definition: MSEdge.h:505
double getWidth() const
Returns the edges&#39;s width (sum over all lanes)
Definition: MSEdge.h:541