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-2018 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 /****************************************************************************/
18 // Interface for building edges
19 /****************************************************************************/
20 #ifndef NLEdgeControlBuilder_h
21 #define NLEdgeControlBuilder_h
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #include <config.h>
28 
29 #include <string>
30 #include <vector>
31 #include <microsim/MSEdge.h>
33 
34 
35 // ===========================================================================
36 // class declarations
37 // ===========================================================================
38 class MSEdgeControl;
39 class MSLane;
40 class MSNet;
41 class OutputDevice;
42 
43 
44 // ===========================================================================
45 // class definitions
46 // ===========================================================================
59 
60 public:
63 
64 
66  virtual ~NLEdgeControlBuilder();
67 
68 
81  void beginEdgeParsing(const std::string& id, const SumoXMLEdgeFunc function,
82  const std::string& streetName, const std::string& edgeType,
83  int priority);
84 
85 
99  virtual MSLane* addLane(const std::string& id, double maxSpeed,
100  double length, const PositionVector& shape,
101  double width,
102  SVCPermissions permissions, int index, bool isRampAccel);
103 
106  void addStopOffsets(const std::map<SVCPermissions, double>& stopOffsets);
107 
108 
111  std::string reportCurrentEdgeOrLane() const;
112 
113 
119  virtual void addNeigh(const std::string id);
120 
121 
124  virtual MSEdge* closeEdge();
125 
128  void closeLane();
129 
131  MSEdgeControl* build();
132 
133 
143  virtual MSEdge* buildEdge(const std::string& id, const SumoXMLEdgeFunc function,
144  const std::string& streetName, const std::string& edgeType, const int priority);
145 
150  virtual void addCrossingEdges(const std::vector<std::string>&);
151 
152 protected:
155 
158 
161 
164 
166  std::map<SVCPermissions, double> myCurrentDefaultStopOffsets;
167 
170 
172  std::vector<MSLane*>* myLaneStorage;
173 
174 
177  void updateCurrentLaneStopOffsets(const std::map<SVCPermissions, double>& stopOffsets);
178 
181  void setDefaultStopOffsets(std::map<SVCPermissions, double> stopOffsets);
182 
186 
187 private:
190 
193 
194 };
195 
196 
197 #endif
198 
199 /****************************************************************************/
200 
virtual MSEdge * closeEdge()
Closes the building of an edge; The edge is completely described by now and may not be opened again...
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
void addStopOffsets(const std::map< SVCPermissions, double > &stopOffsets)
process a stopOffset element (originates either from the active edge or lane).
MSEdgeVector myEdges
Temporary, internal storage for built edges.
virtual MSEdge * buildEdge(const std::string &id, const SumoXMLEdgeFunc function, const std::string &streetName, const std::string &edgeType, const int priority)
Builds an edge instance (MSEdge in this case)
MSEdge * myActiveEdge
pointer to the currently chosen edge
void updateCurrentLaneStopOffsets(const std::map< SVCPermissions, double > &stopOffsets)
set the stopOffset for the last added lane.
The simulated network and simulation perfomer.
Definition: MSNet.h:85
void setDefaultStopOffsets(std::map< SVCPermissions, double > stopOffsets)
set the stopOffset for the last added lane.
A road/street connecting two junctions.
Definition: MSEdge.h:75
NLEdgeControlBuilder & operator=(const NLEdgeControlBuilder &s)
invalidated assignment operator
MSEdgeControl * build()
builds the MSEdgeControl-class which holds all edges
A list of positions.
std::vector< MSLane * > * myLaneStorage
pointer to a temporary lane storage
NLEdgeControlBuilder()
Constructor.
Stores edges and lanes, performs moving of vehicle.
Definition: MSEdgeControl.h:67
virtual ~NLEdgeControlBuilder()
Destructor.
std::string reportCurrentEdgeOrLane() const
Return info about currently processed edge or lane.
int myCurrentNumericalEdgeID
A running number for edge numbering.
virtual void addNeigh(const std::string id)
Adds a neighbor to the current lane.
int myCurrentLaneIndex
The index of the currently active lane (-1 if none is active)
void closeLane()
Closes the building of a lane; The edge is completely described by now and may not be opened again...
virtual MSLane * addLane(const std::string &id, double maxSpeed, double length, const PositionVector &shape, double width, SVCPermissions permissions, int index, bool isRampAccel)
Adds a lane to the current edge.
SumoXMLEdgeFunc
Numbers representing special SUMO-XML-attribute values for representing edge functions used in netbui...
void beginEdgeParsing(const std::string &id, const SumoXMLEdgeFunc function, const std::string &streetName, const std::string &edgeType, int priority)
Begins building of an MSEdge.
int myCurrentNumericalLaneID
A running number for lane numbering.
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:64
virtual void addCrossingEdges(const std::vector< std::string > &)
add the crossingEdges in a crossing edge if present
std::vector< MSEdge * > MSEdgeVector
Definition: MSEdge.h:71
Representation of a lane in the micro simulation.
Definition: MSLane.h:71
Interface for building edges.
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...