SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
NBRampsComputer Class Reference

#include <NBAlgorithms_Ramps.h>

Static Public Member Functions

static void computeRamps (NBNetBuilder &nb, OptionsCont &oc)
 Computes highway on-/off-ramps (if wished) More...
 

Static Public Attributes

static const std::string ADDED_ON_RAMP_EDGE
 suffix for newly generated on-ramp edges More...
 

Static Private Member Functions

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. More...
 
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. More...
 
static bool determinedByLaneNumber (NBEdge **potHighway, NBEdge **potRamp)
 
static bool determinedBySpeed (NBEdge **potHighway, NBEdge **potRamp)
 
static bool fulfillsRampConstraints (NBEdge *potHighway, NBEdge *potRamp, NBEdge *other, SUMOReal minHighwaySpeed, SUMOReal maxRampSpeed)
 Checks whether an on-/off-ramp can be bult here. More...
 
static void getOffRampEdges (NBNode *n, NBEdge **potHighway, NBEdge **potRamp, NBEdge **other)
 
static void getOnRampEdges (NBNode *n, NBEdge **potHighway, NBEdge **potRamp, NBEdge **other)
 
static bool mayNeedOffRamp (NBNode *cur, SUMOReal minHighwaySpeed, SUMOReal maxRampSpeed)
 Determines whether the given node may be an off-ramp end. More...
 
static bool mayNeedOnRamp (NBNode *cur, SUMOReal minHighwaySpeed, SUMOReal maxRampSpeed)
 Determines whether the given node may be an on-ramp begin. More...
 
static void moveRampRight (NBEdge *ramp, int addedLanes)
 Moves the ramp to the right, as new lanes were added. More...
 

Detailed Description

Definition at line 55 of file NBAlgorithms_Ramps.h.

Member Function Documentation

void NBRampsComputer::buildOffRamp ( NBNode cur,
NBNodeCont nc,
NBEdgeCont ec,
NBDistrictCont dc,
SUMOReal  rampLength,
bool  dontSplit,
std::set< NBEdge * > &  incremented 
)
staticprivate

Builds an off-ramp ending at the given node.

Parameters
[in]curThe node at which the off-ramp shall end
[in]ncThe container of nodes
[in]ecThe container of edges
[in]dcThe container of districts
[in]rampLengthThe wished ramp length
[in]dontSplitWhether no edges shall be split
in,filled]incremented The list of edges which lane number was already incremented

Definition at line 227 of file NBAlgorithms_Ramps.cpp.

References NBEdge::addLane2LaneConnections(), NBEdge::getFromNode(), NBEdge::getGeometry(), Named::getID(), NBNode::getIncomingEdges(), NBEdge::getLaneShape(), NBEdge::getLength(), NBEdge::getNumLanes(), getOffRampEdges(), NBEdge::incLaneNo(), NBNodeCont::insert(), NBEdge::invalidateConnections(), NBEdge::L2L_VALIDATED, PositionVector::length(), MIN2(), moveRampRight(), PositionVector::pop_front(), POSITION_EPS, PositionVector::positionAtOffset(), PositionVector::push_front(), NBEdgeCont::retrieve(), NBEdge::setGeometry(), NBEdgeCont::splitAt(), SUMOReal, WRITE_ERROR, and WRITE_WARNING.

Referenced by computeRamps().

void NBRampsComputer::buildOnRamp ( NBNode cur,
NBNodeCont nc,
NBEdgeCont ec,
NBDistrictCont dc,
SUMOReal  rampLength,
bool  dontSplit,
std::set< NBEdge * > &  incremented 
)
staticprivate

Builds an on-ramp starting at the given node.

Parameters
[in]curThe node at which the on-ramp shall begin
[in]ncThe container of nodes
[in]ecThe container of edges
[in]dcThe container of districts
[in]rampLengthThe wished ramp length
[in]dontSplitWhether no edges shall be split
in,filled]incremented The list of edges which lane number was already incremented

Definition at line 142 of file NBAlgorithms_Ramps.cpp.

References ADDED_ON_RAMP_EDGE, NBEdge::addLane2LaneConnections(), NBEdge::getGeometry(), Named::getID(), NBEdge::getLaneShape(), NBEdge::getLength(), NBEdge::getNumLanes(), getOnRampEdges(), NBNode::getOutgoingEdges(), NBEdge::getToNode(), NBEdge::incLaneNo(), NBNodeCont::insert(), NBEdge::invalidateConnections(), NBEdge::L2L_VALIDATED, PositionVector::length(), MIN2(), moveRampRight(), POSITION_EPS, PositionVector::positionAtOffset(), PositionVector::push_back(), NBEdgeCont::retrieve(), NBEdge::setGeometry(), NBEdgeCont::splitAt(), SUMOReal, WRITE_ERROR, and WRITE_WARNING.

