SUMO - Simulation of Urban MObility
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-sim.org/
11 // Copyright (C) 2012-2014 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:
74  static bool mayNeedOnRamp(NBNode* cur, SUMOReal minHighwaySpeed, SUMOReal maxRampSpeed);
75 
76 
83  static bool mayNeedOffRamp(NBNode* cur, SUMOReal minHighwaySpeed, SUMOReal maxRampSpeed);
84 
85 
95  static void buildOnRamp(NBNode* cur, NBNodeCont& nc, NBEdgeCont& ec, NBDistrictCont& dc, SUMOReal rampLength, bool dontSplit, std::set<NBEdge*>& incremented);
96 
97 
107  static void buildOffRamp(NBNode* cur, NBNodeCont& nc, NBEdgeCont& ec, NBDistrictCont& dc, SUMOReal rampLength, bool dontSplit, std::set<NBEdge*>& incremented);
108 
109 
110  static void getOnRampEdges(NBNode* n, NBEdge** potHighway, NBEdge** potRamp, NBEdge** other);
111  static void getOffRampEdges(NBNode* n, NBEdge** potHighway, NBEdge** potRamp, NBEdge** other);
112  static bool determinedBySpeed(NBEdge** potHighway, NBEdge** potRamp);
113  static bool determinedByLaneNumber(NBEdge** potHighway, NBEdge** potRamp);
114 
127  static bool fulfillsRampConstraints(NBEdge* potHighway, NBEdge* potRamp, NBEdge* other, SUMOReal minHighwaySpeed, SUMOReal maxRampSpeed);
128 
129 
134  static void moveRampRight(NBEdge* ramp, int addedLanes);
135 
136 };
137 
138 
139 #endif
140 
141 /****************************************************************************/
142 
static bool determinedBySpeed(NBEdge **potHighway, NBEdge **potRamp)
static bool mayNeedOnRamp(NBNode *cur, SUMOReal minHighwaySpeed, SUMOReal maxRampSpeed)
Determines whether the given node may be an on-ramp begin.
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 void buildOnRamp(NBNode *cur, NBNodeCont &nc, NBEdgeCont &ec, NBDistrictCont &dc, SUMOReal rampLength, bool dontSplit, std::set< NBEdge * > &incremented)
Builds an on-ramp starting at the given node.
static bool determinedByLaneNumber(NBEdge **potHighway, NBEdge **potRamp)
static const std::string ADDED_ON_RAMP_EDGE
suffix for newly generated on-ramp edges
static void buildOffRamp(NBNode *cur, NBNodeCont &nc, NBEdgeCont &ec, NBDistrictCont &dc, SUMOReal rampLength, bool dontSplit, std::set< NBEdge * > &incremented)
Builds an off-ramp ending at the given node.
Storage for edges, including some functionality operating on multiple edges.
Definition: NBEdgeCont.h:66
static bool mayNeedOffRamp(NBNode *cur, SUMOReal minHighwaySpeed, SUMOReal maxRampSpeed)
Determines whether the given node may be an off-ramp end.
static bool fulfillsRampConstraints(NBEdge *potHighway, NBEdge *potRamp, NBEdge *other, SUMOReal minHighwaySpeed, SUMOReal maxRampSpeed)
Checks whether an on-/off-ramp can be bult here.
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)
Instance responsible for building networks.
Definition: NBNetBuilder.h:113
A storage for options typed value containers)
Definition: OptionsCont.h:108
Represents a single node (junction) during network building.
Definition: NBNode.h:75
static void getOnRampEdges(NBNode *n, NBEdge **potHighway, NBEdge **potRamp, NBEdge **other)
#define SUMOReal
Definition: config.h:215
Container for nodes during the netbuilding process.
Definition: NBNodeCont.h:64