SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
NBAlgorithms_Ramps.h
Go to the documentation of this file.
1 /****************************************************************************/
8 // Algorithms for highway on-/off-ramps computation
9 /****************************************************************************/
10 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
11 // Copyright (C) 2012-2016 DLR (http://www.dlr.de/) and contributors
12 /****************************************************************************/
13 //
14 // This file is part of SUMO.
15 // SUMO is free software: you can redistribute it and/or modify
16 // it under the terms of the GNU General Public License as published by
17 // the Free Software Foundation, either version 3 of the License, or
18 // (at your option) any later version.
19 //
20 /****************************************************************************/
21 #ifndef NBAlgorithms_Ramps_h
22 #define NBAlgorithms_Ramps_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 <vector>
35 
36 
37 // ===========================================================================
38 // class declarations
39 // ===========================================================================
40 class NBNetBuilder;
41 class OptionsCont;
42 class NBNode;
43 class NBEdgeCont;
44 class NBDistrictCont;
45 
46 
47 // ===========================================================================
48 // class definitions
49 // ===========================================================================
50 // ---------------------------------------------------------------------------
51 // NBAlgorithms_Ramps
52 // ---------------------------------------------------------------------------
53 /* @class NBRampsComputer
54  * @brief Computes highway on-/off-ramps (if wished)
55  */
57 public:
62  static void computeRamps(NBNetBuilder& nb, OptionsCont& oc);
63 
65  static const std::string ADDED_ON_RAMP_EDGE;
66 
67 private:
75  static bool mayNeedOnRamp(NBNode* cur, SUMOReal minHighwaySpeed, SUMOReal maxRampSpeed,
76  const std::set<std::string>& noramps);
77 
78 
86  static bool mayNeedOffRamp(NBNode* cur, SUMOReal minHighwaySpeed, SUMOReal maxRampSpeed,
87  const std::set<std::string>& noramps);
88 
89 
99  static void buildOnRamp(NBNode* cur, NBNodeCont& nc, NBEdgeCont& ec, NBDistrictCont& dc, SUMOReal rampLength, bool dontSplit);
100 
101 
111  static void buildOffRamp(NBNode* cur, NBNodeCont& nc, NBEdgeCont& ec, NBDistrictCont& dc, SUMOReal rampLength, bool dontSplit);
112 
113 
114  static void getOnRampEdges(NBNode* n, NBEdge** potHighway, NBEdge** potRamp, NBEdge** other);
115  static void getOffRampEdges(NBNode* n, NBEdge** potHighway, NBEdge** potRamp, NBEdge** other);
116  static bool determinedBySpeed(NBEdge** potHighway, NBEdge** potRamp);
117  static bool determinedByLaneNumber(NBEdge** potHighway, NBEdge** potRamp);
118 
132  static bool fulfillsRampConstraints(NBEdge* potHighway, NBEdge* potRamp, NBEdge* other, SUMOReal minHighwaySpeed, SUMOReal maxRampSpeed,
133  const std::set<std::string>& noramps);
134 
135 
140  static void moveRampRight(NBEdge* ramp, int addedLanes);
141 
143  static bool hasWrongMode(NBEdge* edge);
144 };
145 
146 
147 #endif
148 
149 /****************************************************************************/
150 
static bool determinedBySpeed(NBEdge **potHighway, NBEdge **potRamp)
static bool fulfillsRampConstraints(NBEdge *potHighway, NBEdge *potRamp, NBEdge *other, SUMOReal minHighwaySpeed, SUMOReal maxRampSpeed, const std::set< std::string > &noramps)
Checks whether an on-/off-ramp can be bult here.
The representation of a single edge during network building.
Definition: NBEdge.h:71
A container for districts.
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 void buildOnRamp(NBNode *cur, NBNodeCont &nc, NBEdgeCont &ec, NBDistrictCont &dc, SUMOReal rampLength, bool dontSplit)
Builds an on-ramp starting at the given node.
Storage for edges, including some functionality operating on multiple edges.
Definition: NBEdgeCont.h:66
static bool mayNeedOnRamp(NBNode *cur, SUMOReal minHighwaySpeed, SUMOReal maxRampSpeed, const std::set< std::string > &noramps)
Determines whether the given node may be an on-ramp begin.
static void computeRamps(NBNetBuilder &nb, OptionsCont &oc)
Computes highway on-/off-ramps (if wished)
static bool mayNeedOffRamp(NBNode *cur, SUMOReal minHighwaySpeed, SUMOReal maxRampSpeed, const std::set< std::string > &noramps)
Determines whether the given node may be an off-ramp end.
static void getOffRampEdges(NBNode *n, NBEdge **potHighway, NBEdge **potRamp, NBEdge **other)
Instance responsible for building networks.
Definition: NBNetBuilder.h:112
A storage for options typed value containers)
Definition: OptionsCont.h:99
Represents a single node (junction) during network building.
Definition: NBNode.h:74
static void getOnRampEdges(NBNode *n, NBEdge **potHighway, NBEdge **potRamp, NBEdge **other)
#define SUMOReal
Definition: config.h:214
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:63
static void buildOffRamp(NBNode *cur, NBNodeCont &nc, NBEdgeCont &ec, NBDistrictCont &dc, SUMOReal rampLength, bool dontSplit)
Builds an off-ramp ending at the given node.