Referenced by computeRamps().

void NBRampsComputer::computeRamps ( NBNetBuilder nb,
OptionsCont oc 
)
static
bool NBRampsComputer::determinedByLaneNumber ( NBEdge **  potHighway,
NBEdge **  potRamp 
)
staticprivate

Definition at line 340 of file NBAlgorithms_Ramps.cpp.

bool NBRampsComputer::determinedBySpeed ( NBEdge **  potHighway,
NBEdge **  potRamp 
)
staticprivate

Definition at line 328 of file NBAlgorithms_Ramps.cpp.

bool NBRampsComputer::fulfillsRampConstraints ( NBEdge potHighway,
NBEdge potRamp,
NBEdge other,
SUMOReal  minHighwaySpeed,
SUMOReal  maxRampSpeed 
)
staticprivate

Checks whether an on-/off-ramp can be bult here.

  • none of the participating edges must be a macroscopic connector
  • ramp+highways together must have more lanes than the continuation
  • speeds must match the defined swells
    Parameters
    [in]potHighwayThe highway part to check
    [in]potRampThe ramp part to check
    [in]otherThe successor/predecessor edge
    [in]minHighwaySpeedThe minimum speed limit a highway must have for being a highway
    [in]maxRampSpeedThe maximum speed limit a ramp must have for being a ramp
    Returns
    Whether a ramp can be built here

Definition at line 406 of file NBAlgorithms_Ramps.cpp.

References NBEdge::getNumLanes(), NBEdge::getPermissions(), NBEdge::getSpeed(), NBEdge::isMacroscopicConnector(), isRailway(), MAX3(), and SUMOReal.

Referenced by mayNeedOffRamp(), and mayNeedOnRamp().

void NBRampsComputer::getOffRampEdges ( NBNode n,
NBEdge **  potHighway,
NBEdge **  potRamp,
NBEdge **  other 
)
staticprivate
void NBRampsComputer::getOnRampEdges ( NBNode n,
NBEdge **  potHighway,
NBEdge **  potRamp,
NBEdge **  other 
)
staticprivate
bool NBRampsComputer::mayNeedOffRamp ( NBNode cur,
SUMOReal  minHighwaySpeed,
SUMOReal  maxRampSpeed 
)
staticprivate

Determines whether the given node may be an off-ramp end.

Parameters
[in]curThe node to check
[in]minHighwaySpeedThe minimum speed limit a highway must have for being a highway
[in]maxRampSpeedThe maximum speed limit a ramp must have for being a ramp
Returns
Whether the node is assumed to be an off-ramp end

Definition at line 130 of file NBAlgorithms_Ramps.cpp.

References fulfillsRampConstraints(), NBNode::getIncomingEdges(), getOffRampEdges(), and NBNode::getOutgoingEdges().

Referenced by computeRamps().

bool NBRampsComputer::mayNeedOnRamp ( NBNode cur,
SUMOReal  minHighwaySpeed,
SUMOReal  maxRampSpeed 
)
staticprivate

Determines whether the given node may be an on-ramp begin.

Parameters
[in]curThe node to check
[in]minHighwaySpeedThe minimum speed limit a highway must have for being a highway
[in]maxRampSpeedThe maximum speed limit a ramp must have for being a ramp
Returns
Whether the node is assumed to be an on-ramp begin

Definition at line 118 of file NBAlgorithms_Ramps.cpp.

References fulfillsRampConstraints(), NBNode::getIncomingEdges(), getOnRampEdges(), and NBNode::getOutgoingEdges().

Referenced by computeRamps().

void NBRampsComputer::moveRampRight ( NBEdge ramp,
int  addedLanes 
)
staticprivate

Moves the ramp to the right, as new lanes were added.

Parameters
[in]rampThe ramp to move
[in]addedLanesThe number of added lanes

Definition at line 312 of file NBAlgorithms_Ramps.cpp.

References NBEdge::getGeometry(), Named::getID(), NBEdge::getLaneSpreadFunction(), LANESPREAD_CENTER, PositionVector::move2side(), NBEdge::setGeometry(), SUMO_const_halfLaneAndOffset, SUMO_const_laneWidthAndOffset, SUMOReal, and WRITE_WARNING.

Referenced by buildOffRamp(), and buildOnRamp().

Field Documentation

const std::string NBRampsComputer::ADDED_ON_RAMP_EDGE
static

suffix for newly generated on-ramp edges

Definition at line 64 of file NBAlgorithms_Ramps.h.

Referenced by buildOnRamp().


The documentation for this class was generated from the following files: