SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
NBAlgorithms_Ramps.h
Go to the documentation of this file.
1 /****************************************************************************/
7 // Algorithms for highway on-/off-ramps computation
8 /****************************************************************************/
9 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
10 // Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors
11 /****************************************************************************/
12 //
13 // This file is part of SUMO.
14 // SUMO is free software: you can redistribute it and/or modify
15 // it under the terms of the GNU General Public License as published by
16 // the Free Software Foundation, either version 3 of the License, or
17 // (at your option) any later version.
18 //
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:
73  static bool mayNeedOnRamp(NBNode* cur, SUMOReal minHighwaySpeed, SUMOReal maxRampSpeed);
74 
75 
82  static bool mayNeedOffRamp(NBNode* cur, SUMOReal minHighwaySpeed, SUMOReal maxRampSpeed);
83 
84 
94  static void buildOnRamp(NBNode* cur, NBNodeCont& nc, NBEdgeCont& ec, NBDistrictCont& dc, SUMOReal rampLength, bool dontSplit, std::set<NBEdge*>& incremented);
95 
96 
106  static void buildOffRamp(NBNode* cur, NBNodeCont& nc, NBEdgeCont& ec, NBDistrictCont& dc, SUMOReal rampLength, bool dontSplit, std::set<NBEdge*>& incremented);
107 
108 
109  static void getOnRampEdges(NBNode* n, NBEdge** potHighway, NBEdge** potRamp, NBEdge** other);
110  static void getOffRampEdges(NBNode* n, NBEdge** potHighway, NBEdge** potRamp, NBEdge** other);
111  static bool determinedBySpeed(NBEdge** potHighway, NBEdge** potRamp);
112  static bool determinedByLaneNumber(NBEdge** potHighway, NBEdge** potRamp);
113 
126  static bool fulfillsRampConstraints(NBEdge* potHighway, NBEdge* potRamp, NBEdge* other, SUMOReal minHighwaySpeed, SUMOReal maxRampSpeed);
127 
128 
133  static void moveRampRight(NBEdge* ramp, int addedLanes);
134 
135 };
136 
137 
138 #endif
139 
140 /****************************************************************************/
141 
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:74
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