SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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-2016 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) const;
210 
211 
216  std::vector<MSTransportable*> getSortedContainers(SUMOTime timestep) 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 
333  return myPredecessors;
334  }
335 
339  const std::vector<MSEdge*>& getOutgoingEdges() const {
340  return mySuccessors;
341  }
342 
346  int getNumSuccessors() const {
347  return (int) mySuccessors.size();
348  }
349 
350 
353  const MSEdgeVector& getSuccessors() const {
354  return mySuccessors;
355  }
356 
357 
362  const MSEdgeVector& getSuccessors(SUMOVehicleClass vClass) const;
363 
364 
369  int getNumPredecessors() const {
370  return (int) myPredecessors.size();
371  }
372 
373 
378  const MSEdgeVector& getPredecessors() const {
379  return myPredecessors;
380  }
381 
382 
383  const MSJunction* getFromJunction() const {
384  return myFromJunction;
385  }
386 
387  const MSJunction* getToJunction() const {
388  return myToJunction;
389  }
390 
391 
392  void setJunctions(MSJunction* from, MSJunction* to) {
393  myFromJunction = from;
394  myToJunction = to;
395  }
397 
398 
399 
402 
406  bool isVaporizing() const {
407  return myVaporizationRequests > 0;
408  }
409 
410 
421 
422 
434 
435 
444  SUMOReal getCurrentTravelTime(const SUMOReal minSpeed = NUMERICAL_EPS) const;
445 
446 
448  inline SUMOReal getMinimumTravelTime(const SUMOVehicle* const veh) const {
450  return 0;
451  } else if (veh != 0) {
452  return getLength() / getVehicleMaxSpeed(veh);
453  } else {
454  return getLength() / getSpeedLimit();
455  }
456  }
457 
458 
466  static inline SUMOReal getTravelTimeStatic(const MSEdge* const edge, const SUMOVehicle* const veh, SUMOReal time) {
467  return MSNet::getInstance()->getTravelTime(edge, veh, time);
468  }
469 
472  SUMOReal getRoutingSpeed() const;
473 
474 
477 
494  bool insertVehicle(SUMOVehicle& v, SUMOTime time, const bool checkOnly = false) const;
495 
496 
511  MSLane* getFreeLane(const std::vector<MSLane*>* allowed, const SUMOVehicleClass vclass) const;
512 
513 
524  MSLane* getDepartLane(MSVehicle& veh) const;
525 
526 
532  }
533 
534 
538  inline void setLastFailedInsertionTime(SUMOTime time) const {
540  }
542 
543 
545  virtual void changeLanes(SUMOTime t);
546 
547 
548 #ifdef HAVE_INTERNAL_LANES
549  const MSEdge* getInternalFollowingEdge(const MSEdge* followerAfterInternal) const;
551 #endif
552 
554  inline bool prohibits(const SUMOVehicle* const vehicle) const {
555  if (vehicle == 0) {
556  return false;
557  }
558  const SUMOVehicleClass svc = vehicle->getVehicleType().getVehicleClass();
559  return (myCombinedPermissions & svc) != svc;
560  }
561 
563  return myCombinedPermissions;
564  }
565 
569  SUMOReal getWidth() const {
570  return myWidth;
571  }
572 
574  const std::vector<SUMOReal> getSubLaneSides() const {
575  return mySublaneSides;
576  }
577 
578  void rebuildAllowedLanes();
579 
580 
585  SUMOReal getDistanceTo(const MSEdge* other) const;
586 
587 
591  inline SUMOReal getLength() const {
592  return myLength;
593  }
594 
595 
600  SUMOReal getSpeedLimit() const;
601 
605  void setMaxSpeed(SUMOReal val) const;
606 
612  SUMOReal getVehicleMaxSpeed(const SUMOVehicle* const veh) const;
613 
614  virtual void addPerson(MSTransportable* p) const {
615  myPersons.insert(p);
616  }
617 
618  virtual void removePerson(MSTransportable* p) const {
619  std::set<MSTransportable*>::iterator i = myPersons.find(p);
620  if (i != myPersons.end()) {
621  myPersons.erase(i);
622  }
623  }
624 
626  virtual void addContainer(MSTransportable* container) const {
627  myContainers.insert(container);
628  }
629 
631  virtual void removeContainer(MSTransportable* container) const {
632  std::set<MSTransportable*>::iterator i = myContainers.find(container);
633  if (i != myContainers.end()) {
634  myContainers.erase(i);
635  }
636  }
637 
638  inline bool isRoundabout() const {
639  return myAmRoundabout;
640  }
641 
643  myAmRoundabout = true;
644  }
645 
646  void markDelayed() const {
647  myAmDelayed = true;
648  }
649 
650  bool hasLaneChanger() const {
651  return myLaneChanger != 0;
652  }
653 
655  bool canChangeToOpposite();
656 
658  SUMOReal getMeanSpeed() const;
659 
661  virtual void lock() const {}
662 
664  virtual void unlock() const {};
665 
669  static bool dictionary(const std::string& id, MSEdge* edge);
670 
672  static MSEdge* dictionary(const std::string& id);
673 
675  static int dictSize();
676 
678  static const MSEdgeVector& getAllEdges();
679 
681  static void clear();
682 
684  static void insertIDs(std::vector<std::string>& into);
685 
686 
687 public:
690 
699  static void parseEdgesList(const std::string& desc, ConstMSEdgeVector& into,
700  const std::string& rid);
701 
702 
709  static void parseEdgesList(const std::vector<std::string>& desc, ConstMSEdgeVector& into,
710  const std::string& rid);
712 
713 
714 protected:
718  class by_id_sorter {
719  public:
721  explicit by_id_sorter() { }
722 
724  int operator()(const MSEdge* const e1, const MSEdge* const e2) const {
725  return e1->getID() < e2->getID();
726  }
727 
728  };
729 
734  public:
736  explicit transportable_by_position_sorter(SUMOTime timestep): myTime(timestep) { }
737 
739  int operator()(const MSTransportable* const c1, const MSTransportable* const c2) const;
740  private:
742  };
743 
744 
753  const std::vector<MSLane*>* allowedLanes(const MSEdge* destination,
754  SUMOVehicleClass vclass = SVC_IGNORING) const;
755 
756 
758  const std::vector<MSLane*>* getAllowedLanesWithDefault(const AllowedLanesCont& c, const MSEdge* dest) const;
759 
760 
761 protected:
763  const int myNumericalID;
764 
766  const std::vector<MSLane*>* myLanes;
767 
770 
773 
776 
779 
781  std::vector<std::string> myCrossingEdges;
782 
785 
788 
792 
794  mutable std::set<MSTransportable*> myPersons;
795 
797  mutable std::set<MSTransportable*> myContainers;
798 
801 
803  AllowedLanesCont myAllowed;
804 
806  // @note: this map is filled on demand
807  mutable ClassedAllowedLanesCont myClassedAllowed;
808 
814 
816  std::string myStreetName;
817 
819  std::string myEdgeType;
820 
822  const int myPriority;
823 
826 
829 
832 
834  mutable bool myAmDelayed;
835 
838 
840  std::vector<SUMOReal> mySublaneSides;
841 
844 
846  typedef std::map< std::string, MSEdge* > DictType;
847 
851  static DictType myDict;
852 
858 
859 
861  mutable std::map<SUMOVehicleClass, MSEdgeVector> myClassesSuccessorMap;
862 
863 private:
865  MSEdge(const MSEdge&);
866 
868  MSEdge& operator=(const MSEdge&);
869 
870 };
871 
872 
873 #endif
874 
875 /****************************************************************************/
876 
bool myAmDelayed
whether this edge had a vehicle with less than max speed on it
Definition: MSEdge.h:834
bool allowsLaneChanging()
Definition: MSEdge.cpp:228
std::set< MSTransportable * > myContainers
Containers on the edge.
Definition: MSEdge.h:797
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:82
static void insertIDs(std::vector< std::string > &into)
Inserts IDs of all known edges into the given vector.
Definition: MSEdge.cpp:721
long long int SUMOTime
Definition: SUMOTime.h:43
SUMOReal myLength
the length of the edge (cached value for speedup)
Definition: MSEdge.h:828
SUMOVehicleClass getVehicleClass() const
Get this vehicle type's vehicle class.
Sorts edges by their ids.
Definition: MSEdge.h:718
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
bool insertVehicle(SUMOVehicle &v, SUMOTime time, const bool checkOnly=false) const
Tries to insert the given vehicle into the network.
Definition: MSEdge.cpp:472
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
SUMOReal getDistanceTo(const MSEdge *other) const
optimistic air distance heuristic for use in routing
Definition: MSEdge.cpp:759
static int dictSize()
Returns the number of edges.
Definition: MSEdge.cpp:700
void initialize(const std::vector< MSLane * > *lanes)
Initialize the edge.
Definition: MSEdge.cpp:110
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
Definition: MSEdge.h:192
virtual void lock() const
grant exclusive access to the mesoscopic state
Definition: MSEdge.h:661
void recalcCache()
Recalculates the cached values.
Definition: MSEdge.cpp:136
virtual void addContainer(MSTransportable *container) const
Add a container to myContainers.
Definition: MSEdge.h:626
The base class for an intersection.
Definition: MSJunction.h:64
static MSEdgeVector myEdges
Static list of edges.
Definition: MSEdge.h:856
const EdgeBasicFunction myFunction
the purpose of the edge
Definition: MSEdge.h:772
int SVCPermissions
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:807
bool isWalkingArea() const
return whether this edge is walking area
Definition: MSEdge.h:264
void closeBuilding()
Definition: MSEdge.cpp:166
virtual ~MSEdge()
Destructor.
Definition: MSEdge.cpp:94
const std::string & getStreetName() const
Returns the street name of the edge.
Definition: MSEdge.h:282
The edge is a macroscopic connector (source/sink)
Definition: MSEdge.h:95
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
Definition: MSNet.cpp:159
std::string myEdgeType
the type of the edge (optionally used during network creation)
Definition: MSEdge.h:819
SVCPermissions getPermissions() const
Definition: MSEdge.h:562
transportable_by_position_sorter(SUMOTime timestep)
constructor
Definition: MSEdge.h:736
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:673
const int myNumericalID
This edge's numerical id.
Definition: MSEdge.h:763
SUMOTime incVaporization(SUMOTime t)
Enables vaporization.
Definition: MSEdge.cpp:383
MSLane * getFreeLane(const std::vector< MSLane * > *allowed, const SUMOVehicleClass vclass) const
Finds the emptiest lane allowing the vehicle class.
Definition: MSEdge.cpp:397
std::vector< const MSEdge * > ConstMSEdgeVector
Definition: MSEdge.h:78
int myVaporizationRequests
Vaporizer counter.
Definition: MSEdge.h:775
const MSEdgeVector & getIncomingEdges() const
Returns the list of edges from which this edge may be reached.
Definition: MSEdge.h:332
EdgeBasicFunction
Defines possible edge types.
Definition: MSEdge.h:89
bool prohibits(const SUMOVehicle *const vehicle) const
Returns whether the vehicle (class) is not allowed on the edge.
Definition: MSEdge.h:554
SUMOTime decVaporization(SUMOTime t)
Disables vaporization.
Definition: MSEdge.cpp:390
const std::vector< SUMOReal > getSubLaneSides() const
Returns the right side offsets of this edge's sublanes.
Definition: MSEdge.h:574
The purpose of the edge is not known.
Definition: MSEdge.h:91
virtual void removeContainer(MSTransportable *container) const
Remove container from myContainers.
Definition: MSEdge.h:631
std::map< std::string, MSEdge * > DictType
definition of the static dictionary type
Definition: MSEdge.h:846
MSEdge & operator=(const MSEdge &)
assignment operator.
Performs lane changing of vehicles.
Definition: MSLaneChanger.h:55
const std::string & getID() const
Returns the id.
Definition: Named.h:66
A road/street connecting two junctions.
Definition: MSEdge.h:80
SUMOTime myLastFailedInsertionTime
The time of last insertion failure.
Definition: MSEdge.h:778
std::map< SUMOVehicleClass, MSEdgeVector > myClassesSuccessorMap
The successors available for a given vClass.
Definition: MSEdge.h:861
void rebuildAllowedLanes()
Definition: MSEdge.cpp:251
SUMOReal getLength() const
return the length of the edge
Definition: MSEdge.h:591
virtual void removePerson(MSTransportable *p) const
Definition: MSEdge.h:618
bool isTaz() const
Definition: MSEdge.h:268
The edge is a district edge.
Definition: MSEdge.h:99
virtual void addPerson(MSTransportable *p) const
Definition: MSEdge.h:614
Representation of a vehicle.
Definition: SUMOVehicle.h:66
const MSEdgeVector & getPredecessors() const
Returns the edge at the given position from the list of reachable edges.
Definition: MSEdge.h:378
AllowedLanesCont myAllowed
Associative container from destination-edge to allowed-lanes.
Definition: MSEdge.h:803
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:712
SVCPermissions myMinimumPermissions
The intersection of lane permissions for this edge.
Definition: MSEdge.h:810
static SUMOReal getTravelTime(const MSEdge *const e, const SUMOVehicle *const v, SUMOReal t)
Returns the travel time to pass an edge.
Definition: MSNet.cpp:141
MSEdgeVector mySuccessors
The succeeding edges.
Definition: MSEdge.h:784
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:273
MSJunction * myToJunction
Definition: MSEdge.h:791
MSLaneChanger * myLaneChanger
This member will do the lane-change.
Definition: MSEdge.h:769
void markDelayed() const
Definition: MSEdge.h:646
MSEdge(const std::string &id, int numericalID, const EdgeBasicFunction function, const std::string &streetName, const std::string &edgeType, int priority)
Constructor.
Definition: MSEdge.cpp:75
bool isRoundabout() const
Definition: MSEdge.h:638
int getNumSuccessors() const
Returns the number of edges that may be reached from this edge.
Definition: MSEdge.h:346
bool isVaporizing() const
Returns whether vehicles on this edge shall be vaporized.
Definition: MSEdge.h:406
std::vector< SUMOReal > mySublaneSides
the right side for each sublane on this edge
Definition: MSEdge.h:840
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:766
An upper class for objects with additional parameters.
Definition: Parameterised.h:47
SUMOReal getSpeedLimit() const
Returns the speed limit of the edge The speed limit of the first lane is retured; should probably be...
Definition: MSEdge.cpp:769
bool isInternal() const
return whether this edge is an internal edge
Definition: MSEdge.h:254
const std::string & getEdgeType() const
Returns the type of the edge.
Definition: MSEdge.h:288
bool canChangeToOpposite()
whether this edge allows changing to the opposite direction edge
Definition: MSEdge.cpp:857
MSLane * getDepartLane(MSVehicle &veh) const
Finds a depart lane for the given vehicle parameters.
Definition: MSEdge.cpp:417
Base class for objects which have an id.
Definition: Named.h:46
std::vector< MSTransportable * > getSortedContainers(SUMOTime timestep) const
Returns this edge's containers sorted by pos.
Definition: MSEdge.cpp:802
const std::vector< MSEdge * > & getOutgoingEdges() const
Returns the list of edges that may be reached from this edge.
Definition: MSEdge.h:339
SVCPermissions myCombinedPermissions
The union of lane permissions for this edge.
Definition: MSEdge.h:812
The edge is a pedestrian walking area (a special type of internal edge)
Definition: MSEdge.h:103
void buildLaneChanger()
Has to be called after all sucessors and predecessors have been set (after closeBuilding()) ...
Definition: MSEdge.cpp:210
EdgeBasicFunction getPurpose() const
Returns the edge type (EdgeBasicFunction)
Definition: MSEdge.h:249
Structure representing possible vehicle parameter.
int operator()(const MSEdge *const e1, const MSEdge *const e2) const
comparing operator
Definition: MSEdge.h:724
virtual void unlock() const
release exclusive access to the mesoscopic state
Definition: MSEdge.h:664
int getNumericalID() const
Returns the numerical id of the edge.
Definition: MSEdge.h:275
int getPriority() const
Returns the priority of the edge.
Definition: MSEdge.h:294
const std::vector< std::string > & getCrossingEdges() const
Gets the crossed edge ids.
Definition: MSEdge.h:310
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:285
static const MSEdgeVector & getAllEdges()
Returns all edges with a numerical id.
Definition: MSEdge.cpp:706
virtual void changeLanes(SUMOTime t)
Performs lane changing on this edge.
Definition: MSEdge.cpp:578
The edge is a normal street.
Definition: MSEdge.h:93
SUMOReal myEmptyTraveltime
the traveltime on the empty edge (cached value for speedup)
Definition: MSEdge.h:831
SUMOReal getMeanSpeed() const
get the mean speed
Definition: MSEdge.cpp:629
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:300
bool myAmRoundabout
whether this edge belongs to a roundabout
Definition: MSEdge.h:837
The edge is a pedestrian crossing (a special type of internal edge)
Definition: MSEdge.h:101
std::string myStreetName
the real-world name of this edge (need not be unique)
Definition: MSEdge.h:816
MSJunction * myFromJunction
the junctions for this edge
Definition: MSEdge.h:790
SUMOTime getLastFailedInsertionTime() const
Returns the last time a vehicle could not be inserted.
Definition: MSEdge.h:530
void setJunctions(MSJunction *from, MSJunction *to)
Definition: MSEdge.h:392
by_id_sorter()
constructor
Definition: MSEdge.h:721
SUMOReal getWidth() const
Returns the edges's width (sum over all lanes)
Definition: MSEdge.h:569
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:822
void setLastFailedInsertionTime(SUMOTime time) const
Sets the last time a vehicle could not be inserted.
Definition: MSEdge.h:538
std::vector< std::string > myCrossingEdges
The crossed edges id for a crossing edge. On not crossing edges it is empty.
Definition: MSEdge.h:781
static DictType myDict
Static dictionary to associate string-ids with objects.
Definition: MSEdge.h:851
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:71
SUMOReal getRoutingSpeed() const
Returns the averaged speed used by the routing device.
Definition: MSEdge.cpp:666
const std::set< MSTransportable * > & getPersons() const
Returns this edge's persons set.
Definition: MSEdge.h:201
#define SUMOReal
Definition: config.h:214
Sorts transportables by their positions.
Definition: MSEdge.h:733
SUMOReal getMinimumTravelTime(const SUMOVehicle *const veh) const
returns the minimum travel time for the given vehicle
Definition: MSEdge.h:448
bool isCrossing() const
return whether this edge is a pedestrian crossing
Definition: MSEdge.h:259
const MSJunction * getFromJunction() const
Definition: MSEdge.h:383
const MSEdgeVector & getSuccessors() const
Returns the following edges.
Definition: MSEdge.h:353
#define NUMERICAL_EPS
Definition: config.h:161
SUMOReal getVehicleMaxSpeed(const SUMOVehicle *const veh) const
Returns the maximum speed the vehicle may use on this edge.
Definition: MSEdge.cpp:776
std::vector< MSEdge * > MSEdgeVector
Definition: MSEdge.h:77
SUMOReal myWidth
Edge width [m].
Definition: MSEdge.h:825
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:279
void markAsRoundabout()
Definition: MSEdge.h:642
int operator()(const MSTransportable *const c1, const MSTransportable *const c2) const
comparing operator
Definition: MSEdge.cpp:810
The edge is an internal edge.
Definition: MSEdge.h:97
const std::vector< MSLane * > * getAllowedLanesWithDefault(const AllowedLanesCont &c, const MSEdge *dest) const
lookup in map and return 0 if not found
Definition: MSEdge.cpp:312
int getNumPredecessors() const
Returns the number of edges this edge is connected to.
Definition: MSEdge.h:369
MSEdgeVector myPredecessors
The preceeding edges.
Definition: MSEdge.h:787
Representation of a lane in the micro simulation.
Definition: MSLane.h:79
SUMOReal getCurrentTravelTime(const SUMOReal minSpeed=NUMERICAL_EPS) const
Computes and returns the current travel time for this edge.
Definition: MSEdge.cpp:656
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:729
vehicles ignoring classes
std::vector< MSTransportable * > getSortedPersons(SUMOTime timestep) const
Returns this edge's persons sorted by pos.
Definition: MSEdge.cpp:794
static SUMOReal getTravelTimeStatic(const MSEdge *const edge, const SUMOVehicle *const veh, SUMOReal time)
Returns the travel time for the given edge.
Definition: MSEdge.h:466
bool hasLaneChanger() const
Definition: MSEdge.h:650
void setMaxSpeed(SUMOReal val) const
Sets a new maximum speed for all lanes (used by TraCI and MSCalibrator)
Definition: MSEdge.cpp:783
const MSJunction * getToJunction() const
Definition: MSEdge.h:387
std::set< MSTransportable * > myPersons
Persons on the edge for drawing and pushbutton.
Definition: MSEdge.h:794
virtual const MSVehicleType & getVehicleType() const =0
Returns the vehicle's type.