Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
NBRampsComputer Class Reference

#include <NBAlgorithms_Ramps.h>

Static Public Member Functions

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

Static Public Attributes

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

Static Private Member Functions

static void buildOffRamp (NBNode *cur, NBNodeCont &nc, NBEdgeCont &ec, NBDistrictCont &dc, double rampLength, bool dontSplit, bool addLanes, const std::set< NBNode *, ComparatorIdLess > &potOnRamps)
 Builds an off-ramp ending at the given node.
 
static void buildOnRamp (NBNode *cur, NBNodeCont &nc, NBEdgeCont &ec, NBDistrictCont &dc, double rampLength, bool dontSplit, bool addLanes)
 Builds an on-ramp starting at the given node.
 
static bool determinedByLaneNumber (NBEdge **potHighway, NBEdge **potRamp)
 
static bool determinedBySpeed (NBEdge **potHighway, NBEdge **potRamp)
 
static bool fulfillsRampConstraints (NBEdge *potHighway, NBEdge *potRamp, NBEdge *other, double minHighwaySpeed, double maxRampSpeed, const std::set< std::string > &noramps)
 Checks whether an on-/off-ramp can be bult here.
 
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
 
static bool mayNeedOffRamp (NBNode *cur, double minHighwaySpeed, double maxRampSpeed, const std::set< std::string > &noramps)
 Determines whether the given node may be an off-ramp end.
 
static bool mayNeedOnRamp (NBNode *cur, double minHighwaySpeed, double maxRampSpeed, const std::set< std::string > &noramps, double minWeaveLength)
 Determines whether the given node may be an on-ramp begin.
 
static void moveRampRight (NBEdge *ramp, int addedLanes)
 Moves the ramp to the right, as new lanes were added.
 
static void patchRampGeometry (NBEdge *potRamp, NBEdge *first, NBEdge *potHighway, bool onRamp)
 shift ramp geometry to merge smoothly with the motorway
 

Detailed Description

Definition at line 46 of file NBAlgorithms_Ramps.h.

Member Function Documentation

◆ buildOffRamp()

void NBRampsComputer::buildOffRamp ( NBNode cur,
NBNodeCont nc,
NBEdgeCont ec,
NBDistrictCont dc,
double  rampLength,
bool  dontSplit,
bool  addLanes,
const std::set< NBNode *, ComparatorIdLess > &  potOnRamps 
)
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 298 of file NBAlgorithms_Ramps.cpp.

References NBEdge::addLane2LaneConnections(), DEBUGCOND, NBEdge::getFromNode(), NBEdge::getGeometry(), NBEdge::getID(), Named::getID(), NBNode::getIncomingEdges(), NBEdge::getLoadedLength(), NBEdge::getNumLanes(), getOffRampEdges(), getOnRampEdges(), NBNode::getOutgoingEdges(), NBEdge::getStep(), NBEdge::getToNode(), NBEdge::incLaneNo(), NBNodeCont::insert(), NBEdge::invalidateConnections(), NBEdge::isTurningDirectionAt(), NBEdge::LANES2LANES_USER, PositionVector::length(), NBEdge::markOffRamp(), MIN2(), moveRampRight(), OFFRAMP_LOOKBACK, patchRampGeometry(), PositionVector::positionAtOffset(), NBEdgeCont::retrieve(), NBEdgeCont::splitAt(), TL, TLF, NBEdge::VALIDATED, WRITE_ERRORF, and WRITE_WARNING.

Referenced by computeRamps().

Here is the caller graph for this function:

◆ buildOnRamp()

void NBRampsComputer::buildOnRamp ( NBNode cur,
NBNodeCont nc,
NBEdgeCont ec,
NBDistrictCont dc,
double  rampLength,
bool  dontSplit,
bool  addLanes 
)
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 193 of file NBAlgorithms_Ramps.cpp.

References ADDED_ON_RAMP_EDGE, NBEdge::addLane2LaneConnections(), DEBUGCOND, NBEdge::getGeometry(), NBEdge::getID(), Named::getID(), NBNode::getIncomingEdges(), NBEdge::getNumLanes(), getOnRampEdges(), NBNode::getOutgoingEdges(), NBEdge::getStep(), NBEdge::getToNode(), NBEdge::incLaneNo(), NBNodeCont::insert(), NBEdge::invalidateConnections(), NBEdge::isTurningDirectionAt(), NBEdge::LANES2LANES_USER, PositionVector::length(), MIN2(), moveRampRight(), patchRampGeometry(), PositionVector::positionAtOffset(), NBEdgeCont::retrieve(), NBEdge::setAcceleration(), NBEdgeCont::splitAt(), TL, TLF, NBEdge::VALIDATED, WRITE_ERRORF, and WRITE_WARNING.

Referenced by computeRamps().

Here is the caller graph for this function:

◆ computeRamps()

void NBRampsComputer::computeRamps ( NBNetBuilder nb,
OptionsCont oc,
bool  mayAddOrRemove 
)
static

Computes highway on-/off-ramps (if wished)

Parameters
[in,changed]nb The network builder which contains the current network representation
[in]ocThe options container

Definition at line 52 of file NBAlgorithms_Ramps.cpp.

References NBParkingCont::addEdges2Keep(), NBPTStopCont::addEdges2Keep(), buildOffRamp(), buildOnRamp(), DEBUGCOND, OptionsCont::getBool(), NBNetBuilder::getDistrictCont(), NBNetBuilder::getEdgeCont(), OptionsCont::getFloat(), NBEdge::getFromNode(), Named::getID(), NBNode::getIncomingEdges(), NBNetBuilder::getNodeCont(), NBNode::getOutgoingEdges(), NBNetBuilder::getParkingCont(), NBNetBuilder::getPTStopCont(), NBEdgeCont::getRoundabouts(), OptionsCont::getStringVector(), NBEdge::getToNode(), OptionsCont::isSet(), mayNeedOffRamp(), mayNeedOnRamp(), NBEdgeCont::retrieve(), TL, and WRITE_WARNINGF.

