SUMO - Simulation of Urban MObility
NBAlgorithms_Ramps.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2012-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 /****************************************************************************/
18 // Algorithms for highway on-/off-ramps computation
19 /****************************************************************************/
20 #ifndef NBAlgorithms_Ramps_h
21 #define NBAlgorithms_Ramps_h
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #ifdef _MSC_VER
28 #include <windows_config.h>
29 #else
30 #include <config.h>
31 #endif
32 
33 #include <vector>
34 
35 
36 // ===========================================================================
37 // class declarations
38 // ===========================================================================
39 class NBNetBuilder;
40 class OptionsCont;
41 class NBNode;
42 class NBEdgeCont;
43 class NBDistrictCont;
44 
45 
46 // ===========================================================================
47 // class definitions
48 // ===========================================================================
49 // ---------------------------------------------------------------------------
50 // NBAlgorithms_Ramps
51 // ---------------------------------------------------------------------------
52 /* @class NBRampsComputer
53  * @brief Computes highway on-/off-ramps (if wished)
54  */
56 public:
61  static void computeRamps(NBNetBuilder& nb, OptionsCont& oc);
62 
64  static const std::string ADDED_ON_RAMP_EDGE;
65 
66 private:
74  static bool mayNeedOnRamp(NBNode* cur, double minHighwaySpeed, double maxRampSpeed,
75  const std::set<std::string>& noramps);
76 
77 
85  static bool mayNeedOffRamp(NBNode* cur, double minHighwaySpeed, double maxRampSpeed,
86  const std::set<std::string>& noramps);
87 
88 
98  static void buildOnRamp(NBNode* cur, NBNodeCont& nc, NBEdgeCont& ec, NBDistrictCont& dc, double rampLength, bool dontSplit);
99 
100 
110  static void buildOffRamp(NBNode* cur, NBNodeCont& nc, NBEdgeCont& ec, NBDistrictCont& dc, double rampLength, bool dontSplit);
111 
112 
113  static void getOnRampEdges(NBNode* n, NBEdge** potHighway, NBEdge** potRamp, NBEdge** other);
114  static void getOffRampEdges(NBNode* n, NBEdge** potHighway, NBEdge** potRamp, NBEdge** other);
115  static bool determinedBySpeed(NBEdge** potHighway, NBEdge** potRamp);
116  static bool determinedByLaneNumber(NBEdge** potHighway, NBEdge** potRamp);
117 
131  static bool fulfillsRampConstraints(NBEdge* potHighway, NBEdge* potRamp, NBEdge* other, double minHighwaySpeed, double maxRampSpeed,
132  const std::set<std::string>& noramps);
133 
134 
139  static void moveRampRight(NBEdge* ramp, int addedLanes);
140 
142  static bool hasWrongMode(NBEdge* edge);
143 };
144 
145 
146 #endif
147 
148 /****************************************************************************/
149 
static bool determinedBySpeed(NBEdge **potHighway, NBEdge **potRamp)
The representation of a single edge during network building.
Definition: NBEdge.h:70
A container for districts.
static bool mayNeedOffRamp(NBNode *cur, double minHighwaySpeed, double maxRampSpeed, const std::set< std::string > &noramps)
Determines whether the given node may be an off-ramp end.
static void moveRampRight(NBEdge *ramp, int addedLanes)
Moves the ramp to the right, as new lanes were added.
static bool determinedByLaneNumber(NBEdge **potHighway, NBEdge **potRamp)
static const std::string ADDED_ON_RAMP_EDGE
suffix for newly generated on-ramp edges
static bool fulfillsRampConstraints(NBEdge *potHighway, NBEdge *potRamp, NBEdge *other, double minHighwaySpeed, double maxRampSpeed, const std::set< std::string > &noramps)
Checks whether an on-/off-ramp can be bult here.
static bool mayNeedOnRamp(NBNode *cur, double minHighwaySpeed, double maxRampSpeed, const std::set< std::string > &noramps)
Determines whether the given node may be an on-ramp begin.
Storage for edges, including some functionality operating on multiple edges.
Definition: NBEdgeCont.h:66
static void computeRamps(NBNetBuilder &nb, OptionsCont &oc)
Computes highway on-/off-ramps (if wished)
static void getOffRampEdges(NBNode *n, NBEdge **potHighway, NBEdge **potRamp, NBEdge **other)
static void buildOffRamp(NBNode *cur, NBNodeCont &nc, NBEdgeCont &ec, NBDistrictCont &dc, double rampLength, bool dontSplit)
Builds an off-ramp ending at the given node.
Instance responsible for building networks.
Definition: NBNetBuilder.h:115
A storage for options typed value containers)
Definition: OptionsCont.h:98
static void buildOnRamp(NBNode *cur, NBNodeCont &nc, NBEdgeCont &ec, NBDistrictCont &dc, double rampLength, bool dontSplit)
Builds an on-ramp starting at the given node.
Represents a single node (junction) during network building.
Definition: NBNode.h:74
static void getOnRampEdges(NBNode *n, NBEdge **potHighway, NBEdge **potRamp, NBEdge **other)
static bool hasWrongMode(NBEdge *edge)
whether the edge has a mode that does not indicate a ramp edge
Container for nodes during the netbuilding process.
Definition: NBNodeCont.h:66