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 private:
78  typedef std::vector<std::pair<SVCPermissions, const std::vector<MSLane*>* > > AllowedLanesCont;
79 
81  typedef std::map<const MSEdge*, AllowedLanesCont> AllowedLanesByTarget;
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() const;
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  inline 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 
200 
208  const std::vector<MSLane*>* allowedLanes(SUMOVehicleClass vclass = SVC_IGNORING) const;
210 
211 
212 
215 
220  inline SumoXMLEdgeFunc getFunction() const {
221  return myFunction;
222  }
223 
225  inline bool isInternal() const {
226  return myFunction == EDGEFUNC_INTERNAL;
227  }
228 
230  inline bool isCrossing() const {
231  return myFunction == EDGEFUNC_CROSSING;
232  }
233 
234 
236  void checkAndRegisterBiDirEdge(const std::string& bidiID="");
237 
239  inline const MSEdge* getBidiEdge() const {
240  return myBidiEdge;
241  }
242 
244  inline bool isWalkingArea() const {
246  }
247 
248  inline bool isTazConnector() const {
249  return myFunction == EDGEFUNC_CONNECTOR;
250  }
251 
255  inline int getNumericalID() const {
256  return myNumericalID;
257  }
258 
259 
262  const std::string& getStreetName() const {
263  return myStreetName;
264  }
265 
268  const std::string& getEdgeType() const {
269  return myEdgeType;
270  }
271 
274  int getPriority() const {
275  return myPriority;
276  }
278 
282  void setCrossingEdges(const std::vector<std::string>& crossingEdges) {
283  myCrossingEdges.clear();
284  myCrossingEdges.insert(myCrossingEdges.begin(), crossingEdges.begin(), crossingEdges.end());
285  }
286 
290  const std::vector<std::string>& getCrossingEdges() const {
291  return myCrossingEdges;
292  }
293 
294 
297 
303  void addSuccessor(MSEdge* edge, const MSEdge* via = nullptr);
304 
308  int getNumSuccessors() const {
309  return (int) mySuccessors.size();
310  }
311 
312 
318 
324 
325 
330  int getNumPredecessors() const {
331  return (int) myPredecessors.size();
332  }
333 
334 
338  const MSEdgeVector& getPredecessors() const {
339  return myPredecessors;
340  }
341 
342 
343  const MSJunction* getFromJunction() const {
344  return myFromJunction;
345  }
346 
347  const MSJunction* getToJunction() const {
348  return myToJunction;
349  }
350 
351 
352  void setJunctions(MSJunction* from, MSJunction* to);
354 
355 
356 
359 
363  bool isVaporizing() const {
364  return myVaporizationRequests > 0;
365  }
366 
367 
378 
379 
391 
392 
401  double getCurrentTravelTime(const double minSpeed = NUMERICAL_EPS) const;
402 
403 
405  inline double getMinimumTravelTime(const SUMOVehicle* const veh) const {
407  return 0;
408  } else if (veh != 0) {
409  return getLength() / getVehicleMaxSpeed(veh);
410  } else {
411  return getLength() / getSpeedLimit();
412  }
413  }
414 
415 
423  static inline double getTravelTimeStatic(const MSEdge* const edge, const SUMOVehicle* const veh, double time) {
424  return MSNet::getInstance()->getTravelTime(edge, veh, time);
425  }
426 
429  double getRoutingSpeed() const;
430 
431 
434 
454  bool insertVehicle(SUMOVehicle& v, SUMOTime time, const bool checkOnly = false, const bool forceCheck = false) const;
455 
456 
476  MSLane* getFreeLane(const std::vector<MSLane*>* allowed, const SUMOVehicleClass vclass, double departPos) const;
477 
478 
489  MSLane* getDepartLane(MSVehicle& veh) const;
490 
491 
497  }
498 
499 
503  inline void setLastFailedInsertionTime(SUMOTime time) const {
505  }
507 
508 
510  virtual void changeLanes(SUMOTime t);
511 
512 
514  const MSEdge* getInternalFollowingEdge(const MSEdge* followerAfterInternal) const;
515 
516 
518  double getInternalFollowingLengthTo(const MSEdge* followerAfterInternal) const;
519 
521  const MSEdge* getNormalBefore() const;
522 
524  inline bool prohibits(const SUMOVehicle* const vehicle) const {
525  if (vehicle == 0) {
526  return false;
527  }
528  const SUMOVehicleClass svc = vehicle->getVClass();
529  return (myCombinedPermissions & svc) != svc;
530  }
531 
533  return myCombinedPermissions;
534  }
535 
539  double getWidth() const {
540  return myWidth;
541  }
542 
544  const std::vector<double> getSubLaneSides() const {
545  return mySublaneSides;
546  }
547 
548  void rebuildAllowedLanes();
549 
550  void rebuildAllowedTargets(const bool updateVehicles=true);
551 
552 
558  double getDistanceTo(const MSEdge* other, const bool doBoundaryEstimate=false) const;
559 
560 
562  static const Position getStopPosition(const SUMOVehicleParameter::Stop& stop);
563 
564 
568  inline double getLength() const {
569  return myLength;
570  }
571 
572 
577  double getSpeedLimit() const;
578 
580  double getLengthGeometryFactor() const;
581 
585  void setMaxSpeed(double val) const;
586 
592  double getVehicleMaxSpeed(const SUMOVehicle* const veh) const;
593 
594 
595  virtual void addPerson(MSTransportable* p) const {
596  myPersons.insert(p);
597  }
598 
599  virtual void removePerson(MSTransportable* p) const {
600  std::set<MSTransportable*>::iterator i = myPersons.find(p);
601  if (i != myPersons.end()) {
602  myPersons.erase(i);
603  }
604  }
605 
607  virtual void addContainer(MSTransportable* container) const {
608  myContainers.insert(container);
609  }
610 
612  virtual void removeContainer(MSTransportable* container) const {
613  std::set<MSTransportable*>::iterator i = myContainers.find(container);
614  if (i != myContainers.end()) {
615  myContainers.erase(i);
616  }
617  }
618 
619  inline bool isRoundabout() const {
620  return myAmRoundabout;
621  }
622 
624  myAmRoundabout = true;
625  }
626 
627  void markDelayed() const {
628  myAmDelayed = true;
629  }
630 
631  // return whether there have been vehicles on this edge at least once
632  inline bool isDelayed() const {
633  return myAmDelayed;
634  }
635 
636  bool hasLaneChanger() const {
637  return myLaneChanger != 0;
638  }
639 
641  bool canChangeToOpposite();
642 
644  const MSEdge* getOppositeEdge() const;
645 
647  double getMeanSpeed() const;
648 
650  bool hasMinorLink() const;
651 
653  bool isFringe() const {
654  return myAmFringe;
655  }
656 
658  virtual bool isSelected() const {
659  return false;
660  }
661 
663  virtual void lock() const {}
664 
666  virtual void unlock() const {};
667 
671  static bool dictionary(const std::string& id, MSEdge* edge);
672 
674  static MSEdge* dictionary(const std::string& id);
675 
677  static int dictSize();
678 
680  static const MSEdgeVector& getAllEdges();
681 
683  static void clear();
684 
686  static void insertIDs(std::vector<std::string>& into);
687 
688 
689 public:
692 
701  static void parseEdgesList(const std::string& desc, ConstMSEdgeVector& into,
702  const std::string& rid);
703 
704 
711  static void parseEdgesList(const std::vector<std::string>& desc, ConstMSEdgeVector& into,
712  const std::string& rid);
714 
715 
716 protected:
720  class by_id_sorter {
721  public:
723  explicit by_id_sorter() { }
724 
726  int operator()(const MSEdge* const e1, const MSEdge* const e2) const {
727  return e1->getNumericalID() < e2->getNumericalID();
728  }
729 
730  };
731 
736  public:
738  explicit transportable_by_position_sorter(SUMOTime timestep): myTime(timestep) { }
739 
741  int operator()(const MSTransportable* const c1, const MSTransportable* const c2) const;
742  private:
744  };
745 
746 
748  double getDepartPosBound(const MSVehicle& veh, bool upper = true) const;
749 
750 protected:
752  const int myNumericalID;
753 
755  const std::vector<MSLane*>* myLanes;
756 
759 
762 
765 
768 
772  mutable std::set<int> myFailedInsertionMemory;
773 
775  std::vector<std::string> myCrossingEdges;
776 
779 
781 
784 
788 
790  mutable std::set<MSTransportable*> myPersons;
791 
793  mutable std::set<MSTransportable*> myContainers;
794 
797 
799  AllowedLanesCont myAllowed;
800 
802  AllowedLanesByTarget myAllowedTargets;
803 
809 
811  std::string myStreetName;
812 
814  std::string myEdgeType;
815 
817  const int myPriority;
818 
820  double myWidth;
821 
823  double myLength;
824 
827 
829  mutable bool myAmDelayed;
830 
833 
836 
838  std::vector<double> mySublaneSides;
839 
842 
844  typedef std::map< std::string, MSEdge* > DictType;
845 
849  static DictType myDict;
850 
856 
857 
859  mutable std::map<SUMOVehicleClass, MSEdgeVector> myClassesSuccessorMap;
860 
862  mutable std::map<SUMOVehicleClass, MSConstEdgePairVector> myClassesViaSuccessorMap;
863 
866 
867 private:
868 
871 
873  MSEdge(const MSEdge&);
874 
876  MSEdge& operator=(const MSEdge&);
877 
878  bool isSuperposable(const MSEdge* other);
879 
880  void addToAllowed(const SVCPermissions permissions, const std::vector<MSLane*>* allowedLanes, AllowedLanesCont& laneCont) const;
881 };
882 
883 
884 #endif
885 
886 /****************************************************************************/
887 
const SumoXMLEdgeFunc myFunction
the purpose of the edge
Definition: MSEdge.h:761
virtual bool isSelected() const
whether this lane is selected in the GUI
Definition: MSEdge.h:658
bool myAmDelayed
whether this edge had a vehicle with less than max speed on it
Definition: MSEdge.h:829
double getDepartPosBound(const MSVehicle &veh, bool upper=true) const
return upper bound for the depart position on this edge
Definition: MSEdge.cpp:468
int getNumPredecessors() const
Returns the number of edges this edge is connected to.
Definition: MSEdge.h:330
const std::vector< double > getSubLaneSides() const
Returns the right side offsets of this edge&#39;s sublanes.
Definition: MSEdge.h:544
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:575
std::set< MSTransportable * > myContainers
Containers on the edge.
Definition: MSEdge.h:793
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:837
long long int SUMOTime
Definition: SUMOTime.h:36
void checkAndRegisterBiDirEdge(const std::string &bidiID="")
check and register the opposite superposable edge if any
Definition: MSEdge.cpp:1102
AllowedLanesByTarget myAllowedTargets
From target edge to lanes allowed to be used to reach it.
Definition: MSEdge.h:802
Sorts edges by their ids.
Definition: MSEdge.h:720
int getPriority() const
Returns the priority of the edge.
Definition: MSEdge.h:274
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:375
double getLengthGeometryFactor() const
return shape.length() / myLength
Definition: MSEdge.cpp:906
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:815
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:966
virtual void unlock() const
release exclusive access to the mesoscopic state
Definition: MSEdge.h:666
void recalcCache()
Recalculates the cached values.
Definition: MSEdge.cpp:126
const MSEdgeVector & getPredecessors() const
Definition: MSEdge.h:338
The base class for an intersection.
Definition: MSJunction.h:61
static MSEdgeVector myEdges
Static list of edges.
Definition: MSEdge.h:854
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:282
void closeBuilding()
Definition: MSEdge.cpp:157
virtual ~MSEdge()
Destructor.
Definition: MSEdge.cpp:86
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:390
bool isRoundabout() const
Definition: MSEdge.h:619
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:165
std::string myEdgeType
the type of the edge (optionally used during network creation)
Definition: MSEdge.h:814
const std::vector< std::string > & getCrossingEdges() const
Gets the crossed edge ids.
Definition: MSEdge.h:290
double getMeanSpeed() const
get the mean speed
Definition: MSEdge.cpp:742
transportable_by_position_sorter(SUMOTime timestep)
constructor
Definition: MSEdge.h:738
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:788
std::vector< double > mySublaneSides
the right side for each sublane on this edge
Definition: MSEdge.h:838
const int myNumericalID
This edge&#39;s numerical id.
Definition: MSEdge.h:752
SUMOTime incVaporization(SUMOTime t)
Enables vaporization.
Definition: MSEdge.cpp:422
void initialize(const std::vector< MSLane *> *lanes)
Initialize the edge.
Definition: MSEdge.cpp:105
std::vector< const MSEdge * > ConstMSEdgeVector
Definition: MSEdge.h:72
MSConstEdgePairVector myViaSuccessors
Definition: MSEdge.h:780
int myVaporizationRequests
Vaporizer counter.
Definition: MSEdge.h:764
double getLength() const
return the length of the edge
Definition: MSEdge.h:568
const MSJunction * getToJunction() const
Definition: MSEdge.h:347
std::vector< MSTransportable * > getSortedPersons(SUMOTime timestep, bool includeRiding=false) const
Returns this edge&#39;s persons sorted by pos.
Definition: MSEdge.cpp:929
SUMOTime decVaporization(SUMOTime t)
Disables vaporization.
Definition: MSEdge.cpp:429
int getNumericalID() const
Returns the numerical id of the edge.
Definition: MSEdge.h:255
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:899
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:239
bool hasLaneChanger() const
Definition: MSEdge.h:636
std::map< std::string, MSEdge *> DictType
definition of the static dictionary type
Definition: MSEdge.h:844
bool isVaporizing() const
Returns whether vehicles on this edge shall be vaporized.
Definition: MSEdge.h:363
int getNumSuccessors() const
Returns the number of edges that may be reached from this edge.
Definition: MSEdge.h:308
const std::string & getEdgeType() const
Returns the type of the edge.
Definition: MSEdge.h:268
int operator()(const MSEdge *const e1, const MSEdge *const e2) const
comparing operator
Definition: MSEdge.h:726
double getCurrentTravelTime(const double minSpeed=NUMERICAL_EPS) const
Computes and returns the current travel time for this edge.
Definition: MSEdge.cpp:771
void addToAllowed(const SVCPermissions permissions, const std::vector< MSLane *> *allowedLanes, AllowedLanesCont &laneCont) const
Definition: MSEdge.cpp:236
MSEdge & operator=(const MSEdge &)
assignment operator.
Performs lane changing of vehicles.
Definition: MSLaneChanger.h:48
bool isDelayed() const
Definition: MSEdge.h:632
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:767
std::map< SUMOVehicleClass, MSEdgeVector > myClassesSuccessorMap
The successors available for a given vClass.
Definition: MSEdge.h:859
void rebuildAllowedLanes()
Definition: MSEdge.cpp:258
double myLength
the length of the edge (cached value for speedup)
Definition: MSEdge.h:823
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:423
static double getTravelTime(const MSEdge *const e, const SUMOVehicle *const v, double t)
Returns the travel time to pass an edge.
Definition: MSNet.cpp:148
AllowedLanesCont myAllowed
Associative container from vehicle class to allowed-lanes.
Definition: MSEdge.h:799
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
bool hasMinorLink() const
whether any lane has a minor link
Definition: MSEdge.cpp:1089
const MSEdge * getOppositeEdge() const
Returns the opposite direction edge if on exists else a nullptr.
Definition: MSEdge.cpp:1079
static void clear()
Clears the dictionary.
Definition: MSEdge.cpp:827
SVCPermissions myMinimumPermissions
The intersection of lane permissions for this edge.
Definition: MSEdge.h:805
virtual void addPerson(MSTransportable *p) const
Definition: MSEdge.h:595
const std::set< MSTransportable * > & getPersons() const
Returns this edge&#39;s persons set.
Definition: MSEdge.h:171
void rebuildAllowedTargets(const bool updateVehicles=true)
Definition: MSEdge.cpp:292
MSEdgeVector mySuccessors
The succeeding edges.
Definition: MSEdge.h:778
double getDistanceTo(const MSEdge *other, const bool doBoundaryEstimate=false) const
optimistic air distance heuristic for use in routing
Definition: MSEdge.cpp:875
double getMinimumTravelTime(const SUMOVehicle *const veh) const
returns the minimum travel time for the given vehicle
Definition: MSEdge.h:405
MSJunction * myToJunction
Definition: MSEdge.h:787
MSLaneChanger * myLaneChanger
This member will do the lane-change.
Definition: MSEdge.h:758
double getRoutingSpeed() const
Returns the averaged speed used by the routing device.
Definition: MSEdge.cpp:781
Boundary myBoundary
The bounding rectangle of end nodes incoming or outgoing edges for taz connectors or of my own start ...
Definition: MSEdge.h:865
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:363
const MSEdge * getNormalBefore() const
if this edge is an internal edge, return its first normal predecessor, otherwise the edge itself ...
Definition: MSEdge.cpp:732
bool myAmFringe
whether this edge is at the network fringe
Definition: MSEdge.h:835
MSLane * getDepartLane(MSVehicle &veh) const
Finds a depart lane for the given vehicle parameters.
Definition: MSEdge.cpp:512
virtual void removePerson(MSTransportable *p) const
Definition: MSEdge.h:599
SUMOTime getLastFailedInsertionTime() const
Returns the last time a vehicle could not be inserted.
Definition: MSEdge.h:495
const MSConstEdgePairVector & getViaSuccessors(SUMOVehicleClass vClass=SVC_IGNORING) const
Returns the following edges with internal vias, restricted by vClass.
Definition: MSEdge.cpp:1018
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:755
bool isCrossing() const
return whether this edge is a pedestrian crossing
Definition: MSEdge.h:230
bool isFringe() const
return whether this edge is at the fringe of the network
Definition: MSEdge.h:653
const MSEdge * myBidiEdge
the oppositing superposble edge
Definition: MSEdge.h:870
bool isInternal() const
return whether this edge is an internal edge
Definition: MSEdge.h:225
An upper class for objects with additional parameters.
Definition: Parameterised.h:44
bool isSuperposable(const MSEdge *other)
Definition: MSEdge.cpp:1126
virtual void removeContainer(MSTransportable *container) const
Remove container from myContainers.
Definition: MSEdge.h:612
bool canChangeToOpposite()
whether this edge allows changing to the opposite direction edge
Definition: MSEdge.cpp:1071
const std::string & getStreetName() const
Returns the street name of the edge.
Definition: MSEdge.h:262
Base class for objects which have an id.
Definition: Named.h:58
const MSEdge * getInternalFollowingEdge(const MSEdge *followerAfterInternal) const
Definition: MSEdge.cpp:701
double getVehicleMaxSpeed(const SUMOVehicle *const veh) const
Returns the maximum speed the vehicle may use on this edge.
Definition: MSEdge.cpp:911
SVCPermissions myCombinedPermissions
The union of lane permissions for this edge.
Definition: MSEdge.h:807
const MSEdgeVector & getSuccessors(SUMOVehicleClass vClass=SVC_IGNORING) const
Returns the following edges, restricted by vClass.
Definition: MSEdge.cpp:981
std::map< const MSEdge *, AllowedLanesCont > AllowedLanesByTarget
Succeeding edges (keys) and allowed lanes to reach these edges (values).
Definition: MSEdge.h:81
void markDelayed() const
Definition: MSEdge.h:627
void buildLaneChanger()
Has to be called after all sucessors and predecessors have been set (after closeBuilding()) ...
Definition: MSEdge.cpp:195
static const Position getStopPosition(const SUMOVehicleParameter::Stop &stop)
return the coordinates of the center of the given stop
Definition: MSEdge.cpp:893
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:524
bool isTazConnector() const
Definition: MSEdge.h:248
std::map< SUMOVehicleClass, MSConstEdgePairVector > myClassesViaSuccessorMap
The successors available for a given vClass.
Definition: MSEdge.h:862
virtual void addContainer(MSTransportable *container) const
Add a container to myContainers.
Definition: MSEdge.h:607
static const MSEdgeVector & getAllEdges()
Returns all edges with a numerical id.
Definition: MSEdge.cpp:821
virtual void changeLanes(SUMOTime t)
Performs lane changing on this edge.
Definition: MSEdge.cpp:691
const MSJunction * getFromJunction() const
Definition: MSEdge.h:343
Definition of vehicle stop (position and duration)
bool myAmRoundabout
whether this edge belongs to a roundabout
Definition: MSEdge.h:832
double myWidth
Edge width [m].
Definition: MSEdge.h:820
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:811
MSJunction * myFromJunction
the junctions for this edge
Definition: MSEdge.h:786
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:718
void setMaxSpeed(double val) const
Sets a new maximum speed for all lanes (used by TraCI and MSCalibrator)
Definition: MSEdge.cpp:918
void setJunctions(MSJunction *from, MSJunction *to)
Definition: MSEdge.cpp:1060
virtual void lock() const
grant exclusive access to the mesoscopic state
Definition: MSEdge.h:663
by_id_sorter()
constructor
Definition: MSEdge.h:723
const int myPriority
the priority of the edge (used during network creation)
Definition: MSEdge.h:817
bool isWalkingArea() const
return whether this edge is walking area
Definition: MSEdge.h:244
std::vector< std::string > myCrossingEdges
The crossed edges id for a crossing edge. On not crossing edges it is empty.
Definition: MSEdge.h:775
static DictType myDict
Static dictionary to associate string-ids with objects.
Definition: MSEdge.h:849
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:64
Sorts transportables by their positions.
Definition: MSEdge.h:735
std::vector< std::pair< SVCPermissions, const std::vector< MSLane * > *> > AllowedLanesCont
"Map" from vehicle class to allowed lanes
Definition: MSEdge.h:78
#define NUMERICAL_EPS
Definition: config.h:148
std::vector< MSEdge * > MSEdgeVector
Definition: MSEdge.h:71
SVCPermissions getPermissions() const
Definition: MSEdge.h:532
void markAsRoundabout()
Definition: MSEdge.h:623
MSEdgeVector myPredecessors
The preceeding edges.
Definition: MSEdge.h:783
std::vector< MSTransportable * > getSortedContainers(SUMOTime timestep, bool includeRiding=false) const
Returns this edge&#39;s containers sorted by pos.
Definition: MSEdge.cpp:947
Representation of a lane in the micro simulation.
Definition: MSLane.h:78
bool allowsLaneChanging() const
Definition: MSEdge.cpp:213
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:369
double myEmptyTraveltime
the traveltime on the empty edge (cached value for speedup)
Definition: MSEdge.h:826
MSLane * getFreeLane(const std::vector< MSLane *> *allowed, const SUMOVehicleClass vclass, double departPos) const
Finds the emptiest lane allowing the vehicle class.
Definition: MSEdge.cpp:436
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:845
SumoXMLEdgeFunc getFunction() const
Returns the edge type (SumoXMLEdgeFunc)
Definition: MSEdge.h:220
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:772
std::set< MSTransportable * > myPersons
Persons on the edge for drawing and pushbutton.
Definition: MSEdge.h:790
void setLastFailedInsertionTime(SUMOTime time) const
Sets the last time a vehicle could not be inserted.
Definition: MSEdge.h:503
double getWidth() const
Returns the edges&#39;s width (sum over all lanes)
Definition: MSEdge.h:539