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  const std::string& bidi);
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 
107  void addStopOffsets(const std::map<SVCPermissions, double>& stopOffsets);
108 
109 
112  std::string reportCurrentEdgeOrLane() const;
113 
114 
120  virtual void addNeigh(const std::string id);
121 
122 
125  virtual MSEdge* closeEdge();
126 
129  void closeLane();
130 
132  MSEdgeControl* build(double networkVersion);
133 
134 
144  virtual MSEdge* buildEdge(const std::string& id, const SumoXMLEdgeFunc function,
145  const std::string& streetName, const std::string& edgeType, const int priority);
146 
151  virtual void addCrossingEdges(const std::vector<std::string>&);
152 
153 protected:
156 
159 
162 
165 
167  std::map<SVCPermissions, double> myCurrentDefaultStopOffsets;
168 
171 
173  std::vector<MSLane*>* myLaneStorage;
174 
176  std::map<MSEdge*, std::string> myBidiEdges;
177 
178 
181  void updateCurrentLaneStopOffsets(const std::map<SVCPermissions, double>& stopOffsets);
182 
185  void setDefaultStopOffsets(std::map<SVCPermissions, double> stopOffsets);
186 
190 
191 private:
194 
197 
198 };
199 
200 
201 #endif
202 
203 /****************************************************************************/
204 
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
std::map< MSEdge *, std::string > myBidiEdges
temporary storage for bidi attributes (to be resolved after loading all edges)
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:84
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
void beginEdgeParsing(const std::string &id, const SumoXMLEdgeFunc function, const std::string &streetName, const std::string &edgeType, int priority, const std::string &bidi)
Begins building of an MSEdge.
NLEdgeControlBuilder & operator=(const NLEdgeControlBuilder &s)
invalidated assignment operator
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...
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:78
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...
MSEdgeControl * build(double networkVersion)
builds the MSEdgeControl-class which holds all edges