SUMO - Simulation of Urban MObility
NBRampsComputer Class Reference

#include <NBAlgorithms_Ramps.h>

Collaboration diagram for NBRampsComputer:
Collaboration graph

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)
 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)
 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, const std::set< std::string > &noramps)
 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 hasWrongMode (NBEdge *edge)
 whether the edge has a mode that does not indicate a ramp edge More...
 
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. More...
 
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. 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 56 of file NBAlgorithms_Ramps.h.

Member Function Documentation

void NBRampsComputer::buildOffRamp ( NBNode cur,
NBNodeCont nc,
NBEdgeCont ec,
NBDistrictCont dc,
SUMOReal  rampLength,
bool  dontSplit 
)
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

Definition at line 249 of file NBAlgorithms_Ramps.cpp.

References NBEdge::addLane2LaneConnections(), NBEdge::getFromNode(), NBEdge::getGeometry(), Named::getID(), NBNode::getIncomingEdges(), NBEdge::getLaneShape(), NBEdge::getNumLanes(), getOffRampEdges(), NBEdge::getStep(), NBEdge::incLaneNo(), NBNodeCont::insert(), NBEdge::invalidateConnections(), NBEdge::isTurningDirectionAt(), NBEdge::L2L_VALIDATED, NBEdge::LANES2LANES_USER, PositionVector::length(), MIN2(), moveRampRight(), POSITION_EPS, PositionVector::positionAtOffset(), 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 
)
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

Definition at line 160 of file NBAlgorithms_Ramps.cpp.

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

Referenced by computeRamps().

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

Definition at line 368 of file NBAlgorithms_Ramps.cpp.

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

Definition at line 356 of file NBAlgorithms_Ramps.cpp.

bool NBRampsComputer::fulfillsRampConstraints ( NBEdge potHighway,
NBEdge potRamp,
NBEdge other,
SUMOReal  minHighwaySpeed,
SUMOReal  maxRampSpeed,
const std::set< std::string > &  noramps 
)
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
    [in]norampsEdges that shall not be treated as ramps
    Returns
    Whether a ramp can be built here

Definition at line 434 of file NBAlgorithms_Ramps.cpp.

References NBEdge::getFromNode(), Named::getID(), NBEdge::getNumLanes(), NBEdge::getSpeed(), NBEdge::getToNode(), hasWrongMode(), NBEdge::isMacroscopicConnector(), NBEdge::isTurningDirectionAt(), 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::hasWrongMode ( NBEdge edge)
staticprivate

whether the edge has a mode that does not indicate a ramp edge

Definition at line 485 of file NBAlgorithms_Ramps.cpp.

References NBEdge::getNumLanes(), NBEdge::getPermissions(), SVC_BICYCLE, SVC_PASSENGER, and SVC_PEDESTRIAN.

Referenced by fulfillsRampConstraints().

bool NBRampsComputer::mayNeedOffRamp ( NBNode cur,
SUMOReal  minHighwaySpeed,
SUMOReal  maxRampSpeed,
const std::set< std::string > &  noramps 
)
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
[in]norampsEdges that shall not be treated as ramps
Returns
Whether the node is assumed to be an off-ramp end

Definition at line 148 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,
const std::set< std::string > &  noramps 
)
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
[in]norampsEdges that shall not be treated as ramps
Returns
Whether the node is assumed to be an on-ramp begin

Definition at line 136 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 339 of file NBAlgorithms_Ramps.cpp.

References NBEdge::getGeometry(), Named::getID(), NBEdge::getLaneSpreadFunction(), NBEdge::getLaneWidth(), LANESPREAD_CENTER, PositionVector::move2side(), NBEdge::setGeometry(), SUMO_const_laneWidth, SUMOReal, NBEdge::UNSPECIFIED_WIDTH, 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 65 of file NBAlgorithms_Ramps.h.

Referenced by buildOnRamp().


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