Eclipse 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-2019 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>
41 #include "MSNet.h"
42 
43 
44 // ===========================================================================
45 // class declarations
46 // ===========================================================================
47 class Boundary;
48 class OutputDevice;
49 class SUMOVehicle;
51 class MSVehicle;
52 class MSLane;
53 class MSLaneChanger;
54 class MSPerson;
55 class MSJunction;
56 class MSEdge;
57 class MSContainer;
58 class MSTransportable;
59 
60 
61 // ===========================================================================
62 // class definitions
63 // ===========================================================================
72 typedef std::vector<MSEdge*> MSEdgeVector;
73 typedef std::vector<const MSEdge*> ConstMSEdgeVector;
74 typedef std::vector<std::pair<const MSEdge*, const MSEdge*> > MSConstEdgePairVector;
75 
76 class MSEdge : public Named, public Parameterised {
77 private:
79  typedef std::vector<std::pair<SVCPermissions, const std::vector<MSLane*>* > > AllowedLanesCont;
80 
82  typedef std::map<const MSEdge*, AllowedLanesCont> AllowedLanesByTarget;
83 
84 
85 public:
97  MSEdge(const std::string& id, int numericalID, const SumoXMLEdgeFunc function,
98  const std::string& streetName, const std::string& edgeType, int priority,
99  double distance);
100 
101 
103  virtual ~MSEdge();
104 
105 
111  void initialize(const std::vector<MSLane*>* lanes);
112 
113 
116  void recalcCache();
117 
118 
120  void closeBuilding();
121 
123  void buildLaneChanger();
124 
125  /* @brief returns whether initizliaing a lane change is permitted on this edge
126  * @note Has to be called after all sucessors and predecessors have been set (after closeBuilding())
127  */
128  bool allowsLaneChanging() const;
129 
132 
139  MSLane* leftLane(const MSLane* const lane) const;
140 
141 
148  MSLane* rightLane(const MSLane* const lane) const;
149 
150 
158  MSLane* parallelLane(const MSLane* const lane, int offset, bool includeOpposite = true) const;
159 
160 
165  inline const std::vector<MSLane*>& getLanes() const {
166  return *myLanes;
167  }
168 
174  inline const std::set<MSTransportable*>& getPersons() const {
175  return myPersons;
176  }
177 
182  std::vector<MSTransportable*> getSortedPersons(SUMOTime timestep, bool includeRiding = false) const;
183 
184 
189  std::vector<MSTransportable*> getSortedContainers(SUMOTime timestep, bool includeRiding = false) const;
190 
199  const std::vector<MSLane*>* allowedLanes(const MSEdge& destination,
200  SUMOVehicleClass vclass = SVC_IGNORING) const;
201 
202 
203 
211  const std::vector<MSLane*>* allowedLanes(SUMOVehicleClass vclass = SVC_IGNORING) const;
213 
214 
215 
218 
223  inline SumoXMLEdgeFunc getFunction() const {
224  return myFunction;
225  }
226 
228  inline bool isNormal() const {
229  return myFunction == EDGEFUNC_NORMAL;
230  }
231 
233  inline bool isInternal() const {
234  return myFunction == EDGEFUNC_INTERNAL;
235  }
236 
238  inline bool isCrossing() const {
239  return myFunction == EDGEFUNC_CROSSING;
240  }
241 
242 
244  void checkAndRegisterBiDirEdge(const std::string& bidiID = "");
245 
247  inline const MSEdge* getBidiEdge() const {
248  return myBidiEdge;
249  }
250 
252  inline bool isWalkingArea() const {
254  }
255 
256  inline bool isTazConnector() const {
257  return myFunction == EDGEFUNC_CONNECTOR;
258  }
259 
263  inline int getNumericalID() const {
264  return myNumericalID;
265  }
266 
267 
270  const std::string& getStreetName() const {
271  return myStreetName;
272  }
273 
276  const std::string& getEdgeType() const {
277  return myEdgeType;
278  }
279 
282  int getPriority() const {
283  return myPriority;
284  }
285 
288  double getDistance() const {
289  return myDistance;
290  }
292 
296  void setCrossingEdges(const std::vector<std::string>& crossingEdges) {
297  myCrossingEdges.clear();
298  myCrossingEdges.insert(myCrossingEdges.begin(), crossingEdges.begin(), crossingEdges.end());
299  }
300 
304  const std::vector<std::string>& getCrossingEdges() const {
305  return myCrossingEdges;
306  }
307 
308 
311 
317  void addSuccessor(MSEdge* edge, const MSEdge* via = nullptr);
318 
322  int getNumSuccessors() const {
323  return (int) mySuccessors.size();
324  }
325 
326 
332 
338 
339 
344  int getNumPredecessors() const {
345  return (int) myPredecessors.size();
346  }
347 
348 
352  const MSEdgeVector& getPredecessors() const {
353  return myPredecessors;
354  }
355 
356 
357  const MSJunction* getFromJunction() const {
358  return myFromJunction;
359  }
360 
361  const MSJunction* getToJunction() const {
362  return myToJunction;
363  }
364 
365 
366  void setJunctions(MSJunction* from, MSJunction* to);
368 
369 
370 
373 
377  bool isVaporizing() const {
378  return myVaporizationRequests > 0;
379  }
380 
381 
392 
393 
405 
406 
415  double getCurrentTravelTime(const double minSpeed = NUMERICAL_EPS) const;
416 
417 
419  inline double getMinimumTravelTime(const SUMOVehicle* const veh) const {
421  return 0;
422  } else if (veh != 0) {
423  return getLength() / getVehicleMaxSpeed(veh) + myTimePenalty;
424  } else {
425  return myEmptyTraveltime;
426  }
427  }
428 
429 
437  static inline double getTravelTimeStatic(const MSEdge* const edge, const SUMOVehicle* const veh, double time) {
438  return MSNet::getInstance()->getTravelTime(edge, veh, time);
439  }
440 
443  double getRoutingSpeed() const;
444 
445 
448 
468  bool insertVehicle(SUMOVehicle& v, SUMOTime time, const bool checkOnly = false, const bool forceCheck = false) const;
469 
470 
490  MSLane* getFreeLane(const std::vector<MSLane*>* allowed, const SUMOVehicleClass vclass, double departPos) const;
491 
492 
503  MSLane* getDepartLane(MSVehicle& veh) const;
504 
505 
511  }
512 
513 
517  inline void setLastFailedInsertionTime(SUMOTime time) const {
519  }
521 
522 
524  virtual void changeLanes(SUMOTime t);
525 
526 
528  const MSEdge* getInternalFollowingEdge(const MSEdge* followerAfterInternal) const;
529 
530 
532  double getInternalFollowingLengthTo(const MSEdge* followerAfterInternal) const;
533 
535  const MSEdge* getNormalBefore() const;
536 
538  inline bool prohibits(const SUMOVehicle* const vehicle) const {
539  if (vehicle == 0) {
540  return false;
541  }
542  const SUMOVehicleClass svc = vehicle->getVClass();
543  return (myCombinedPermissions & svc) != svc;
544  }
545 
547  return myCombinedPermissions;
548  }
549 
553  double getWidth() const {
554  return myWidth;
555  }
556 
558  const std::vector<double> getSubLaneSides() const {
559  return mySublaneSides;
560  }
561 
562  void rebuildAllowedLanes();
563 
564  void rebuildAllowedTargets(const bool updateVehicles = true);
565 
566 
572  double getDistanceTo(const MSEdge* other, const bool doBoundaryEstimate = false) const;
573 
574 
576  static const Position getStopPosition(const SUMOVehicleParameter::Stop& stop);
577 
578 
582  inline double getLength() const {
583  return myLength;
584  }
585 
586 
591  double getSpeedLimit() const;
592 
594  double getLengthGeometryFactor() const;
595 
599  void setMaxSpeed(double val) const;
600 
606  double getVehicleMaxSpeed(const SUMOTrafficObject* const veh) const;
607 
608 
609  virtual void addPerson(MSTransportable* p) const {
610  myPersons.insert(p);
611  }
612 
613  virtual void removePerson(MSTransportable* p) const {
614  std::set<MSTransportable*>::iterator i = myPersons.find(p);
615  if (i != myPersons.end()) {
616  myPersons.erase(i);
617  }
618  }
619 
621  virtual void addContainer(MSTransportable* container) const {
622  myContainers.insert(container);
623  }
624 
626  virtual void removeContainer(MSTransportable* container) const {
627  std::set<MSTransportable*>::iterator i = myContainers.find(container);
628  if (i != myContainers.end()) {
629  myContainers.erase(i);
630  }
631  }
632 
633  inline bool isRoundabout() const {
634  return myAmRoundabout;
635  }
636 
638  myAmRoundabout = true;
639  }
640 
641  void markDelayed() const {
642  myAmDelayed = true;
643  }
644 
645  // return whether there have been vehicles on this edge at least once
646  inline bool isDelayed() const {
647  return myAmDelayed || myBidiEdge == nullptr || myBidiEdge->myAmDelayed;
648  }
649 
650  bool hasLaneChanger() const {
651  return myLaneChanger != 0;
652  }
653 
655  bool canChangeToOpposite();
656 
658  const MSEdge* getOppositeEdge() const;
659 
661  double getMeanSpeed() const;
662 
664  bool hasMinorLink() const;
665 
667  bool isFringe() const {
668  return myAmFringe;
669  }
670 
672  virtual bool isSelected() const {
673  return false;
674  }
675 
677  virtual void lock() const {}
678 
680  virtual void unlock() const {};
681 
685  static bool dictionary(const std::string& id, MSEdge* edge);
686 
688  static MSEdge* dictionary(const std::string& id);
689 
691  static int dictSize();
692 
694  static const MSEdgeVector& getAllEdges();
695 
697  static void clear();
698 
700  static void insertIDs(std::vector<std::string>& into);
701 
702 
703 public:
706 
715  static void parseEdgesList(const std::string& desc, ConstMSEdgeVector& into,
716  const std::string& rid);
717 
718 
725  static void parseEdgesList(const std::vector<std::string>& desc, ConstMSEdgeVector& into,
726  const std::string& rid);
728 
729 
730 protected:
734  class by_id_sorter {
735  public:
737  explicit by_id_sorter() { }
738 
740  int operator()(const MSEdge* const e1, const MSEdge* const e2) const {
741  return e1->getNumericalID() < e2->getNumericalID();
742  }
743 
744  };
745 
750  public:
752  explicit transportable_by_position_sorter(SUMOTime timestep): myTime(timestep) { }
753 
755  int operator()(const MSTransportable* const c1, const MSTransportable* const c2) const;
756  private:
758  };
759 
760 
762  double getDepartPosBound(const MSVehicle& veh, bool upper = true) const;
763 
764 protected:
766  const int myNumericalID;
767 
769  const std::vector<MSLane*>* myLanes;
770 
773 
776 
779 
782 
786  mutable std::set<int> myFailedInsertionMemory;
787 
789  std::vector<std::string> myCrossingEdges;
790 
793 
795 
798 
802 
804  mutable std::set<MSTransportable*> myPersons;
805 
807  mutable std::set<MSTransportable*> myContainers;
808 
811 
814 
817 
823 
825  std::string myStreetName;
826 
828  std::string myEdgeType;
829 
831  const int myPriority;
832 
834  const double myDistance;
835 
837  double myWidth;
838 
840  double myLength;
841 
844 
847 
849  mutable bool myAmDelayed;
850 
853 
856 
858  std::vector<double> mySublaneSides;
859 
862 
864  typedef std::map< std::string, MSEdge* > DictType;
865 
869  static DictType myDict;
870 
876 
877 
879  mutable std::map<SUMOVehicleClass, MSEdgeVector> myClassesSuccessorMap;
880 
882  mutable std::map<SUMOVehicleClass, MSConstEdgePairVector> myClassesViaSuccessorMap;
883 
886 
887 private:
888 
891 
893  MSEdge(const MSEdge&);
894 
896  MSEdge& operator=(const MSEdge&);
897 
898  bool isSuperposable(const MSEdge* other);
899 
900  void addToAllowed(const SVCPermissions permissions, const std::vector<MSLane*>* allowedLanes, AllowedLanesCont& laneCont) const;
901 };
902 
903 
904 #endif
905 
906 /****************************************************************************/
907 
MSEdge::myFromJunction
MSJunction * myFromJunction
the junctions for this edge
Definition: MSEdge.h:800
MSEdge::canChangeToOpposite
bool canChangeToOpposite()
whether this edge allows changing to the opposite direction edge
Definition: MSEdge.cpp:1088
MSEdge::getEdgeType
const std::string & getEdgeType() const
Returns the type of the edge.
Definition: MSEdge.h:276
MSEdge::by_id_sorter
Sorts edges by their ids.
Definition: MSEdge.h:734
MSEdge::getCurrentTravelTime
double getCurrentTravelTime(const double minSpeed=NUMERICAL_EPS) const
Computes and returns the current travel time for this edge.
Definition: MSEdge.cpp:787
Boundary.h
EDGEFUNC_INTERNAL
Definition: SUMOXMLDefinitions.h:1080
MSEdge::isRoundabout
bool isRoundabout() const
Definition: MSEdge.h:633
SUMOTrafficObject
Representation of a vehicle or person.
Definition: SUMOTrafficObject.h:48
MSEdge::isSelected
virtual bool isSelected() const
whether this lane is selected in the GUI
Definition: MSEdge.h:672
MSEdge::AllowedLanesCont
std::vector< std::pair< SVCPermissions, const std::vector< MSLane * > * > > AllowedLanesCont
"Map" from vehicle class to allowed lanes
Definition: MSEdge.h:79
SUMOVehicleClass
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
Definition: SUMOVehicleClass.h:134
MSEdge::getViaSuccessors
const MSConstEdgePairVector & getViaSuccessors(SUMOVehicleClass vClass=SVC_IGNORING) const
Returns the following edges with internal vias, restricted by vClass.
Definition: MSEdge.cpp:1035
MSEdge::hasMinorLink
bool hasMinorLink() const
whether any lane has a minor link
Definition: MSEdge.cpp:1106
MSEdge::by_id_sorter::by_id_sorter
by_id_sorter()
constructor
Definition: MSEdge.h:737
MSEdge::myDict
static DictType myDict
Static dictionary to associate string-ids with objects.
Definition: MSEdge.h:869
MSEdge::getNumPredecessors
int getNumPredecessors() const
Returns the number of edges this edge is connected to.
Definition: MSEdge.h:344
MSEdge::getSuccessors
const MSEdgeVector & getSuccessors(SUMOVehicleClass vClass=SVC_IGNORING) const
Returns the following edges, restricted by vClass.
Definition: MSEdge.cpp:998
MSEdge::getPersons
const std::set< MSTransportable * > & getPersons() const
Returns this edge's persons set.
Definition: MSEdge.h:174
MSConstEdgePairVector
std::vector< std::pair< const MSEdge *, const MSEdge * > > MSConstEdgePairVector
Definition: MSEdge.h:74
MSEdge::getNumericalID
int getNumericalID() const
Returns the numerical id of the edge.
Definition: MSEdge.h:263
MSEdge::getSpeedLimit
double getSpeedLimit() const
Returns the speed limit of the edge @caution The speed limit of the first lane is retured; should pro...
Definition: MSEdge.cpp:916
Parameterised
An upper class for objects with additional parameters.
Definition: Parameterised.h:43
SUMOTime.h
MSNet.h
MSEdge::getStreetName
const std::string & getStreetName() const
Returns the street name of the edge.
Definition: MSEdge.h:270
MSEdge::unlock
virtual void unlock() const
release exclusive access to the mesoscopic state
Definition: MSEdge.h:680
MSLane
Representation of a lane in the micro simulation.
Definition: MSLane.h:83
Named
Base class for objects which have an id.
Definition: Named.h:57
MSEdge::getVehicleMaxSpeed
double getVehicleMaxSpeed(const SUMOTrafficObject *const veh) const
Returns the maximum speed the vehicle may use on this edge.
Definition: MSEdge.cpp:928
MSEdge::isVaporizing
bool isVaporizing() const
Returns whether vehicles on this edge shall be vaporized.
Definition: MSEdge.h:377
MSLaneChanger
Performs lane changing of vehicles.
Definition: MSLaneChanger.h:48
MSEdge::getSortedPersons
std::vector< MSTransportable * > getSortedPersons(SUMOTime timestep, bool includeRiding=false) const
Returns this edge's persons sorted by pos.
Definition: MSEdge.cpp:946
MSJunction
The base class for an intersection.
Definition: MSJunction.h:61
EDGEFUNC_CROSSING
Definition: SUMOXMLDefinitions.h:1078
OutputDevice
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:64
MSEdge::getOppositeEdge
const MSEdge * getOppositeEdge() const
Returns the opposite direction edge if on exists else a nullptr.
Definition: MSEdge.cpp:1096
NUMERICAL_EPS
#define NUMERICAL_EPS
Definition: config.h:145
MSEdge::checkAndRegisterBiDirEdge
void checkAndRegisterBiDirEdge(const std::string &bidiID="")
check and register the opposite superposable edge if any
Definition: MSEdge.cpp:1119
MSEdge::myMinimumPermissions
SVCPermissions myMinimumPermissions
The intersection of lane permissions for this edge.
Definition: MSEdge.h:819
MSEdge::myPredecessors
MSEdgeVector myPredecessors
The preceeding edges.
Definition: MSEdge.h:797
MSEdge::isFringe
bool isFringe() const
return whether this edge is at the fringe of the network
Definition: MSEdge.h:667
MSEdge::myLastFailedInsertionTime
SUMOTime myLastFailedInsertionTime
The time of last insertion failure.
Definition: MSEdge.h:781
MSEdge::myClassesSuccessorMap
std::map< SUMOVehicleClass, MSEdgeVector > myClassesSuccessorMap
The successors available for a given vClass.
Definition: MSEdge.h:879
MSEdge::DictType
std::map< std::string, MSEdge * > DictType
definition of the static dictionary type
Definition: MSEdge.h:864
MSEdge::myToJunction
MSJunction * myToJunction
Definition: MSEdge.h:801
MSEdge::myLaneChanger
MSLaneChanger * myLaneChanger
This member will do the lane-change.
Definition: MSEdge.h:772
MSPerson
Definition: MSPerson.h:64
MSEdge::getDepartPosBound
double getDepartPosBound(const MSVehicle &veh, bool upper=true) const
return upper bound for the depart position on this edge
Definition: MSEdge.cpp:476
MSEdge::myEdges
static MSEdgeVector myEdges
Static list of edges.
Definition: MSEdge.h:874
MSEdge::myLength
double myLength
the length of the edge (cached value for speedup)
Definition: MSEdge.h:840
MSEdge::mySublaneSides
std::vector< double > mySublaneSides
the right side for each sublane on this edge
Definition: MSEdge.h:858
MSEdge::myAmFringe
bool myAmFringe
whether this edge is at the network fringe
Definition: MSEdge.h:855
SUMOTime
long long int SUMOTime
Definition: SUMOTime.h:35
SUMOVehicle
Representation of a vehicle.
Definition: SUMOVehicle.h:61
ConstMSEdgeVector
std::vector< const MSEdge * > ConstMSEdgeVector
Definition: MSEdge.h:73
SumoXMLEdgeFunc
SumoXMLEdgeFunc
Numbers representing special SUMO-XML-attribute values for representing edge functions used in netbui...
Definition: SUMOXMLDefinitions.h:1074
SUMOTrafficObject::getVClass
virtual SUMOVehicleClass getVClass() const =0
Returns the vehicle's access class.
MSEdge::myEdgeType
std::string myEdgeType
the type of the edge (optionally used during network creation)
Definition: MSEdge.h:828
MSEdge::~MSEdge
virtual ~MSEdge()
Destructor.
Definition: MSEdge.cpp:89
MSEdge::recalcCache
void recalcCache()
Recalculates the cached values.
Definition: MSEdge.cpp:129
MSEdge::addPerson
virtual void addPerson(MSTransportable *p) const
Definition: MSEdge.h:609
MSEdge::getPriority
int getPriority() const
Returns the priority of the edge.
Definition: MSEdge.h:282
MSEdge::rebuildAllowedTargets
void rebuildAllowedTargets(const bool updateVehicles=true)
Definition: MSEdge.cpp:302
MSEdge::setJunctions
void setJunctions(MSJunction *from, MSJunction *to)
Definition: MSEdge.cpp:1077
SUMOVehicleParameter
Structure representing possible vehicle parameter.
Definition: SUMOVehicleParameter.h:291
MSEdge::getDistanceTo
double getDistanceTo(const MSEdge *other, const bool doBoundaryEstimate=false) const
optimistic air distance heuristic for use in routing
Definition: MSEdge.cpp:891
MSEdge::closeBuilding
void closeBuilding()
Definition: MSEdge.cpp:166
MSTransportable
Definition: MSTransportable.h:59
MSEdge::hasLaneChanger
bool hasLaneChanger() const
Definition: MSEdge.h:650
MSEdge::getLength
double getLength() const
return the length of the edge
Definition: MSEdge.h:582
MSEdge::decVaporization
SUMOTime decVaporization(SUMOTime t)
Disables vaporization.
Definition: MSEdge.cpp:437
MSEdge::myAmRoundabout
bool myAmRoundabout
whether this edge belongs to a roundabout
Definition: MSEdge.h:852
MSEdge::isNormal
bool isNormal() const
return whether this edge is an internal edge
Definition: MSEdge.h:228
MSEdge::dictSize
static int dictSize()
Returns the number of edges.
Definition: MSEdge.cpp:831
MSEdge::AllowedLanesByTarget
std::map< const MSEdge *, AllowedLanesCont > AllowedLanesByTarget
Succeeding edges (keys) and allowed lanes to reach these edges (values).
Definition: MSEdge.h:82
MSEdge::myNumericalID
const int myNumericalID
This edge's numerical id.
Definition: MSEdge.h:766
MSEdge::isInternal
bool isInternal() const
return whether this edge is an internal edge
Definition: MSEdge.h:233
MSEdge::getWidth
double getWidth() const
Returns the edges's width (sum over all lanes)
Definition: MSEdge.h:553
MSEdge::getLengthGeometryFactor
double getLengthGeometryFactor() const
return shape.length() / myLength
Definition: MSEdge.cpp:923
MSEdge::leftLane
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:373
MSEdge::getFromJunction
const MSJunction * getFromJunction() const
Definition: MSEdge.h:357
SUMOVehicle.h
MSEdge::isCrossing
bool isCrossing() const
return whether this edge is a pedestrian crossing
Definition: MSEdge.h:238
MSEdge::myLanes
const std::vector< MSLane * > * myLanes
Container for the edge's lane; should be sorted: (right-hand-traffic) the more left the lane,...
Definition: MSEdge.h:769
MSEdge::getMeanSpeed
double getMeanSpeed() const
get the mean speed
Definition: MSEdge.cpp:750
SVCPermissions
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
Definition: SUMOVehicleClass.h:219
MSEdge::setLastFailedInsertionTime
void setLastFailedInsertionTime(SUMOTime time) const
Sets the last time a vehicle could not be inserted.
Definition: MSEdge.h:517
MSEdge::getDistance
double getDistance() const
Returns the kilometrage/mileage at the start of the edge.
Definition: MSEdge.h:288
EDGEFUNC_WALKINGAREA
Definition: SUMOXMLDefinitions.h:1079
Parameterised.h
Named.h
MSEdge::isTazConnector
bool isTazConnector() const
Definition: MSEdge.h:256
MSContainer
Definition: MSContainer.h:61
MSEdge::dictionary
static bool dictionary(const std::string &id, MSEdge *edge)
Inserts edge into the static dictionary Returns true if the key id isn't already in the dictionary....
Definition: MSEdge.cpp:804
MSEdge::myCrossingEdges
std::vector< std::string > myCrossingEdges
The crossed edges id for a crossing edge. On not crossing edges it is empty.
Definition: MSEdge.h:789
MSEdge::clear
static void clear()
Clears the dictionary.
Definition: MSEdge.cpp:843
MSEdge::initialize
void initialize(const std::vector< MSLane * > *lanes)
Initialize the edge.
Definition: MSEdge.cpp:108
MSEdge::myBoundary
Boundary myBoundary
The bounding rectangle of end nodes incoming or outgoing edges for taz connectors or of my own start ...
Definition: MSEdge.h:885
SUMOVehicleClass.h
Boundary
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:42
MSEdge::getStopPosition
static const Position getStopPosition(const SUMOVehicleParameter::Stop &stop)
return the coordinates of the center of the given stop
Definition: MSEdge.cpp:910
MSEdge::myViaSuccessors
MSConstEdgePairVector myViaSuccessors
Definition: MSEdge.h:794
MSEdge::getFunction
SumoXMLEdgeFunc getFunction() const
Returns the edge type (SumoXMLEdgeFunc)
Definition: MSEdge.h:223
MSEdge::myAllowedTargets
AllowedLanesByTarget myAllowedTargets
From target edge to lanes allowed to be used to reach it.
Definition: MSEdge.h:816
Position
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
MSEdge::getBidiEdge
const MSEdge * getBidiEdge() const
return opposite superposable/congruent edge, if it exist and 0 else
Definition: MSEdge.h:247
MSEdge::getMinimumTravelTime
double getMinimumTravelTime(const SUMOVehicle *const veh) const
returns the minimum travel time for the given vehicle
Definition: MSEdge.h:419
MSEdge
A road/street connecting two junctions.
Definition: MSEdge.h:76
EDGEFUNC_CONNECTOR
Definition: SUMOXMLDefinitions.h:1077
MSEdge::getToJunction
const MSJunction * getToJunction() const
Definition: MSEdge.h:361
MSEdge::rightLane
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:379
MSEdge::by_id_sorter::operator()
int operator()(const MSEdge *const e1, const MSEdge *const e2) const
comparing operator
Definition: MSEdge.h:740
MSEdge::getInternalFollowingEdge
const MSEdge * getInternalFollowingEdge(const MSEdge *followerAfterInternal) const
Definition: MSEdge.cpp:709
EDGEFUNC_NORMAL
Definition: SUMOXMLDefinitions.h:1076
MSEdge::allowedLanes
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:398
MSEdge::getDepartLane
MSLane * getDepartLane(MSVehicle &veh) const
Finds a depart lane for the given vehicle parameters.
Definition: MSEdge.cpp:520
MSEdge::myDistance
const double myDistance
the kilometrage/mileage at the start of the edge
Definition: MSEdge.h:834
MSEdge::getRoutingSpeed
double getRoutingSpeed() const
Returns the averaged speed used by the routing device.
Definition: MSEdge.cpp:797
MSEdge::myCombinedPermissions
SVCPermissions myCombinedPermissions
The union of lane permissions for this edge.
Definition: MSEdge.h:821
MSEdge::removeContainer
virtual void removeContainer(MSTransportable *container) const
Remove container from myContainers.
Definition: MSEdge.h:626
MSEdge::getInternalFollowingLengthTo
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:726
MSEdge::addToAllowed
void addToAllowed(const SVCPermissions permissions, const std::vector< MSLane * > *allowedLanes, AllowedLanesCont &laneCont) const
Definition: MSEdge.cpp:246
MSEdge::removePerson
virtual void removePerson(MSTransportable *p) const
Definition: MSEdge.h:613
MSEdge::incVaporization
SUMOTime incVaporization(SUMOTime t)
Enables vaporization.
Definition: MSEdge.cpp:430
MSEdge::operator=
MSEdge & operator=(const MSEdge &)
assignment operator.
MSEdge::isWalkingArea
bool isWalkingArea() const
return whether this edge is walking area
Definition: MSEdge.h:252
MSEdge::MSEdge
MSEdge(const std::string &id, int numericalID, const SumoXMLEdgeFunc function, const std::string &streetName, const std::string &edgeType, int priority, double distance)
Constructor.
Definition: MSEdge.cpp:64
MSEdge::markDelayed
void markDelayed() const
Definition: MSEdge.h:641
MSEdge::insertVehicle
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:583
MSEdge::myBidiEdge
const MSEdge * myBidiEdge
the oppositing superposble edge
Definition: MSEdge.h:890
MSNet::getInstance
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
Definition: MSNet.cpp:168
MSEdge::mySuccessors
MSEdgeVector mySuccessors
The succeeding edges.
Definition: MSEdge.h:792
MSEdge::getFreeLane
MSLane * getFreeLane(const std::vector< MSLane * > *allowed, const SUMOVehicleClass vclass, double departPos) const
Finds the emptiest lane allowing the vehicle class.
Definition: MSEdge.cpp:444
MSEdge::transportable_by_position_sorter::transportable_by_position_sorter
transportable_by_position_sorter(SUMOTime timestep)
constructor
Definition: MSEdge.h:752
MSEdge::transportable_by_position_sorter::myTime
SUMOTime myTime
Definition: MSEdge.h:757
MSEdge::allowsLaneChanging
bool allowsLaneChanging() const
Definition: MSEdge.cpp:223
MSEdge::myTimePenalty
double myTimePenalty
flat penalty when computing traveltime
Definition: MSEdge.h:846
MSEdge::transportable_by_position_sorter
Sorts transportables by their positions.
Definition: MSEdge.h:749
MSEdge::setMaxSpeed
void setMaxSpeed(double val) const
Sets a new maximum speed for all lanes (used by TraCI and MSCalibrator)
Definition: MSEdge.cpp:935
MSEdge::getLastFailedInsertionTime
SUMOTime getLastFailedInsertionTime() const
Returns the last time a vehicle could not be inserted.
Definition: MSEdge.h:509
MSEdge::addContainer
virtual void addContainer(MSTransportable *container) const
Add a container to myContainers.
Definition: MSEdge.h:621
MSEdgeVector
std::vector< MSEdge * > MSEdgeVector
Definition: MSEdge.h:72
MSEdge::myPriority
const int myPriority
the priority of the edge (used during network creation)
Definition: MSEdge.h:831
MSEdge::isDelayed
bool isDelayed() const
Definition: MSEdge.h:646
MSEdge::parseEdgesList
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:861
MSEdge::parallelLane
MSLane * parallelLane(const MSLane *const lane, int offset, bool includeOpposite=true) const
Returns the lane with the given offset parallel to the given lane one or 0 if it does not exist.
Definition: MSEdge.cpp:385
MSEdge::myContainers
std::set< MSTransportable * > myContainers
Containers on the edge.
Definition: MSEdge.h:807
MSEdge::getLanes
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
Definition: MSEdge.h:165
MSEdge::insertIDs
static void insertIDs(std::vector< std::string > &into)
Inserts IDs of all known edges into the given vector.
Definition: MSEdge.cpp:853
MSEdge::myAmDelayed
bool myAmDelayed
whether this edge had a vehicle with less than max speed on it
Definition: MSEdge.h:849
MSEdge::changeLanes
virtual void changeLanes(SUMOTime t)
Performs lane changing on this edge.
Definition: MSEdge.cpp:699
MSEdge::getNormalBefore
const MSEdge * getNormalBefore() const
if this edge is an internal edge, return its first normal predecessor, otherwise the edge itself
Definition: MSEdge.cpp:740
MSEdge::getNumSuccessors
int getNumSuccessors() const
Returns the number of edges that may be reached from this edge.
Definition: MSEdge.h:322
config.h
MSEdge::setCrossingEdges
void setCrossingEdges(const std::vector< std::string > &crossingEdges)
Sets the crossed edge ids for a crossing edge.
Definition: MSEdge.h:296
MSEdge::getTravelTimeStatic
static double getTravelTimeStatic(const MSEdge *const edge, const SUMOVehicle *const veh, double time)
Returns the travel time for the given edge.
Definition: MSEdge.h:437
MSEdge::myWidth
double myWidth
Edge width [m].
Definition: MSEdge.h:837
SUMOTrafficObject.h
MSEdge::lock
virtual void lock() const
grant exclusive access to the mesoscopic state
Definition: MSEdge.h:677
MSEdge::prohibits
bool prohibits(const SUMOVehicle *const vehicle) const
Returns whether the vehicle (class) is not allowed on the edge.
Definition: MSEdge.h:538
MSEdge::getPermissions
SVCPermissions getPermissions() const
Definition: MSEdge.h:546
MSEdge::addSuccessor
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:983
MSEdge::transportable_by_position_sorter::operator()
int operator()(const MSTransportable *const c1, const MSTransportable *const c2) const
comparing operator
Definition: MSEdge.cpp:972
SVC_IGNORING
vehicles ignoring classes
Definition: SUMOVehicleClass.h:136
MSEdge::myFailedInsertionMemory
std::set< int > myFailedInsertionMemory
A cache for the rejected insertion attempts. Used to assure that no further insertion attempts are ma...
Definition: MSEdge.h:786
MSEdge::getAllEdges
static const MSEdgeVector & getAllEdges()
Returns all edges with a numerical id.
Definition: MSEdge.cpp:837
MSEdge::myPersons
std::set< MSTransportable * > myPersons
Persons on the edge for drawing and pushbutton.
Definition: MSEdge.h:804
MSEdge::myAllowed
AllowedLanesCont myAllowed
Associative container from vehicle class to allowed-lanes.
Definition: MSEdge.h:813
MSNet::getTravelTime
static double getTravelTime(const MSEdge *const e, const SUMOVehicle *const v, double t)
Returns the travel time to pass an edge.
Definition: MSNet.cpp:151
MSEdge::myClassesViaSuccessorMap
std::map< SUMOVehicleClass, MSConstEdgePairVector > myClassesViaSuccessorMap
The successors available for a given vClass.
Definition: MSEdge.h:882
MSEdge::myVaporizationRequests
int myVaporizationRequests
Vaporizer counter.
Definition: MSEdge.h:778
MSEdge::buildLaneChanger
void buildLaneChanger()
Has to be called after all sucessors and predecessors have been set (after closeBuilding())
Definition: MSEdge.cpp:205
MSEdge::markAsRoundabout
void markAsRoundabout()
Definition: MSEdge.h:637
MSEdge::myEmptyTraveltime
double myEmptyTraveltime
the traveltime on the empty edge (cached value for speedup)
Definition: MSEdge.h:843
MSEdge::getSubLaneSides
const std::vector< double > getSubLaneSides() const
Returns the right side offsets of this edge's sublanes.
Definition: MSEdge.h:558
MSEdge::myStreetName
std::string myStreetName
the real-world name of this edge (need not be unique)
Definition: MSEdge.h:825
MSEdge::rebuildAllowedLanes
void rebuildAllowedLanes()
Definition: MSEdge.cpp:268
SUMOVehicleParameter::Stop
Definition of vehicle stop (position and duration)
Definition: SUMOVehicleParameter.h:566
MSEdge::myFunction
const SumoXMLEdgeFunc myFunction
the purpose of the edge
Definition: MSEdge.h:775
MSEdge::getPredecessors
const MSEdgeVector & getPredecessors() const
Definition: MSEdge.h:352
MSEdge::getCrossingEdges
const std::vector< std::string > & getCrossingEdges() const
Gets the crossed edge ids.
Definition: MSEdge.h:304
MSVehicle
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:80
MSEdge::isSuperposable
bool isSuperposable(const MSEdge *other)
Definition: MSEdge.cpp:1143
MSEdge::getSortedContainers
std::vector< MSTransportable * > getSortedContainers(SUMOTime timestep, bool includeRiding=false) const
Returns this edge's containers sorted by pos.
Definition: MSEdge.cpp:964