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.dlr.de/
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>
45 
46 
47 class MSVehicle;
48 class MSLink;
49 class MSLane;
50 class MSEdge;
51 
52 // ===========================================================================
53 // class definitions
54 // ===========================================================================
59 class MSJunction : public Named {
60 public:
66  MSJunction(const std::string& id,
67  SumoXMLNodeType type,
68  const Position& position,
69  const PositionVector& shape);
70 
71 
73  virtual ~MSJunction();
74 
75 
78  virtual void postloadInit();
79 
80 
82  const Position& getPosition() const;
83 
84 
88  const PositionVector& getShape() const {
89  return myShape;
90  }
91 
92  virtual const std::vector<MSLink*>& getFoeLinks(const MSLink* const /*srcLink*/) const {
93  return myEmptyLinks;
94  }
95 
96  virtual const std::vector<MSLane*>& getFoeInternalLanes(const MSLink* const /*srcLink*/) const {
97  return myEmptyLanes;
98  }
99 
100  inline const std::vector<const MSEdge*>& getIncoming() const {
101  return myIncoming;
102  }
103 
104  inline const std::vector<const MSEdge*>& getOutgoing() const {
105  return myOutgoing;
106  }
107 
108  void addIncoming(MSEdge* edge) {
109  myIncoming.push_back(edge);
110  }
111 
112  void addOutgoing(MSEdge* edge) {
113  myOutgoing.push_back(edge);
114  }
115 
118  return myType;
119  }
120 
121 
122 protected:
125 
128 
131 
132  std::vector<MSLink*> myEmptyLinks;
133  std::vector<MSLane*> myEmptyLanes;
134 
135 
137  std::vector<const MSEdge*> myIncoming;
139  std::vector<const MSEdge*> myOutgoing;
140 
142  typedef std::map<std::string, MSJunction* > DictType;
143 
144 private:
146  MSJunction(const MSJunction&);
147 
150 
151 };
152 
153 
154 #endif
155 
156 /****************************************************************************/
157 
MSJunction & operator=(const MSJunction &)
Invalidated assignment operator.
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:78
virtual const std::vector< MSLink * > & getFoeLinks(const MSLink *const ) const
Definition: MSJunction.h:92
std::vector< const MSEdge * > myOutgoing
outgoing edges
Definition: MSJunction.h:139
void addIncoming(MSEdge *edge)
Definition: MSJunction.h:108
SumoXMLNodeType myType
Tye type of this junction.
Definition: MSJunction.h:124
The base class for an intersection.
Definition: MSJunction.h:59
const PositionVector & getShape() const
Returns this junction&#39;s shape.
Definition: MSJunction.h:88
std::vector< MSLink * > myEmptyLinks
Definition: MSJunction.h:132
virtual ~MSJunction()
Destructor.
Definition: MSJunction.cpp:57
A road/street connecting two junctions.
Definition: MSEdge.h:75
Position myPosition
The position of the junction.
Definition: MSJunction.h:127
MSJunction(const std::string &id, SumoXMLNodeType type, const Position &position, const PositionVector &shape)
Constructor.
Definition: MSJunction.cpp:52
std::map< std::string, MSJunction * > DictType
definition of the static dictionary type
Definition: MSJunction.h:142
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:137
SumoXMLNodeType getType() const
return the type of this Junction
Definition: MSJunction.h:117
void addOutgoing(MSEdge *edge)
Definition: MSJunction.h:112
const std::vector< const MSEdge * > & getIncoming() const
Definition: MSJunction.h:100
Base class for objects which have an id.
Definition: Named.h:45
const std::vector< const MSEdge * > & getOutgoing() const
Definition: MSJunction.h:104
SumoXMLNodeType
Numbers representing special SUMO-XML-attribute values for representing node- (junction-) types used ...
virtual void postloadInit()
Definition: MSJunction.cpp:67
virtual const std::vector< MSLane * > & getFoeInternalLanes(const MSLink *const ) const
Definition: MSJunction.h:96
PositionVector myShape
The shape of the junction.
Definition: MSJunction.h:130
std::vector< MSLane * > myEmptyLanes
Definition: MSJunction.h:133
Representation of a lane in the micro simulation.
Definition: MSLane.h:77
const Position & getPosition() const
Definition: MSJunction.cpp:61