Referenced by NBNetBuilder::compute().

Here is the caller graph for this function:

◆ determinedByLaneNumber()

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

Definition at line 441 of file NBAlgorithms_Ramps.cpp.

References std::swap().

◆ determinedBySpeed()

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

Definition at line 429 of file NBAlgorithms_Ramps.cpp.

References std::swap().

◆ fulfillsRampConstraints()

bool NBRampsComputer::fulfillsRampConstraints ( NBEdge potHighway,
NBEdge potRamp,
NBEdge other,
double  minHighwaySpeed,
double  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 515 of file NBAlgorithms_Ramps.cpp.

References NBEdge::getAngleAtNode(), NBEdge::getFromNode(), NBEdge::getID(), NBEdge::getNumLanes(), NBEdge::getSpeed(), NBEdge::getToNode(), NBNode::getType(), hasWrongMode(), NBEdge::isMacroscopicConnector(), NBNode::isTrafficLight(), NBEdge::isTurningDirectionAt(), MAX3(), and NBHelpers::relAngle().

Referenced by mayNeedOffRamp(), and mayNeedOnRamp().

Here is the caller graph for this function:

◆ getOffRampEdges()

void NBRampsComputer::getOffRampEdges ( NBNode n,
NBEdge **  potHighway,
NBEdge **  potRamp,
NBEdge **  other 
)
staticprivate

Definition at line 477 of file NBAlgorithms_Ramps.cpp.

References DEBUGCOND, NBNode::getEdges(), NBNode::getIncomingEdges(), NBNode::getOutgoingEdges(), NBContHelper::nextCW(), std::swap(), and toString().

Referenced by buildOffRamp(), and mayNeedOffRamp().

Here is the caller graph for this function:

◆ getOnRampEdges()

void NBRampsComputer::getOnRampEdges ( NBNode n,
NBEdge **  potHighway,
NBEdge **  potRamp,
NBEdge **  other 
)
staticprivate

Definition at line 453 of file NBAlgorithms_Ramps.cpp.

References NBNode::getIncomingEdges(), NBNode::getOutgoingEdges(), and std::swap().

Referenced by buildOffRamp(), buildOnRamp(), and mayNeedOnRamp().

Here is the caller graph for this function:

◆ hasWrongMode()

bool NBRampsComputer::hasWrongMode ( NBEdge edge)
staticprivate

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

Definition at line 581 of file NBAlgorithms_Ramps.cpp.

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

Referenced by fulfillsRampConstraints().

Here is the caller graph for this function:

◆ mayNeedOffRamp()

bool NBRampsComputer::mayNeedOffRamp ( NBNode cur,
double  minHighwaySpeed,
double  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 176 of file NBAlgorithms_Ramps.cpp.

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

Referenced by computeRamps().

Here is the caller graph for this function:

◆ mayNeedOnRamp()

bool NBRampsComputer::mayNeedOnRamp ( NBNode cur,
double  minHighwaySpeed,
double  maxRampSpeed,
const std::set< std::string > &  noramps,
double  minWeaveLength 
)
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
[in]minWeaveLengthThe minimum length for weaving areas
Returns
Whether the node is assumed to be an on-ramp begin

Definition at line 144 of file NBAlgorithms_Ramps.cpp.

References DEBUGCOND, fulfillsRampConstraints(), NBEdge::getID(), NBNode::getIncomingEdges(), NBEdge::getLength(), getOnRampEdges(), NBNode::getOutgoingEdges(), and NBEdge::getToNode().

Referenced by computeRamps().

Here is the caller graph for this function:

◆ moveRampRight()

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 412 of file NBAlgorithms_Ramps.cpp.

References CENTER, NBEdge::getGeometry(), NBEdge::getID(), NBEdge::getLaneSpreadFunction(), NBEdge::getLaneWidth(), PositionVector::move2side(), NBEdge::setGeometry(), SUMO_const_laneWidth, TL, NBEdge::UNSPECIFIED_WIDTH, and WRITE_WARNINGF.

Referenced by buildOffRamp(), and buildOnRamp().

Here is the caller graph for this function:

◆ patchRampGeometry()

void NBRampsComputer::patchRampGeometry ( NBEdge potRamp,
NBEdge first,
NBEdge potHighway,
bool  onRamp 
)
staticprivate

shift ramp geometry to merge smoothly with the motorway

Definition at line 596 of file NBAlgorithms_Ramps.cpp.

References CENTER, NBEdge::getFromNode(), NBEdge::getGeometry(), NBEdge::getLaneShape(), NBEdge::getLaneSpreadFunction(), NBEdge::getLaneWidth(), NBEdge::getNumLanes(), NBEdge::getToNode(), NBEdge::hasDefaultGeometryEndpointAtNode(), NBEdge::hasDefaultGeometryEndpoints(), MAX2(), MIN2(), PositionVector::move2side(), NBEdge::resetLaneShapes(), RIGHT, and NBEdge::setGeometry().

Referenced by buildOffRamp(), and buildOnRamp().

Here is the caller graph for this function:

Field Documentation

◆ ADDED_ON_RAMP_EDGE

const std::string NBRampsComputer::ADDED_ON_RAMP_EDGE
static

suffix for newly generated on-ramp edges

Definition at line 55 of file NBAlgorithms_Ramps.h.

Referenced by buildOnRamp().


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