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 /****************************************************************************/
18 // A road/street connecting two junctions
19 /****************************************************************************/
20 #ifndef MSEdge_h
21 #define MSEdge_h
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #include <config.h>
28 
29 #include <vector>
30 #include <map>
31 #include <string>
32 #include <iostream>
33 #ifdef HAVE_FOX
34 #include <fx.h>
35 #endif
36 #include <utils/common/Named.h>
38 #include <utils/common/SUMOTime.h>
40 #include <utils/geom/Boundary.h>
43 #include "MSNet.h"
44 
45 
46 // ===========================================================================
47 // class declarations
48 // ===========================================================================
49 class Boundary;
50 class OutputDevice;
51 class SUMOVehicle;
53 class MSVehicle;
54 class MSLane;
55 class MSLaneChanger;
56 class MSPerson;
57 class MSJunction;
58 class MSEdge;
59 class MSContainer;
60 class MSTransportable;
61 
62 
63 // ===========================================================================
64 // class definitions
65 // ===========================================================================
74 typedef std::vector<MSEdge*> MSEdgeVector;
75 typedef std::vector<const MSEdge*> ConstMSEdgeVector;
76 typedef std::vector<std::pair<const MSEdge*, const MSEdge*> > MSConstEdgePairVector;
77 
78 class MSEdge : public Named, public Parameterised {
79 private:
81  typedef std::vector<std::pair<SVCPermissions, std::shared_ptr<const std::vector<MSLane*> > > > AllowedLanesCont;
82 
84  typedef std::map<const MSEdge*, AllowedLanesCont> AllowedLanesByTarget;
85 
86 
87 public:
99  MSEdge(const std::string& id, int numericalID, const SumoXMLEdgeFunc function,
100  const std::string& streetName, const std::string& edgeType, int priority,
101  double distance);
102 
103 
105  virtual ~MSEdge();
106 
107 
113  void initialize(const std::vector<MSLane*>* lanes);
114 
115 
118  void recalcCache();
119 
120 
122  void closeBuilding();
123 
125  void buildLaneChanger();
126 
127  /* @brief returns whether initizliaing a lane change is permitted on this edge
128  * @note Has to be called after all sucessors and predecessors have been set (after closeBuilding())
129  */
130  bool allowsLaneChanging() const;
131 
134 
141  MSLane* leftLane(const MSLane* const lane) const;
142 
143 
150  MSLane* rightLane(const MSLane* const lane) const;
151 
152 
160  MSLane* parallelLane(const MSLane* const lane, int offset, bool includeOpposite = true) const;
161 
162 
167  inline const std::vector<MSLane*>& getLanes() const {
168  return *myLanes;
169  }
170 
176  inline const std::set<MSTransportable*>& getPersons() const {
177  return myPersons;
178  }
179 
184  std::vector<MSTransportable*> getSortedPersons(SUMOTime timestep, bool includeRiding = false) const;
185 
186 
191  std::vector<MSTransportable*> getSortedContainers(SUMOTime timestep, bool includeRiding = false) const;
192 
201  const std::vector<MSLane*>* allowedLanes(const MSEdge& destination,
202  SUMOVehicleClass vclass = SVC_IGNORING) const;
203 
204 
205 
213  const std::vector<MSLane*>* allowedLanes(SUMOVehicleClass vclass = SVC_IGNORING) const;
215 
216 
217 
220 
225  inline SumoXMLEdgeFunc getFunction() const {
226  return myFunction;
227  }
228 
230  inline bool isNormal() const {
231  return myFunction == EDGEFUNC_NORMAL;
232  }
233 
235  inline bool isInternal() const {
236  return myFunction == EDGEFUNC_INTERNAL;
237  }
238 
240  inline bool isCrossing() const {
241  return myFunction == EDGEFUNC_CROSSING;
242  }
243 
244 
246  void checkAndRegisterBiDirEdge(const std::string& bidiID = "");
247 
249  inline const MSEdge* getBidiEdge() const {
250  return myBidiEdge;
251  }
252 
254  inline bool isWalkingArea() const {
256  }
257 
258  inline bool isTazConnector() const {
259  return myFunction == EDGEFUNC_CONNECTOR;
260  }
261 
265  inline int getNumericalID() const {
266  return myNumericalID;
267  }
268 
269 
272  const std::string& getStreetName() const {
273  return myStreetName;
274  }
275 
278  const std::string& getEdgeType() const {
279  return myEdgeType;
280  }
281 
284  int getPriority() const {
285  return myPriority;
286  }
287 
290  double getDistance() const {
291  return myDistance;
292  }
294 
298  void setCrossingEdges(const std::vector<std::string>& crossingEdges) {
299  myCrossingEdges.clear();
300  myCrossingEdges.insert(myCrossingEdges.begin(), crossingEdges.begin(), crossingEdges.end());
301  }
302 
306  const std::vector<std::string>& getCrossingEdges() const {
307  return myCrossingEdges;
308  }
309 
310 
313 
319  void addSuccessor(MSEdge* edge, const MSEdge* via = nullptr);
320 
324  int getNumSuccessors() const {
325  return (int) mySuccessors.size();
326  }
327 
328 
334 
340 
341 
346  int getNumPredecessors() const {
347  return (int) myPredecessors.size();
348  }
349 
350 
354  const MSEdgeVector& getPredecessors() const {
355  return myPredecessors;
356  }
357 
358 
359  const MSJunction* getFromJunction() const {
360  return myFromJunction;
361  }
362 
363  const MSJunction* getToJunction() const {
364  return myToJunction;
365  }
366 
367 
368  void setJunctions(MSJunction* from, MSJunction* to);
370 
371 
372 
375 
379  bool isVaporizing() const {
380  return myVaporizationRequests > 0;
381  }
382 
383 
394 
395 
407 
408 
417  double getCurrentTravelTime(const double minSpeed = NUMERICAL_EPS) const;
418 
419 
421  inline double getMinimumTravelTime(const SUMOVehicle* const veh) const {
423  return 0;
424  } else if (veh != 0) {
425  return getLength() / getVehicleMaxSpeed(veh) + myTimePenalty;
426  } else {
427  return myEmptyTraveltime;
428  }
429  }
430 
431 
439  static inline double getTravelTimeStatic(const MSEdge* const edge, const SUMOVehicle* const veh, double time) {
440  return MSNet::getInstance()->getTravelTime(edge, veh, time);
441  }
442 
445  double getRoutingSpeed() const;
446 
447 
450 
470  bool insertVehicle(SUMOVehicle& v, SUMOTime time, const bool checkOnly = false, const bool forceCheck = false) const;
471 
472 
492  MSLane* getFreeLane(const std::vector<MSLane*>* allowed, const SUMOVehicleClass vclass, double departPos) const;
493 
494 
505  MSLane* getDepartLane(MSVehicle& veh) const;
506 
507 
513  }
514 
515 
519  inline void setLastFailedInsertionTime(SUMOTime time) const {
521  }
523 
524 
526  virtual void changeLanes(SUMOTime t);
527 
528 
530  const MSEdge* getInternalFollowingEdge(const MSEdge* followerAfterInternal) const;
531 
532 
534  double getInternalFollowingLengthTo(const MSEdge* followerAfterInternal) const;
535 
537  const MSEdge* getNormalBefore() const;
538 
540  inline bool prohibits(const SUMOVehicle* const vehicle) const {
541  if (vehicle == 0) {
542  return false;
543  }
544  const SUMOVehicleClass svc = vehicle->getVClass();
545  return (myCombinedPermissions & svc) != svc;
546  }
547 
549  inline bool restricts(const SUMOVehicle* const /* vehicle */) const {
550  return false;
551  }
552 
554  return myCombinedPermissions;
555  }
556 
560  double getWidth() const {
561  return myWidth;
562  }
563 
565  const std::vector<double> getSubLaneSides() const {
566  return mySublaneSides;
567  }
568 
569  void rebuildAllowedLanes();
570 
571  void rebuildAllowedTargets(const bool updateVehicles = true);
572 
573 
579  double getDistanceTo(const MSEdge* other, const bool doBoundaryEstimate = false) const;
580 
581 
583  static const Position getStopPosition(const SUMOVehicleParameter::Stop& stop);
584 
585 
589  inline double getLength() const {
590  return myLength;
591  }
592 
593 
598  double getSpeedLimit() const;
599 
601  double getLengthGeometryFactor() const;
602 
606  void setMaxSpeed(double val) const;
607 
613  double getVehicleMaxSpeed(const SUMOTrafficObject* const veh) const;
614 
615 
616  virtual void addPerson(MSTransportable* p) const {
617  myPersons.insert(p);
618  }
619 
620  virtual void removePerson(MSTransportable* p) const {
621  std::set<MSTransportable*>::iterator i = myPersons.find(p);
622  if (i != myPersons.end()) {
623  myPersons.erase(i);
624  }
625  }
626 
628  virtual void addContainer(MSTransportable* container) const {
629  myContainers.insert(container);
630  }
631 
633  virtual void removeContainer(MSTransportable* container) const {
634  std::set<MSTransportable*>::iterator i = myContainers.find(container);
635  if (i != myContainers.end()) {
636  myContainers.erase(i);
637  }
638  }
639 
640  inline bool isRoundabout() const {
641  return myAmRoundabout;
642  }
643 
645  myAmRoundabout = true;
646  }
647 
648  void markDelayed() const {
649  myAmDelayed = true;
650  }
651 
652  // return whether there have been vehicles on this edge at least once
653  inline bool isDelayed() const {
654  return myAmDelayed || myBidiEdge == nullptr || myBidiEdge->myAmDelayed;
655  }
656 
657  bool hasLaneChanger() const {
658  return myLaneChanger != 0;
659  }
660 
662  bool canChangeToOpposite();
663 
665  const MSEdge* getOppositeEdge() const;
666 
668  double getMeanSpeed() const;
669 
671  bool hasMinorLink() const;
672 
674  bool isFringe() const {
675  return myAmFringe;
676  }
677 
679  virtual bool isSelected() const {
680  return false;
681  }
682 
684  virtual void lock() const {}
685 
687  virtual void unlock() const {};
688 
690  void addWaiting(SUMOVehicle* vehicle) const;
691 
693  void removeWaiting(const SUMOVehicle* vehicle) const;
694 
695  /* @brief returns a vehicle that is waiting for a for a person or a container at this edge at the given position
696  * @param[in] transportable The person or container that wants to ride
697  * @param[in] position The vehicle shall be positioned in the interval [position - t, position + t], where t is some tolerance
698  */
699  SUMOVehicle* getWaitingVehicle(MSTransportable* transportable, const double position) const;
700 
704  static bool dictionary(const std::string& id, MSEdge* edge);
705 
707  static MSEdge* dictionary(const std::string& id);
708 
710  static int dictSize();
711 
713  static const MSEdgeVector& getAllEdges();
714 
716  static void clear();
717 
719  static void insertIDs(std::vector<std::string>& into);
720 
721 
722 public:
725 
734  static void parseEdgesList(const std::string& desc, ConstMSEdgeVector& into,
735  const std::string& rid);
736 
737 
744  static void parseEdgesList(const std::vector<std::string>& desc, ConstMSEdgeVector& into,
745  const std::string& rid);
747 
748 
749 protected:
753  class by_id_sorter {
754  public:
756  explicit by_id_sorter() { }
757 
759  int operator()(const MSEdge* const e1, const MSEdge* const e2) const {
760  return e1->getNumericalID() < e2->getNumericalID();
761  }
762 
763  };
764 
769  public:
771  explicit transportable_by_position_sorter(SUMOTime timestep): myTime(timestep) { }
772 
774  int operator()(const MSTransportable* const c1, const MSTransportable* const c2) const;
775  private:
777  };
778 
779 
781  double getDepartPosBound(const MSVehicle& veh, bool upper = true) const;
782 
783 protected:
785  const int myNumericalID;
786 
788  std::shared_ptr<const std::vector<MSLane*> > myLanes;
789 
792 
795 
798 
801 
805  mutable std::set<int> myFailedInsertionMemory;
806 
808  std::vector<std::string> myCrossingEdges;
809 
812 
814 
817 
821 
823  mutable std::set<MSTransportable*> myPersons;
824 
826  mutable std::set<MSTransportable*> myContainers;
827 
830 
833 
836 
842 
844  std::string myStreetName;
845 
847  std::string myEdgeType;
848 
850  const int myPriority;
851 
853  const double myDistance;
854 
856  double myWidth;
857 
859  double myLength;
860 
863 
866 
868  mutable bool myAmDelayed;
869 
872 
875 
877  std::vector<double> mySublaneSides;
878 
881 
883  typedef std::map< std::string, MSEdge* > DictType;
884 
888  static DictType myDict;
889 
895 
896 
898  mutable std::map<SUMOVehicleClass, MSEdgeVector> myClassesSuccessorMap;
899 
901  mutable std::map<SUMOVehicleClass, MSConstEdgePairVector> myClassesViaSuccessorMap;
902 
905 
907  mutable std::vector<SUMOVehicle*> myWaiting;
908 
909 #ifdef HAVE_FOX
910  mutable FXMutex myWaitingMutex;
912 
914  mutable FXMutex mySuccessorMutex;
915 #endif
916 
917 private:
918 
921 
923  MSEdge(const MSEdge&);
924 
926  MSEdge& operator=(const MSEdge&) = delete;
927 
928  bool isSuperposable(const MSEdge* other);
929 
930  void addToAllowed(const SVCPermissions permissions, std::shared_ptr<const std::vector<MSLane*> > allowedLanes, AllowedLanesCont& laneCont) const;
931 };
932 
933 
934 #endif
935 
936 /****************************************************************************/
937 
MSEdge::myFromJunction
MSJunction * myFromJunction
the junctions for this edge
Definition: MSEdge.h:819
MSEdge::canChangeToOpposite
bool canChangeToOpposite()
whether this edge allows changing to the opposite direction edge
Definition: MSEdge.cpp:1030
MSEdge::getEdgeType
const std::string & getEdgeType() const
Returns the type of the edge.
Definition: MSEdge.h:278
MSEdge::by_id_sorter
Sorts edges by their ids.
Definition: MSEdge.h:753
MSEdge::getCurrentTravelTime
double getCurrentTravelTime(const double minSpeed=NUMERICAL_EPS) const
Computes and returns the current travel time for this edge.
Definition: MSEdge.cpp:749
Boundary.h
EDGEFUNC_INTERNAL
@ EDGEFUNC_INTERNAL
Definition: SUMOXMLDefinitions.h:1085
MSEdge::isRoundabout
bool isRoundabout() const
Definition: MSEdge.h:640
SUMOTrafficObject
Representation of a vehicle or person.
Definition: SUMOTrafficObject.h:47
MSEdge::isSelected
virtual bool isSelected() const
whether this lane is selected in the GUI
Definition: MSEdge.h:679
SUMOVehicleClass
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
Definition: SUMOVehicleClass.h:133
MSEdge::getViaSuccessors
const MSConstEdgePairVector & getViaSuccessors(SUMOVehicleClass vClass=SVC_IGNORING) const
Returns the following edges with internal vias, restricted by vClass.
Definition: MSEdge.cpp:989
MSEdge::hasMinorLink
bool hasMinorLink() const
whether any lane has a minor link
Definition: MSEdge.cpp:1048
MSEdge::by_id_sorter::by_id_sorter
by_id_sorter()
constructor
Definition: MSEdge.h:756
MSEdge::myDict
static DictType myDict
Static dictionary to associate string-ids with objects.
Definition: MSEdge.h:888
MSEdge::getNumPredecessors
int getNumPredecessors() const
Returns the number of edges this edge is connected to.
Definition: MSEdge.h:346
MSEdge::getSuccessors
const MSEdgeVector & getSuccessors(SUMOVehicleClass vClass=SVC_IGNORING) const
Returns the following edges, restricted by vClass.
Definition: MSEdge.cpp:959
MSEdge::getPersons
const std::set< MSTransportable * > & getPersons() const
Returns this edge's persons set.
Definition: MSEdge.h:176
MSConstEdgePairVector
std::vector< std::pair< const MSEdge *, const MSEdge * > > MSConstEdgePairVector
Definition: MSEdge.h:76
MSEdge::getNumericalID
int getNumericalID() const
Returns the numerical id of the edge.
Definition: MSEdge.h:265
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:877
Parameterised
An upper class for objects with additional parameters.
Definition: Parameterised.h:42
SUMOTime.h
MSNet.h
MSEdge::getStreetName
const std::string & getStreetName() const
Returns the street name of the edge.
Definition: MSEdge.h:272
MSEdge::unlock
virtual void unlock() const
release exclusive access to the mesoscopic state
Definition: MSEdge.h:687
MSLane
Representation of a lane in the micro simulation.
Definition: MSLane.h:82
Named
Base class for objects which have an id.
Definition: Named.h:56
MSEdge::getVehicleMaxSpeed
double getVehicleMaxSpeed(const SUMOTrafficObject *const veh) const
Returns the maximum speed the vehicle may use on this edge.
Definition: MSEdge.cpp:889
MSEdge::isVaporizing
bool isVaporizing() const
Returns whether vehicles on this edge shall be vaporized.
Definition: MSEdge.h:379
MSEdge::addWaiting
void addWaiting(SUMOVehicle *vehicle) const
Adds a vehicle to the list of waiting vehicles.
Definition: MSEdge.cpp:1106
MSLaneChanger
Performs lane changing of vehicles.
Definition: MSLaneChanger.h:47
MSEdge::getSortedPersons
std::vector< MSTransportable * > getSortedPersons(SUMOTime timestep, bool includeRiding=false) const
Returns this edge's persons sorted by pos.
Definition: MSEdge.cpp:907
MSJunction
The base class for an intersection.
Definition: MSJunction.h:60
EDGEFUNC_CROSSING
@ EDGEFUNC_CROSSING
Definition: SUMOXMLDefinitions.h:1083
OutputDevice
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:63
MSEdge::getOppositeEdge
const MSEdge * getOppositeEdge() const
Returns the opposite direction edge if on exists else a nullptr.
Definition: MSEdge.cpp:1038
NUMERICAL_EPS
#define NUMERICAL_EPS
Definition: config.h:148
MSEdge::checkAndRegisterBiDirEdge
void checkAndRegisterBiDirEdge(const std::string &bidiID="")
check and register the opposite superposable edge if any
Definition: MSEdge.cpp:1062
MSEdge::myMinimumPermissions
SVCPermissions myMinimumPermissions
The intersection of lane permissions for this edge.
Definition: MSEdge.h:838
MSEdge::myPredecessors
MSEdgeVector myPredecessors
The preceeding edges.
Definition: MSEdge.h:816
MSEdge::isFringe
bool isFringe() const
return whether this edge is at the fringe of the network
Definition: MSEdge.h:674
MSEdge::myLastFailedInsertionTime
SUMOTime myLastFailedInsertionTime
The time of last insertion failure.
Definition: MSEdge.h:800
MSEdge::myClassesSuccessorMap
std::map< SUMOVehicleClass, MSEdgeVector > myClassesSuccessorMap
The successors available for a given vClass.
Definition: MSEdge.h:898
MSEdge::DictType
std::map< std::string, MSEdge * > DictType
definition of the static dictionary type
Definition: MSEdge.h:883
MSEdge::myToJunction
MSJunction * myToJunction
Definition: MSEdge.h:820
MSEdge::myLaneChanger
MSLaneChanger * myLaneChanger
This member will do the lane-change.
Definition: MSEdge.h:791
MSPerson
Definition: MSPerson.h:63
MSEdge::getDepartPosBound
double getDepartPosBound(const MSVehicle &veh, bool upper=true) const
return upper bound for the depart position on this edge
Definition: MSEdge.cpp:437
MSEdge::myEdges
static MSEdgeVector myEdges
Static list of edges.
Definition: MSEdge.h:893
MSEdge::myLength
double myLength
the length of the edge (cached value for speedup)
Definition: MSEdge.h:859
MSEdge::mySublaneSides
std::vector< double > mySublaneSides
the right side for each sublane on this edge
Definition: MSEdge.h:877
MSEdge::myAmFringe
bool myAmFringe
whether this edge is at the network fringe
Definition: MSEdge.h:874
SUMOTime
long long int SUMOTime
Definition: SUMOTime.h:34
SUMOVehicle
Representation of a vehicle.
Definition: SUMOVehicle.h:60
ConstMSEdgeVector
std::vector< const MSEdge * > ConstMSEdgeVector
Definition: MSEdge.h:75
SumoXMLEdgeFunc
SumoXMLEdgeFunc
Numbers representing special SUMO-XML-attribute values for representing edge functions used in netbui...
Definition: SUMOXMLDefinitions.h:1079
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:847
MSEdge::~MSEdge
virtual ~MSEdge()
Destructor.
Definition: MSEdge.cpp:88
MSEdge::recalcCache
void recalcCache()
Recalculates the cached values.
Definition: MSEdge.cpp:111
MSEdge::addPerson
virtual void addPerson(MSTransportable *p) const
Definition: MSEdge.h:616
MSEdge::getPriority
int getPriority() const
Returns the priority of the edge.
Definition: MSEdge.h:284
MSEdge::AllowedLanesCont
std::vector< std::pair< SVCPermissions, std::shared_ptr< const std::vector< MSLane * > > > > AllowedLanesCont
"Map" from vehicle class to allowed lanes
Definition: MSEdge.h:81
MSEdge::rebuildAllowedTargets
void rebuildAllowedTargets(const bool updateVehicles=true)
Definition: MSEdge.cpp:272
MSEdge::setJunctions
void setJunctions(MSJunction *from, MSJunction *to)
Definition: MSEdge.cpp:1019
SUMOVehicleParameter
Structure representing possible vehicle parameter.
Definition: SUMOVehicleParameter.h:297
MSEdge::MSEdge
MSEdge(const MSEdge &)
Invalidated copy constructor.
MSEdge::getDistanceTo
double getDistanceTo(const MSEdge *other, const bool doBoundaryEstimate=false) const
optimistic air distance heuristic for use in routing
Definition: MSEdge.cpp:852
MSEdge::closeBuilding
void closeBuilding()
Definition: MSEdge.cpp:148
MSTransportable
Definition: MSTransportable.h:58
MSEdge::hasLaneChanger
bool hasLaneChanger() const
Definition: MSEdge.h:657
MSEdge::getLength
double getLength() const
return the length of the edge
Definition: MSEdge.h:589
MSEdge::decVaporization
SUMOTime decVaporization(SUMOTime t)
Disables vaporization.
Definition: MSEdge.cpp:398
MSEdge::myAmRoundabout
bool myAmRoundabout
whether this edge belongs to a roundabout
Definition: MSEdge.h:871
MSEdge::isNormal
bool isNormal() const
return whether this edge is an internal edge
Definition: MSEdge.h:230
MSEdge::dictSize
static int dictSize()
Returns the number of edges.
Definition: MSEdge.cpp:792
MSEdge::AllowedLanesByTarget
std::map< const MSEdge *, AllowedLanesCont > AllowedLanesByTarget
Succeeding edges (keys) and allowed lanes to reach these edges (values).
Definition: MSEdge.h:84
MSEdge::myNumericalID
const int myNumericalID
This edge's numerical id.
Definition: MSEdge.h:785
MSEdge::myLanes
std::shared_ptr< 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:788
MSEdge::isInternal
bool isInternal() const
return whether this edge is an internal edge
Definition: MSEdge.h:235
MSEdge::getWidth
double getWidth() const
Returns the edges's width (sum over all lanes)
Definition: MSEdge.h:560
MSEdge::getLengthGeometryFactor
double getLengthGeometryFactor() const
return shape.length() / myLength
Definition: MSEdge.cpp:884
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:334
MSEdge::getFromJunction
const MSJunction * getFromJunction() const
Definition: MSEdge.h:359
SUMOVehicle.h
MSEdge::restricts
bool restricts(const SUMOVehicle *const) const
Returns whether the vehicle (class) is not allowed on the edge.
Definition: MSEdge.h:549
MSEdge::isCrossing
bool isCrossing() const
return whether this edge is a pedestrian crossing
Definition: MSEdge.h:240
MSEdge::getMeanSpeed
double getMeanSpeed() const
get the mean speed
Definition: MSEdge.cpp:712
SVCPermissions
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
Definition: SUMOVehicleClass.h:218
MSEdge::setLastFailedInsertionTime
void setLastFailedInsertionTime(SUMOTime time) const
Sets the last time a vehicle could not be inserted.
Definition: MSEdge.h:519
MSEdge::getDistance
double getDistance() const
Returns the kilometrage/mileage at the start of the edge.
Definition: MSEdge.h:290
EDGEFUNC_WALKINGAREA
@ EDGEFUNC_WALKINGAREA
Definition: SUMOXMLDefinitions.h:1084
Parameterised.h
Named.h
MSEdge::isTazConnector
bool isTazConnector() const
Definition: MSEdge.h:258
MSContainer
Definition: MSContainer.h:60
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:765
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:808
MSEdge::clear
static void clear()
Clears the dictionary.
Definition: MSEdge.cpp:804
MSEdge::initialize
void initialize(const std::vector< MSLane * > *lanes)
Initialize the edge.
Definition: MSEdge.cpp:94
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:904
SUMOVehicleClass.h
Boundary
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:41
MSEdge::getStopPosition
static const Position getStopPosition(const SUMOVehicleParameter::Stop &stop)
return the coordinates of the center of the given stop
Definition: MSEdge.cpp:871
MSEdge::myViaSuccessors
MSConstEdgePairVector myViaSuccessors
Definition: MSEdge.h:813
MSEdge::getFunction
SumoXMLEdgeFunc getFunction() const
Returns the edge type (SumoXMLEdgeFunc)
Definition: MSEdge.h:225
MSEdge::myWaiting
std::vector< SUMOVehicle * > myWaiting
List of waiting vehicles.
Definition: MSEdge.h:907
MSEdge::myAllowedTargets
AllowedLanesByTarget myAllowedTargets
From target edge to lanes allowed to be used to reach it.
Definition: MSEdge.h:835
Position
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:38
MSEdge::getBidiEdge
const MSEdge * getBidiEdge() const
return opposite superposable/congruent edge, if it exist and 0 else
Definition: MSEdge.h:249
MSEdge::getMinimumTravelTime
double getMinimumTravelTime(const SUMOVehicle *const veh) const
returns the minimum travel time for the given vehicle
Definition: MSEdge.h:421
MSEdge
A road/street connecting two junctions.
Definition: MSEdge.h:78
EDGEFUNC_CONNECTOR
@ EDGEFUNC_CONNECTOR
Definition: SUMOXMLDefinitions.h:1082
MSEdge::getWaitingVehicle
SUMOVehicle * getWaitingVehicle(MSTransportable *transportable, const double position) const
Definition: MSEdge.cpp:1127
MSEdge::getToJunction
const MSJunction * getToJunction() const
Definition: MSEdge.h:363
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:340
MSEdge::by_id_sorter::operator()
int operator()(const MSEdge *const e1, const MSEdge *const e2) const
comparing operator
Definition: MSEdge.h:759
MSEdge::getInternalFollowingEdge
const MSEdge * getInternalFollowingEdge(const MSEdge *followerAfterInternal) const
Definition: MSEdge.cpp:669
EDGEFUNC_NORMAL
@ EDGEFUNC_NORMAL
Definition: SUMOXMLDefinitions.h:1081
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:359
MSEdge::getDepartLane
MSLane * getDepartLane(MSVehicle &veh) const
Finds a depart lane for the given vehicle parameters.
Definition: MSEdge.cpp:481
MSEdge::myDistance
const double myDistance
the kilometrage/mileage at the start of the edge
Definition: MSEdge.h:853
MSEdge::getRoutingSpeed
double getRoutingSpeed() const
Returns the averaged speed used by the routing device.
Definition: MSEdge.cpp:759
MSEdge::myCombinedPermissions
SVCPermissions myCombinedPermissions
The union of lane permissions for this edge.
Definition: MSEdge.h:840
MSEdge::removeContainer
virtual void removeContainer(MSTransportable *container) const
Remove container from myContainers.
Definition: MSEdge.h:633
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:687
MSEdge::removePerson
virtual void removePerson(MSTransportable *p) const
Definition: MSEdge.h:620
MSEdge::incVaporization
SUMOTime incVaporization(SUMOTime t)
Enables vaporization.
Definition: MSEdge.cpp:391
MSEdge::operator=
MSEdge & operator=(const MSEdge &)=delete
assignment operator.
MSEdge::isWalkingArea
bool isWalkingArea() const
return whether this edge is walking area
Definition: MSEdge.h:254
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:63
MSEdge::markDelayed
void markDelayed() const
Definition: MSEdge.h:648
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:544
MSEdge::myBidiEdge
const MSEdge * myBidiEdge
the oppositing superposable edge
Definition: MSEdge.h:920
MSNet::getInstance
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
Definition: MSNet.cpp:167
MSEdge::mySuccessors
MSEdgeVector mySuccessors
The succeeding edges.
Definition: MSEdge.h:811
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:405
MSEdge::transportable_by_position_sorter::transportable_by_position_sorter
transportable_by_position_sorter(SUMOTime timestep)
constructor
Definition: MSEdge.h:771
MSEdge::transportable_by_position_sorter::myTime
SUMOTime myTime
Definition: MSEdge.h:776
MSEdge::allowsLaneChanging
bool allowsLaneChanging() const
Definition: MSEdge.cpp:205
MSEdge::myTimePenalty
double myTimePenalty
flat penalty when computing traveltime
Definition: MSEdge.h:865
MSEdge::transportable_by_position_sorter
Sorts transportables by their positions.
Definition: MSEdge.h:768
MSEdge::setMaxSpeed
void setMaxSpeed(double val) const
Sets a new maximum speed for all lanes (used by TraCI and MSCalibrator)
Definition: MSEdge.cpp:896
MSEdge::addToAllowed
void addToAllowed(const SVCPermissions permissions, std::shared_ptr< const std::vector< MSLane * > > allowedLanes, AllowedLanesCont &laneCont) const
Definition: MSEdge.cpp:228
SVCAll
const SVCPermissions SVCAll
all VClasses are allowed
Definition: SUMOVehicleClass.cpp:146
MSEdge::getLastFailedInsertionTime
SUMOTime getLastFailedInsertionTime() const
Returns the last time a vehicle could not be inserted.
Definition: MSEdge.h:511
MSEdge::addContainer
virtual void addContainer(MSTransportable *container) const
Add a container to myContainers.
Definition: MSEdge.h:628
MSEdgeVector
std::vector< MSEdge * > MSEdgeVector
Definition: MSEdge.h:74
MSEdge::myPriority
const int myPriority
the priority of the edge (used during network creation)
Definition: MSEdge.h:850
MSEdge::isDelayed
bool isDelayed() const
Definition: MSEdge.h:653
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:822
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:346
MSEdge::myContainers
std::set< MSTransportable * > myContainers
Containers on the edge.
Definition: MSEdge.h:826
MSEdge::getLanes
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
Definition: MSEdge.h:167
MSEdge::insertIDs
static void insertIDs(std::vector< std::string > &into)
Inserts IDs of all known edges into the given vector.
Definition: MSEdge.cpp:814
MSEdge::myAmDelayed
bool myAmDelayed
whether this edge had a vehicle with less than max speed on it
Definition: MSEdge.h:868
MSEdge::changeLanes
virtual void changeLanes(SUMOTime t)
Performs lane changing on this edge.
Definition: MSEdge.cpp:660
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:702
MSEdge::getNumSuccessors
int getNumSuccessors() const
Returns the number of edges that may be reached from this edge.
Definition: MSEdge.h:324
config.h
MSEdge::setCrossingEdges
void setCrossingEdges(const std::vector< std::string > &crossingEdges)
Sets the crossed edge ids for a crossing edge.
Definition: MSEdge.h:298
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:439
MSEdge::myWidth
double myWidth
Edge width [m].
Definition: MSEdge.h:856
SUMOTrafficObject.h
MSEdge::lock
virtual void lock() const
grant exclusive access to the mesoscopic state
Definition: MSEdge.h:684
MSEdge::prohibits
bool prohibits(const SUMOVehicle *const vehicle) const
Returns whether the vehicle (class) is not allowed on the edge.
Definition: MSEdge.h:540
MSEdge::removeWaiting
void removeWaiting(const SUMOVehicle *vehicle) const
Removes a vehicle from the list of waiting vehicles.
Definition: MSEdge.cpp:1115
MSEdge::getPermissions
SVCPermissions getPermissions() const
Definition: MSEdge.h:553
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:944
MSEdge::transportable_by_position_sorter::operator()
int operator()(const MSTransportable *const c1, const MSTransportable *const c2) const
comparing operator
Definition: MSEdge.cpp:933
SVC_IGNORING
@ SVC_IGNORING
vehicles ignoring classes
Definition: SUMOVehicleClass.h:135
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:805
MSEdge::getAllEdges
static const MSEdgeVector & getAllEdges()
Returns all edges with a numerical id.
Definition: MSEdge.cpp:798
MSEdge::myPersons
std::set< MSTransportable * > myPersons
Persons on the edge for drawing and pushbutton.
Definition: MSEdge.h:823
MSEdge::myAllowed
AllowedLanesCont myAllowed
Associative container from vehicle class to allowed-lanes.
Definition: MSEdge.h:832
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:150
MSEdge::myClassesViaSuccessorMap
std::map< SUMOVehicleClass, MSConstEdgePairVector > myClassesViaSuccessorMap
The successors available for a given vClass.
Definition: MSEdge.h:901
MSEdge::myVaporizationRequests
int myVaporizationRequests
Vaporizer counter.
Definition: MSEdge.h:797
MSEdge::buildLaneChanger
void buildLaneChanger()
Has to be called after all sucessors and predecessors have been set (after closeBuilding())
Definition: MSEdge.cpp:187
MSEdge::markAsRoundabout
void markAsRoundabout()
Definition: MSEdge.h:644
MSEdge::myEmptyTraveltime
double myEmptyTraveltime
the traveltime on the empty edge (cached value for speedup)
Definition: MSEdge.h:862
MSEdge::getSubLaneSides
const std::vector< double > getSubLaneSides() const
Returns the right side offsets of this edge's sublanes.
Definition: MSEdge.h:565
MSEdge::myStreetName
std::string myStreetName
the real-world name of this edge (need not be unique)
Definition: MSEdge.h:844
MSEdge::rebuildAllowedLanes
void rebuildAllowedLanes()
Definition: MSEdge.cpp:243
SUMOVehicleParameter::Stop
Definition of vehicle stop (position and duration)
Definition: SUMOVehicleParameter.h:572
MSEdge::myFunction
const SumoXMLEdgeFunc myFunction
the purpose of the edge
Definition: MSEdge.h:794
MSEdge::getPredecessors
const MSEdgeVector & getPredecessors() const
Definition: MSEdge.h:354
MSEdge::getCrossingEdges
const std::vector< std::string > & getCrossingEdges() const
Gets the crossed edge ids.
Definition: MSEdge.h:306
MSVehicle
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:79
MSEdge::isSuperposable
bool isSuperposable(const MSEdge *other)
Definition: MSEdge.cpp:1087
MSEdge::getSortedContainers
std::vector< MSTransportable * > getSortedContainers(SUMOTime timestep, bool includeRiding=false) const
Returns this edge's containers sorted by pos.
Definition: MSEdge.cpp:925