SUMO - Simulation of Urban MObility
MSRightOfWayJunction.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-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
19 // A junction with right-of-way - rules
20 /****************************************************************************/
21 #ifndef MSRightOfWayJunction_h
22 #define MSRightOfWayJunction_h
23 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
34 #include "MSLogicJunction.h"
35 #include <bitset>
36 #include <vector>
37 #include <string>
38 
39 
40 // ===========================================================================
41 // class declarations
42 // ===========================================================================
43 class MSLane;
44 class MSJunctionLogic;
45 
46 
47 // ===========================================================================
48 // class definitions
49 // ===========================================================================
59 public:
68  MSRightOfWayJunction(const std::string& id, SumoXMLNodeType type, const Position& position,
69  const PositionVector& shape,
70  std::vector<MSLane*> incoming,
71  std::vector<MSLane*> internal,
72  MSJunctionLogic* logic);
73 
75  virtual ~MSRightOfWayJunction();
76 
77  void postloadInit();
78 
79  const std::vector<MSLink*>& getFoeLinks(const MSLink* const srcLink) const {
80  return myLinkFoeLinks.find(srcLink)->second;
81  }
82 
83  const std::vector<MSLane*>& getFoeInternalLanes(const MSLink* const srcLink) const {
84  return myLinkFoeInternalLanes.find(srcLink)->second;
85  }
86 
87  // @brief return the underlying right-of-way and conflict matrix
88  const MSJunctionLogic* getLogic() const {
89  return myLogic;
90  }
91 
92 protected:
95 
96  // TODO: Documentation
97  std::map<const MSLink*, std::vector<MSLink*> > myLinkFoeLinks;
98  std::map<const MSLink*, std::vector<MSLane*> > myLinkFoeInternalLanes;
99 
100 
101 private:
104 
107 
108 };
109 
110 
111 #endif
112 
113 /****************************************************************************/
114 
MSRightOfWayJunction & operator=(const MSRightOfWayJunction &)
Invalidated assignment operator.
MSJunctionLogic * myLogic
const MSJunctionLogic * getLogic() const
void postloadInit()
initialises the junction after the whole net has been loaded
virtual ~MSRightOfWayJunction()
Destructor.
const std::vector< MSLane * > & getFoeInternalLanes(const MSLink *const srcLink) const
std::map< const MSLink *, std::vector< MSLink * > > myLinkFoeLinks
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:45
A list of positions.
MSRightOfWayJunction(const std::string &id, SumoXMLNodeType type, const Position &position, const PositionVector &shape, std::vector< MSLane *> incoming, std::vector< MSLane *> internal, MSJunctionLogic *logic)
Constructor.
std::map< const MSLink *, std::vector< MSLane * > > myLinkFoeInternalLanes
const std::vector< MSLink * > & getFoeLinks(const MSLink *const srcLink) const
SumoXMLNodeType
Numbers representing special SUMO-XML-attribute values for representing node- (junction-) types used ...
A junction with right-of-way - rules.
Representation of a lane in the micro simulation.
Definition: MSLane.h:77