Eclipse SUMO - Simulation of Urban MObility
NLEdgeControlBuilder.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-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
17 // Interface for building edges
18 /****************************************************************************/
19 #ifndef NLEdgeControlBuilder_h
20 #define NLEdgeControlBuilder_h
21 
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #include <config.h>
27 
28 #include <string>
29 #include <vector>
30 #include <microsim/MSEdge.h>
32 
33 
34 // ===========================================================================
35 // class declarations
36 // ===========================================================================
37 class MSEdgeControl;
38 class MSLane;
39 class MSNet;
40 class OutputDevice;
41 
42 
43 // ===========================================================================
44 // class definitions
45 // ===========================================================================
58 
59 public:
62 
63 
65  virtual ~NLEdgeControlBuilder();
66 
67 
80  void beginEdgeParsing(const std::string& id, const SumoXMLEdgeFunc function,
81  const std::string& streetName, const std::string& edgeType,
82  int priority,
83  const std::string& bidi,
84  double distance);
85 
86 
100  virtual MSLane* addLane(const std::string& id, double maxSpeed,
101  double length, const PositionVector& shape,
102  double width,
103  SVCPermissions permissions, int index, bool isRampAccel,
104  const std::string& type);
105 
108  void addStopOffsets(const std::map<SVCPermissions, double>& stopOffsets);
109 
110 
113  std::string reportCurrentEdgeOrLane() const;
114 
115 
121  virtual void addNeigh(const std::string id);
122 
123 
126  virtual MSEdge* closeEdge();
127 
130  void closeLane();
131 
133  MSEdgeControl* build(double networkVersion);
134 
135 
145  virtual MSEdge* buildEdge(const std::string& id, const SumoXMLEdgeFunc function,
146  const std::string& streetName, const std::string& edgeType, const int priority, const double distance);
147 
152  virtual void addCrossingEdges(const std::vector<std::string>&);
153 
154 protected:
157 
160 
163 
166 
168  std::map<SVCPermissions, double> myCurrentDefaultStopOffsets;
169 
172 
174  std::vector<MSLane*>* myLaneStorage;
175 
177  std::map<MSEdge*, std::string> myBidiEdges;
178 
179 
182  void updateCurrentLaneStopOffsets(const std::map<SVCPermissions, double>& stopOffsets);
183 
186  void setDefaultStopOffsets(std::map<SVCPermissions, double> stopOffsets);
187 
191 
192 private:
195 
198 
199 };
200 
201 
202 #endif
203 
204 /****************************************************************************/
205 
NLEdgeControlBuilder::myCurrentNumericalEdgeID
int myCurrentNumericalEdgeID
A running number for edge numbering.
Definition: NLEdgeControlBuilder.h:159
NLEdgeControlBuilder::addLane
virtual MSLane * addLane(const std::string &id, double maxSpeed, double length, const PositionVector &shape, double width, SVCPermissions permissions, int index, bool isRampAccel, const std::string &type)
Adds a lane to the current edge.
Definition: NLEdgeControlBuilder.cpp:79
NLEdgeControlBuilder::~NLEdgeControlBuilder
virtual ~NLEdgeControlBuilder()
Destructor.
Definition: NLEdgeControlBuilder.cpp:52
NLEdgeControlBuilder::myActiveEdge
MSEdge * myActiveEdge
pointer to the currently chosen edge
Definition: NLEdgeControlBuilder.h:165
MSLane
Representation of a lane in the micro simulation.
Definition: MSLane.h:82
NLEdgeControlBuilder::addNeigh
virtual void addNeigh(const std::string id)
Adds a neighbor to the current lane.
Definition: NLEdgeControlBuilder.cpp:157
NLEdgeControlBuilder
Interface for building edges.
Definition: NLEdgeControlBuilder.h:57
OutputDevice
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:63
NLEdgeControlBuilder::myCurrentLaneIndex
int myCurrentLaneIndex
The index of the currently active lane (-1 if none is active)
Definition: NLEdgeControlBuilder.h:171
NLEdgeControlBuilder::applyDefaultStopOffsetsToLanes
void applyDefaultStopOffsetsToLanes()
Definition: NLEdgeControlBuilder.cpp:143
NLEdgeControlBuilder::myCurrentNumericalLaneID
int myCurrentNumericalLaneID
A running number for lane numbering.
Definition: NLEdgeControlBuilder.h:156
MSNet
The simulated network and simulation perfomer.
Definition: MSNet.h:91
NLEdgeControlBuilder::addCrossingEdges
virtual void addCrossingEdges(const std::vector< std::string > &)
add the crossingEdges in a crossing edge if present
Definition: NLEdgeControlBuilder.cpp:229
SumoXMLEdgeFunc
SumoXMLEdgeFunc
Numbers representing special SUMO-XML-attribute values for representing edge functions used in netbui...
Definition: SUMOXMLDefinitions.h:1079
NLEdgeControlBuilder::build
MSEdgeControl * build(double networkVersion)
builds the MSEdgeControl-class which holds all edges
Definition: NLEdgeControlBuilder.cpp:182
NLEdgeControlBuilder::buildEdge
virtual MSEdge * buildEdge(const std::string &id, const SumoXMLEdgeFunc function, const std::string &streetName, const std::string &edgeType, const int priority, const double distance)
Builds an edge instance (MSEdge in this case)
Definition: NLEdgeControlBuilder.cpp:224
MSEdge.h
PositionVector
A list of positions.
Definition: PositionVector.h:45
NLEdgeControlBuilder::addStopOffsets
void addStopOffsets(const std::map< SVCPermissions, double > &stopOffsets)
process a stopOffset element (originates either from the active edge or lane).
Definition: NLEdgeControlBuilder.cpp:92
SVCPermissions
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
Definition: SUMOVehicleClass.h:218
NLEdgeControlBuilder::closeLane
void closeLane()
Closes the building of a lane; The edge is completely described by now and may not be opened again.
Definition: NLEdgeControlBuilder.cpp:176
NLEdgeControlBuilder::beginEdgeParsing
void beginEdgeParsing(const std::string &id, const SumoXMLEdgeFunc function, const std::string &streetName, const std::string &edgeType, int priority, const std::string &bidi, double distance)
Begins building of an MSEdge.
Definition: NLEdgeControlBuilder.cpp:58
NLEdgeControlBuilder::NLEdgeControlBuilder
NLEdgeControlBuilder()
Constructor.
Definition: NLEdgeControlBuilder.cpp:45
MSEdge
A road/street connecting two junctions.
Definition: MSEdge.h:78
NLEdgeControlBuilder::myCurrentDefaultStopOffsets
std::map< SVCPermissions, double > myCurrentDefaultStopOffsets
The default stop offset for all lanes belonging to the active edge (this is set if the edge was given...
Definition: NLEdgeControlBuilder.h:168
MSEdgeVector
std::vector< MSEdge * > MSEdgeVector
Definition: MSEdge.h:74
NLEdgeControlBuilder::myLaneStorage
std::vector< MSLane * > * myLaneStorage
pointer to a temporary lane storage
Definition: NLEdgeControlBuilder.h:174
NLEdgeControlBuilder::myEdges
MSEdgeVector myEdges
Temporary, internal storage for built edges.
Definition: NLEdgeControlBuilder.h:162
config.h
NLEdgeControlBuilder::reportCurrentEdgeOrLane
std::string reportCurrentEdgeOrLane() const
Return info about currently processed edge or lane.
Definition: NLEdgeControlBuilder.cpp:104
MSEdgeControl
Stores edges and lanes, performs moving of vehicle.
Definition: MSEdgeControl.h:74
NLEdgeControlBuilder::setDefaultStopOffsets
void setDefaultStopOffsets(std::map< SVCPermissions, double > stopOffsets)
set the stopOffset for the last added lane.
Definition: NLEdgeControlBuilder.cpp:131
NLEdgeControlBuilder::closeEdge
virtual MSEdge * closeEdge()
Closes the building of an edge; The edge is completely described by now and may not be opened again.
Definition: NLEdgeControlBuilder.cpp:163
NLEdgeControlBuilder::operator=
NLEdgeControlBuilder & operator=(const NLEdgeControlBuilder &s)
invalidated assignment operator
NLEdgeControlBuilder::myBidiEdges
std::map< MSEdge *, std::string > myBidiEdges
temporary storage for bidi attributes (to be resolved after loading all edges)
Definition: NLEdgeControlBuilder.h:177
PositionVector.h
NLEdgeControlBuilder::updateCurrentLaneStopOffsets
void updateCurrentLaneStopOffsets(const std::map< SVCPermissions, double > &stopOffsets)
set the stopOffset for the last added lane.
Definition: NLEdgeControlBuilder.cpp:115