SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MSJunction.h
Go to the documentation of this file.
1 /****************************************************************************/
10 // The base class for an intersection
11 /****************************************************************************/
12 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
13 // Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors
14 /****************************************************************************/
15 //
16 // This file is part of SUMO.
17 // SUMO is free software: you can redistribute it and/or modify
18 // it under the terms of the GNU General Public License as published by
19 // the Free Software Foundation, either version 3 of the License, or
20 // (at your option) any later version.
21 //
22 /****************************************************************************/
23 #ifndef MSJunction_h
24 #define MSJunction_h
25 
26 
27 // ===========================================================================
28 // included modules
29 // ===========================================================================
30 #ifdef _MSC_VER
31 #include <windows_config.h>
32 #else
33 #include <config.h>
34 #endif
35 
36 #include <string>
37 #include <vector>
38 #include <map>
39 #include <utils/geom/Position.h>
41 #include <utils/common/Named.h>
42 #include <utils/common/SUMOTime.h>
44 
45 
46 class MSVehicle;
47 class MSLink;
48 class MSLane;
49 class MSEdge;
50 
51 // ===========================================================================
52 // class definitions
53 // ===========================================================================
58 class MSJunction : public Named {
59 public:
65  MSJunction(const std::string& id, const Position& position,
66  const PositionVector& shape);
67 
68 
70  virtual ~MSJunction();
71 
72 
75  virtual void postloadInit();
76 
77 
79  const Position& getPosition() const;
80 
81 
85  const PositionVector& getShape() const {
86  return myShape;
87  }
88 
89  virtual const std::vector<MSLink*>& getFoeLinks(const MSLink* const /*srcLink*/) const {
90  return myEmptyLinks;
91  }
92 
93  virtual const std::vector<MSLane*>& getFoeInternalLanes(const MSLink* const /*srcLink*/) const {
94  return myEmptyLanes;
95  }
96 
97  inline const std::vector<const MSEdge*>& getIncoming() const {
98  return myIncoming;
99  }
100 
101  inline const std::vector<const MSEdge*>& getOutgoing() const {
102  return myOutgoing;
103  }
104 
105  void addIncoming(MSEdge* edge) {
106  myIncoming.push_back(edge);
107  }
108 
109  void addOutgoing(MSEdge* edge) {
110  myOutgoing.push_back(edge);
111  }
112 
113 protected:
116 
119 
120  std::vector<MSLink*> myEmptyLinks;
121  std::vector<MSLane*> myEmptyLanes;
122 
123 
125  std::vector<const MSEdge*> myIncoming;
127  std::vector<const MSEdge*> myOutgoing;
128 
130  typedef std::map<std::string, MSJunction* > DictType;
131 
132 private:
134  MSJunction(const MSJunction&);
135 
138 
139 };
140 
141 
142 #endif
143 
144 /****************************************************************************/
145 
MSJunction & operator=(const MSJunction &)
Invalidated assignment operator.
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:77
virtual const std::vector< MSLink * > & getFoeLinks(const MSLink *const ) const
Definition: MSJunction.h:89
std::vector< const MSEdge * > myOutgoing
outgoing edges
Definition: MSJunction.h:127
void addIncoming(MSEdge *edge)
Definition: MSJunction.h:105
The base class for an intersection.
Definition: MSJunction.h:58
const PositionVector & getShape() const
Returns this junction's shape.
Definition: MSJunction.h:85
std::vector< MSLink * > myEmptyLinks
Definition: MSJunction.h:120
virtual ~MSJunction()
Destructor.
Definition: MSJunction.cpp:57
A road/street connecting two junctions.
Definition: MSEdge.h:74
Position myPosition
The position of the junction.
Definition: MSJunction.h:115
std::map< std::string, MSJunction * > DictType
definition of the static dictionary type
Definition: MSJunction.h:130
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:46
A list of positions.
std::vector< const MSEdge * > myIncoming
incoming edges
Definition: MSJunction.h:125
MSJunction(const std::string &id, const Position &position, const PositionVector &shape)
Constructor.
Definition: MSJunction.cpp:52
void addOutgoing(MSEdge *edge)
Definition: MSJunction.h:109
const std::vector< const MSEdge * > & getIncoming() const
Definition: MSJunction.h:97
Base class for objects which have an id.
Definition: Named.h:45
const std::vector< const MSEdge * > & getOutgoing() const
Definition: MSJunction.h:101
virtual void postloadInit()
Definition: MSJunction.cpp:67
virtual const std::vector< MSLane * > & getFoeInternalLanes(const MSLink *const ) const
Definition: MSJunction.h:93
PositionVector myShape
The shape of the junction.
Definition: MSJunction.h:118
std::vector< MSLane * > myEmptyLanes
Definition: MSJunction.h:121
Representation of a lane in the micro simulation.
Definition: MSLane.h:77
const Position & getPosition() const
Definition: MSJunction.cpp:61