SUMO - Simulation of Urban MObility
MSEdge.h
Go to the documentation of this file.
1 /****************************************************************************/
11 // A road/street connecting two junctions
12 /****************************************************************************/
13 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
14 // Copyright (C) 2001-2017 DLR (http://www.dlr.de/) and contributors
15 /****************************************************************************/
16 //
17 // This file is part of SUMO.
18 // SUMO is free software: you can redistribute it and/or modify
19 // it under the terms of the GNU General Public License as published by
20 // the Free Software Foundation, either version 3 of the License, or
21 // (at your option) any later version.
22 //
23 /****************************************************************************/
24 #ifndef MSEdge_h
25 #define MSEdge_h
26 
27 
28 // ===========================================================================
29 // included modules
30 // ===========================================================================
31 #ifdef _MSC_VER
32 #include <windows_config.h>
33 #else
34 #include <config.h>
35 #endif
36 
37 #include <vector>
38 #include <map>
39 #include <string>
40 #include <iostream>
41 #include <utils/common/Named.h>
43 #include <utils/common/SUMOTime.h>
48 #include "MSNet.h"
49 #include "MSVehicleType.h"
50 
51 
52 // ===========================================================================
53 // class declarations
54 // ===========================================================================
55 class MSLaneChanger;
56 class OutputDevice;
57 class SUMOVehicle;
59 class MSVehicle;
60 class MSLane;
61 class MSPerson;
62 class MSJunction;
63 class MSEdge;
64 class MSContainer;
65 
66 // ===========================================================================
67 // class definitions
68 // ===========================================================================
77 typedef std::vector<MSEdge*> MSEdgeVector;
78 typedef std::vector<const MSEdge*> ConstMSEdgeVector;
79 
80 class MSEdge : public Named, public Parameterised {
81 public:
104  };
105 
106 
108  typedef std::map< const MSEdge*, std::vector<MSLane*>* > AllowedLanesCont;
109 
111  typedef std::map< SUMOVehicleClass, AllowedLanesCont > ClassedAllowedLanesCont;
112 
113 
114 public:
126  MSEdge(const std::string& id, int numericalID, const EdgeBasicFunction function,
127  const std::string& streetName, const std::string& edgeType, int priority);
128 
129 
131  virtual ~MSEdge();
132 
133 
139  void initialize(const std::vector<MSLane*>* lanes);
140 
141 
144  void recalcCache();
145 
146 
148  void closeBuilding();
149 
151  void buildLaneChanger();
152 
153  /* @brief returns whether initizliaing a lane change is permitted on this edge
154  * @note Has to be called after all sucessors and predecessors have been set (after closeBuilding())
155  */
156  bool allowsLaneChanging();
157 
160 
167  MSLane* leftLane(const MSLane* const lane) const;
168 
169 
176  MSLane* rightLane(const MSLane* const lane) const;
177 
178 
185  MSLane* parallelLane(const MSLane* const lane, int offset) const;
186 
187 
192  const std::vector<MSLane*>& getLanes() const {
193  return *myLanes;
194  }
195 
201  inline const std::set<MSTransportable*>& getPersons() const {
202  return myPersons;
203  }
204 
209  std::vector<MSTransportable*> getSortedPersons(SUMOTime timestep, bool includeRiding = false) const;
210 
211 
216  std::vector<MSTransportable*> getSortedContainers(SUMOTime timestep, bool includeRiding = false) const;
217 
226  const std::vector<MSLane*>* allowedLanes(const MSEdge& destination,
227  SUMOVehicleClass vclass = SVC_IGNORING) const;
228 
229 
237  const std::vector<MSLane*>* allowedLanes(SUMOVehicleClass vclass = SVC_IGNORING) const;
239 
240 
241 
244 
250  return myFunction;
251  }
252 
254  inline bool isInternal() const {
256  }
257 
259  inline bool isCrossing() const {
261  }
262 
264  inline bool isWalkingArea() const {
266  }
267 
268  inline bool isTaz() const {
270  }
271 
275  inline int getNumericalID() const {
276  return myNumericalID;
277  }
278 
279 
282  const std::string& getStreetName() const {
283  return myStreetName;
284  }
285 
288  const std::string& getEdgeType() const {
289  return myEdgeType;
290  }
291 
294  int getPriority() const {
295  return myPriority;
296  }
298 
302  void setCrossingEdges(const std::vector<std::string>& crossingEdges) {
303  myCrossingEdges.clear();
304  myCrossingEdges.insert(myCrossingEdges.begin(), crossingEdges.begin(), crossingEdges.end());
305  }
306 
310  const std::vector<std::string>& getCrossingEdges() const {
311  return myCrossingEdges;
312  }
313 
314 
317 
323  void addSuccessor(MSEdge* edge) {
324  mySuccessors.push_back(edge);
325  edge->myPredecessors.push_back(this);
326  }
327 
328 
332  int getNumSuccessors() const {
333  return (int) mySuccessors.size();
334  }
335 
336 
339  const MSEdgeVector& getSuccessors() const {
340  return mySuccessors;
341  }
342 
343 
348  const MSEdgeVector& getSuccessors(SUMOVehicleClass vClass) const;
349 
350 
355  int getNumPredecessors() const {
356  return (int) myPredecessors.size();
357  }
358 
359 
363  const MSEdgeVector& getPredecessors() const {
364  return myPredecessors;
365  }
366 
367 
368  const MSJunction* getFromJunction() const {
369  return myFromJunction;
370  }
371 
372  const MSJunction* getToJunction() const {
373  return myToJunction;
374  }
375 
376 
377  void setJunctions(MSJunction* from, MSJunction* to) {
378  myFromJunction = from;
379  myToJunction = to;
380  }
382 
383 
384 
387 
391  bool isVaporizing() const {
392  return myVaporizationRequests > 0;
393  }
394 
395 
406 
407 
419 
420 
429  double getCurrentTravelTime(const double minSpeed = NUMERICAL_EPS) const;
430 
431 
433  inline double getMinimumTravelTime(const SUMOVehicle* const veh) const {
435  return 0;
436  } else if (veh != 0) {
437  return getLength() / getVehicleMaxSpeed(veh);
438  } else {
439  return getLength() / getSpeedLimit();
440  }
441  }
442 
443 
451  static inline double getTravelTimeStatic(const MSEdge* const edge, const SUMOVehicle* const veh, double time) {
452  return MSNet::getInstance()->getTravelTime(edge, veh, time);
453  }
454 
457  double getRoutingSpeed() const;
458 
459 
462 
482  bool insertVehicle(SUMOVehicle& v, SUMOTime time, const bool checkOnly = false, const bool forceCheck = false) const;
483 
484 
504  MSLane* getFreeLane(const std::vector<MSLane*>* allowed, const SUMOVehicleClass vclass, double departPos) const;
505 
506 
517  MSLane* getDepartLane(MSVehicle& veh) const;
518 
519 
525  }
526 
527 
531  inline void setLastFailedInsertionTime(SUMOTime time) const {
533  }
535 
536 
538  virtual void changeLanes(SUMOTime t);
539 
540 
542  const MSEdge* getInternalFollowingEdge(const MSEdge* followerAfterInternal) const;
543 
544 
546  double getInternalFollowingLengthTo(const MSEdge* followerAfterInternal) const;
547 
549  inline bool prohibits(const SUMOVehicle* const vehicle) const {
550  if (vehicle == 0) {
551  return false;
552  }
553  const SUMOVehicleClass svc = vehicle->getVehicleType().getVehicleClass();
554  return (myCombinedPermissions & svc) != svc;
555  }
556 
558  return myCombinedPermissions;
559  }
560 
564  double getWidth() const {
565  return myWidth;
566  }
567 
569  const std::vector<double> getSubLaneSides() const {
570  return mySublaneSides;
571  }
572 
573  void rebuildAllowedLanes();
574 
575 
580  double getDistanceTo(const MSEdge* other) const;
581 
582 
586  inline double getLength() const {
587  return myLength;
588  }
589 
590 
595  double getSpeedLimit() const;
596 
598  double getLengthGeometryFactor() const;
599 
603  void setMaxSpeed(double val) const;
604 
610  double getVehicleMaxSpeed(const SUMOVehicle* const veh) const;
611 
612  virtual void addPerson(MSTransportable* p) const {
613  myPersons.insert(p);
614  }
615 
616  virtual void removePerson(MSTransportable* p) const {
617  std::set<MSTransportable*>::iterator i = myPersons.find(p);
618  if (i != myPersons.end()) {
619  myPersons.erase(i);
620  }
621  }
622 
624  virtual void addContainer(MSTransportable* container) const {
625  myContainers.insert(container);
626  }
627 
629  virtual void removeContainer(MSTransportable* container) const {
630  std::set<MSTransportable*>::iterator i = myContainers.find(container);
631  if (i != myContainers.end()) {
632  myContainers.erase(i);
633  }
634  }
635 
636  inline bool isRoundabout() const {
637  return myAmRoundabout;
638  }
639 
641  myAmRoundabout = true;
642  }
643 
644  void markDelayed() const {
645  myAmDelayed = true;
646  }
647 
648  bool hasLaneChanger() const {
649  return myLaneChanger != 0;
650  }
651 
653  bool canChangeToOpposite();
654 
656  double getMeanSpeed() const;
657 
659  bool hasMinorLink() const;
660 
662  virtual void lock() const {}
663 
665  virtual void unlock() const {};
666 
670  static bool dictionary(const std::string& id, MSEdge* edge);
671 
673  static MSEdge* dictionary(const std::string& id);
674 
676  static int dictSize();
677 
679  static const MSEdgeVector& getAllEdges();
680 
682  static void clear();
683 
685  static void insertIDs(std::vector<std::string>& into);
686 
687 
688 public:
691 
700  static void parseEdgesList(const std::string& desc, ConstMSEdgeVector& into,
701  const std::string& rid);
702 
703 
710  static void parseEdgesList(const std::vector<std::string>& desc, ConstMSEdgeVector& into,
711  const std::string& rid);
713 
714 
715 protected:
719  class by_id_sorter {
720  public:
722  explicit by_id_sorter() { }
723 
725  int operator()(const MSEdge* const e1, const MSEdge* const e2) const {
726  return e1->getID() < e2->getID();
727  }
728 
729  };
730 
735  public:
737  explicit transportable_by_position_sorter(SUMOTime timestep): myTime(timestep) { }
738 
740  int operator()(const MSTransportable* const c1, const MSTransportable* const c2) const;
741  private:
743  };
744 
745 
754  const std::vector<MSLane*>* allowedLanes(const MSEdge* destination,
755  SUMOVehicleClass vclass = SVC_IGNORING) const;
756 
757 
759  const std::vector<MSLane*>* getAllowedLanesWithDefault(const AllowedLanesCont& c, const MSEdge* dest) const;
760 
761 
763  double getDepartPosBound(const MSVehicle& veh, bool upper = true) const;
764 
765 protected:
767  const int myNumericalID;
768 
770  const std::vector<MSLane*>* myLanes;
771 
774 
777 
780 
783 
787  mutable std::set<int> myFailedInsertionMemory;
788 
790  std::vector<std::string> myCrossingEdges;
791 
794 
797 
801 
803  mutable std::set<MSTransportable*> myPersons;
804 
806  mutable std::set<MSTransportable*> myContainers;
807 
810 
812  AllowedLanesCont myAllowed;
813 
815  // @note: this map is filled on demand
816  mutable ClassedAllowedLanesCont myClassedAllowed;
817 
823 
825  std::string myStreetName;
826 
828  std::string myEdgeType;
829 
831  const int myPriority;
832 
834  double myWidth;
835 
837  double myLength;
838 
841 
843  mutable bool myAmDelayed;
844 
847 
849  std::vector<double> mySublaneSides;
850 
853 
855  typedef std::map< std::string, MSEdge* > DictType;
856 
860  static DictType myDict;
861 
867 
868 
870  mutable std::map<SUMOVehicleClass, MSEdgeVector> myClassesSuccessorMap;
871 
872 private:
874  MSEdge(const MSEdge&);
875 
877  MSEdge& operator=(const MSEdge&);
878 
879 };
880 
881 
882 #endif
883 
884 /****************************************************************************/
885 
bool myAmDelayed
whether this edge had a vehicle with less than max speed on it
Definition: MSEdge.h:843
double getDepartPosBound(const MSVehicle &veh, bool upper=true) const
return upper bound for the depart position on this edge
Definition: MSEdge.cpp:420
int getNumPredecessors() const
Returns the number of edges this edge is connected to.
Definition: MSEdge.h:355
const std::vector< double > getSubLaneSides() const
Returns the right side offsets of this edge&#39;s sublanes.
Definition: MSEdge.h:569
bool allowsLaneChanging()
Definition: MSEdge.cpp:220
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:527
std::set< MSTransportable * > myContainers
Containers on the edge.
Definition: MSEdge.h:806
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:83
static void insertIDs(std::vector< std::string > &into)
Inserts IDs of all known edges into the given vector.
Definition: MSEdge.cpp:776
Sorts edges by their ids.
Definition: MSEdge.h:719
int getPriority() const
Returns the priority of the edge.
Definition: MSEdge.h:294
void addSuccessor(MSEdge *edge)
Adds an edge to the list of edges which may be reached from this edge and to the incoming of the othe...
Definition: MSEdge.h:323
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:277
double getLengthGeometryFactor() const
return shape.length() / myLength
Definition: MSEdge.cpp:831
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:755
virtual void unlock() const
release exclusive access to the mesoscopic state
Definition: MSEdge.h:665
void recalcCache()
Recalculates the cached values.
Definition: MSEdge.cpp:128
const MSEdgeVector & getPredecessors() const
Definition: MSEdge.h:363
The base class for an intersection.
Definition: MSJunction.h:64
static MSEdgeVector myEdges
Static list of edges.
Definition: MSEdge.h:865
const EdgeBasicFunction myFunction
the purpose of the edge
Definition: MSEdge.h:776
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:302
ClassedAllowedLanesCont myClassedAllowed
From vehicle class to lanes allowed to be used by it.
Definition: MSEdge.h:816
void closeBuilding()
Definition: MSEdge.cpp:159
virtual ~MSEdge()
Destructor.
Definition: MSEdge.cpp:91
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:292
The edge is a macroscopic connector (source/sink)
Definition: MSEdge.h:95
bool isRoundabout() const
Definition: MSEdge.h:636
const std::vector< MSLane * > & getLanes() const
Returns this edge&#39;s lanes.
Definition: MSEdge.h:192
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
Definition: MSNet.cpp:158
std::string myEdgeType
the type of the edge (optionally used during network creation)
Definition: MSEdge.h:828
const std::vector< std::string > & getCrossingEdges() const
Gets the crossed edge ids.
Definition: MSEdge.h:310
double getMeanSpeed() const
get the mean speed
Definition: MSEdge.cpp:684
transportable_by_position_sorter(SUMOTime timestep)
constructor
Definition: MSEdge.h:737
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:728
std::vector< double > mySublaneSides
the right side for each sublane on this edge
Definition: MSEdge.h:849
const int myNumericalID
This edge&#39;s numerical id.
Definition: MSEdge.h:767
SUMOTime incVaporization(SUMOTime t)
Enables vaporization.
Definition: MSEdge.cpp:375
void initialize(const std::vector< MSLane *> *lanes)
Initialize the edge.
Definition: MSEdge.cpp:107
std::vector< const MSEdge * > ConstMSEdgeVector
Definition: MSEdge.h:78
const std::string & getID() const
Returns the id.
Definition: Named.h:66
int myVaporizationRequests
Vaporizer counter.
Definition: MSEdge.h:779
EdgeBasicFunction
Defines possible edge types.
Definition: MSEdge.h:89
double getLength() const
return the length of the edge
Definition: MSEdge.h:586
const MSJunction * getToJunction() const
Definition: MSEdge.h:372
std::vector< MSTransportable * > getSortedPersons(SUMOTime timestep, bool includeRiding=false) const
Returns this edge&#39;s persons sorted by pos.
Definition: MSEdge.cpp:854
SUMOTime decVaporization(SUMOTime t)
Disables vaporization.
Definition: MSEdge.cpp:382
int getNumericalID() const
Returns the numerical id of the edge.
Definition: MSEdge.h:275
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:824
The purpose of the edge is not known.
Definition: MSEdge.h:91
bool hasLaneChanger() const
Definition: MSEdge.h:648
std::map< std::string, MSEdge *> DictType
definition of the static dictionary type
Definition: MSEdge.h:855
bool isVaporizing() const
Returns whether vehicles on this edge shall be vaporized.
Definition: MSEdge.h:391
int getNumSuccessors() const
Returns the number of edges that may be reached from this edge.
Definition: MSEdge.h:332
const std::string & getEdgeType() const
Returns the type of the edge.
Definition: MSEdge.h:288
int operator()(const MSEdge *const e1, const MSEdge *const e2) const
comparing operator
Definition: MSEdge.h:725
double getCurrentTravelTime(const double minSpeed=NUMERICAL_EPS) const
Computes and returns the current travel time for this edge.
Definition: MSEdge.cpp:711
MSEdge & operator=(const MSEdge &)
assignment operator.
Performs lane changing of vehicles.
Definition: MSLaneChanger.h:55
A road/street connecting two junctions.
Definition: MSEdge.h:80
SUMOTime myLastFailedInsertionTime
The time of last insertion failure.
Definition: MSEdge.h:782
std::map< SUMOVehicleClass, MSEdgeVector > myClassesSuccessorMap
The successors available for a given vClass.
Definition: MSEdge.h:870
void rebuildAllowedLanes()
Definition: MSEdge.cpp:243
double myLength
the length of the edge (cached value for speedup)
Definition: MSEdge.h:837
The edge is a district edge.
Definition: MSEdge.h:99
Representation of a vehicle.
Definition: SUMOVehicle.h:67
static double getTravelTimeStatic(const MSEdge *const edge, const SUMOVehicle *const veh, double time)
Returns the travel time for the given edge.
Definition: MSEdge.h:451
static double getTravelTime(const MSEdge *const e, const SUMOVehicle *const v, double t)
Returns the travel time to pass an edge.
Definition: MSNet.cpp:141
AllowedLanesCont myAllowed
Associative container from destination-edge to allowed-lanes.
Definition: MSEdge.h:812
bool hasMinorLink() const
whether any lane has a minor link
Definition: MSEdge.cpp:935
std::map< SUMOVehicleClass, AllowedLanesCont > ClassedAllowedLanesCont
Map from vehicle types to lanes that may be used to reach one of the next edges.
Definition: MSEdge.h:111
static void clear()
Clears the dictionary.
Definition: MSEdge.cpp:767
SVCPermissions myMinimumPermissions
The intersection of lane permissions for this edge.
Definition: MSEdge.h:819
virtual void addPerson(MSTransportable *p) const
Definition: MSEdge.h:612
const std::set< MSTransportable * > & getPersons() const
Returns this edge&#39;s persons set.
Definition: MSEdge.h:201
MSEdgeVector mySuccessors
The succeeding edges.
Definition: MSEdge.h:793
double getMinimumTravelTime(const SUMOVehicle *const veh) const
returns the minimum travel time for the given vehicle
Definition: MSEdge.h:433
MSJunction * myToJunction
Definition: MSEdge.h:800
MSLaneChanger * myLaneChanger
This member will do the lane-change.
Definition: MSEdge.h:773
double getRoutingSpeed() const
Returns the averaged speed used by the routing device.
Definition: MSEdge.cpp:721
MSEdge(const std::string &id, int numericalID, const EdgeBasicFunction function, const std::string &streetName, const std::string &edgeType, int priority)
Constructor.
Definition: MSEdge.cpp:72
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:265
MSLane * getDepartLane(MSVehicle &veh) const
Finds a depart lane for the given vehicle parameters.
Definition: MSEdge.cpp:464
virtual void removePerson(MSTransportable *p) const
Definition: MSEdge.h:616
SUMOTime getLastFailedInsertionTime() const
Returns the last time a vehicle could not be inserted.
Definition: MSEdge.h:523
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:770
EdgeBasicFunction getPurpose() const
Returns the edge type (EdgeBasicFunction)
Definition: MSEdge.h:249
bool isCrossing() const
return whether this edge is a pedestrian crossing
Definition: MSEdge.h:259
bool isInternal() const
return whether this edge is an internal edge
Definition: MSEdge.h:254
An upper class for objects with additional parameters.
Definition: Parameterised.h:51
virtual void removeContainer(MSTransportable *container) const
Remove container from myContainers.
Definition: MSEdge.h:629
bool canChangeToOpposite()
whether this edge allows changing to the opposite direction edge
Definition: MSEdge.cpp:927
const std::string & getStreetName() const
Returns the street name of the edge.
Definition: MSEdge.h:282
Base class for objects which have an id.
Definition: Named.h:46
const MSEdge * getInternalFollowingEdge(const MSEdge *followerAfterInternal) const
Definition: MSEdge.cpp:650
double getVehicleMaxSpeed(const SUMOVehicle *const veh) const
Returns the maximum speed the vehicle may use on this edge.
Definition: MSEdge.cpp:836
SVCPermissions myCombinedPermissions
The union of lane permissions for this edge.
Definition: MSEdge.h:821
The edge is a pedestrian walking area (a special type of internal edge)
Definition: MSEdge.h:103
void markDelayed() const
Definition: MSEdge.h:644
void buildLaneChanger()
Has to be called after all sucessors and predecessors have been set (after closeBuilding()) ...
Definition: MSEdge.cpp:202
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:549
virtual void addContainer(MSTransportable *container) const
Add a container to myContainers.
Definition: MSEdge.h:624
static const MSEdgeVector & getAllEdges()
Returns all edges with a numerical id.
Definition: MSEdge.cpp:761
virtual void changeLanes(SUMOTime t)
Performs lane changing on this edge.
Definition: MSEdge.cpp:640
The edge is a normal street.
Definition: MSEdge.h:93
const MSJunction * getFromJunction() const
Definition: MSEdge.h:368
bool myAmRoundabout
whether this edge belongs to a roundabout
Definition: MSEdge.h:846
The edge is a pedestrian crossing (a special type of internal edge)
Definition: MSEdge.h:101
double myWidth
Edge width [m].
Definition: MSEdge.h:834
std::string myStreetName
the real-world name of this edge (need not be unique)
Definition: MSEdge.h:825
MSJunction * myFromJunction
the junctions for this edge
Definition: MSEdge.h:799
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:670
const MSEdgeVector & getSuccessors() const
Returns the following edges.
Definition: MSEdge.h:339
bool isTaz() const
Definition: MSEdge.h:268
void setMaxSpeed(double val) const
Sets a new maximum speed for all lanes (used by TraCI and MSCalibrator)
Definition: MSEdge.cpp:843
void setJunctions(MSJunction *from, MSJunction *to)
Definition: MSEdge.h:377
virtual void lock() const
grant exclusive access to the mesoscopic state
Definition: MSEdge.h:662
by_id_sorter()
constructor
Definition: MSEdge.h:722
std::map< const MSEdge *, std::vector< MSLane * > *> AllowedLanesCont
Suceeding edges (keys) and allowed lanes to reach these edges (values).
Definition: MSEdge.h:108
const int myPriority
the priority of the edge (used during network creation)
Definition: MSEdge.h:831
bool isWalkingArea() const
return whether this edge is walking area
Definition: MSEdge.h:264
std::vector< std::string > myCrossingEdges
The crossed edges id for a crossing edge. On not crossing edges it is empty.
Definition: MSEdge.h:790
static DictType myDict
Static dictionary to associate string-ids with objects.
Definition: MSEdge.h:860
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:71
Sorts transportables by their positions.
Definition: MSEdge.h:734
double getDistanceTo(const MSEdge *other) const
optimistic air distance heuristic for use in routing
Definition: MSEdge.cpp:814
long long int SUMOTime
Definition: TraCIDefs.h:52
#define NUMERICAL_EPS
Definition: config.h:151
std::vector< MSEdge * > MSEdgeVector
Definition: MSEdge.h:77
SVCPermissions getPermissions() const
Definition: MSEdge.h:557
void markAsRoundabout()
Definition: MSEdge.h:640
The edge is an internal edge.
Definition: MSEdge.h:97
MSEdgeVector myPredecessors
The preceeding edges.
Definition: MSEdge.h:796
std::vector< MSTransportable * > getSortedContainers(SUMOTime timestep, bool includeRiding=false) const
Returns this edge&#39;s containers sorted by pos.
Definition: MSEdge.cpp:872
Representation of a lane in the micro simulation.
Definition: MSLane.h:79
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:271
double myEmptyTraveltime
the traveltime on the empty edge (cached value for speedup)
Definition: MSEdge.h:840
MSLane * getFreeLane(const std::vector< MSLane *> *allowed, const SUMOVehicleClass vclass, double departPos) const
Finds the emptiest lane allowing the vehicle class.
Definition: MSEdge.cpp:389
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:784
const std::vector< MSLane * > * getAllowedLanesWithDefault(const AllowedLanesCont &c, const MSEdge *dest) const
lookup in map and return 0 if not found
Definition: MSEdge.cpp:304
vehicles ignoring classes
SUMOVehicleClass getVehicleClass() const
Get this vehicle type&#39;s vehicle class.
std::set< int > myFailedInsertionMemory
A cache for the rejected insertion attempts. Used to assure that no further insertion attempts are ma...
Definition: MSEdge.h:787
std::set< MSTransportable * > myPersons
Persons on the edge for drawing and pushbutton.
Definition: MSEdge.h:803
void setLastFailedInsertionTime(SUMOTime time) const
Sets the last time a vehicle could not be inserted.
Definition: MSEdge.h:531
virtual const MSVehicleType & getVehicleType() const =0
Returns the vehicle&#39;s type.
double getWidth() const
Returns the edges&#39;s width (sum over all lanes)
Definition: MSEdge.h:564