Eclipse SUMO - Simulation of Urban MObility
|
#include <NBAlgorithms_Ramps.h>
Public Member Functions | |
void | computeRamps (NBNetBuilder &nb, OptionsCont &oc, bool mayAddOrRemove) |
NBRampsComputer () | |
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 | |
Private Member Functions | |
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. | |
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. | |
void | moveRampRight (NBEdge *ramp, int addedLanes) |
Moves the ramp to the right, as new lanes were added. | |
Static Private Member Functions | |
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) |
template<class T > | |
static std::string | getUnusedID (const std::string &prefix, const T &objectCont) |
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 | patchRampGeometry (NBEdge *potRamp, NBEdge *first, NBEdge *potHighway, bool onRamp) |
shift ramp geometry to merge smoothly with the motorway | |
Private Attributes | |
std::map< NBEdge *, double > | myShiftedEdges |
Definition at line 46 of file NBAlgorithms_Ramps.h.
NBRampsComputer::NBRampsComputer | ( | ) |
Computes highway on-/off-ramps (if wished)
[in,changed] | nb The network builder which contains the current network representation | |
[in] | oc | The options container |
Definition at line 54 of file NBAlgorithms_Ramps.cpp.
|
private |
Builds an off-ramp ending at the given node.
[in] | cur | The node at which the off-ramp shall end |
[in] | nc | The container of nodes |
[in] | ec | The container of edges |
[in] | dc | The container of districts |
[in] | rampLength | The wished ramp length |
[in] | dontSplit | Whether no edges shall be split |
[in,filled] | incremented The list of edges which lane number was already incremented |
Definition at line 307 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(), getUnusedID(), NBEdgeCont::hasPostProcessConnection(), NBEdge::incLaneNo(), NBNodeCont::insert(), NBEdge::invalidateConnections(), NBEdge::isTurningDirectionAt(), NBEdge::LANES2LANES_USER, PositionVector::length(), NBEdge::markOffRamp(), MIN2(), moveRampRight(), myShiftedEdges, OFFRAMP_LOOKBACK, patchRampGeometry(), PositionVector::positionAtOffset(), NBEdgeCont::retrieve(), NBEdgeCont::splitAt(), TL, NBEdge::VALIDATED, and WRITE_WARNING.
Referenced by computeRamps().
|
private |
Builds an on-ramp starting at the given node.
[in] | cur | The node at which the on-ramp shall begin |
[in] | nc | The container of nodes |
[in] | ec | The container of edges |
[in] | dc | The container of districts |
[in] | rampLength | The wished ramp length |
[in] | dontSplit | Whether no edges shall be split |
[in,filled] | incremented The list of edges which lane number was already incremented |
Definition at line 198 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(), getUnusedID(), NBEdgeCont::hasPostProcessConnection(), NBEdge::incLaneNo(), NBNodeCont::insert(), NBEdge::invalidateConnections(), NBEdge::isTurningDirectionAt(), NBEdge::LANES2LANES_USER, PositionVector::length(), MIN2(), moveRampRight(), myShiftedEdges, patchRampGeometry(), PositionVector::positionAtOffset(), NBEdgeCont::retrieve(), NBEdge::setAcceleration(), NBEdgeCont::splitAt(), TL, NBEdge::VALIDATED, and WRITE_WARNING.
Referenced by computeRamps().
void NBRampsComputer::computeRamps | ( | NBNetBuilder & | nb, |
OptionsCont & | oc, | ||
bool | mayAddOrRemove | ||
) |
Definition at line 57 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().
|
staticprivate |
Definition at line 458 of file NBAlgorithms_Ramps.cpp.
References std::swap().
Definition at line 446 of file NBAlgorithms_Ramps.cpp.
References std::swap().
|
staticprivate |
Checks whether an on-/off-ramp can be bult here.
[in] | potHighway | The highway part to check |
[in] | potRamp | The ramp part to check |
[in] | other | The successor/predecessor edge |
[in] | minHighwaySpeed | The minimum speed limit a highway must have for being a highway |
[in] | maxRampSpeed | The maximum speed limit a ramp must have for being a ramp |
[in] | noramps | Edges that shall not be treated as ramps |
Definition at line 532 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().
|
staticprivate |
Definition at line 494 of file NBAlgorithms_Ramps.cpp.
References DEBUGCOND, NBNode::getEdges(), NBNode::getIncomingEdges(), NBNode::getOutgoingEdges(), NBContHelper::nextCW(), std::swap(), and toString().
Referenced by buildOffRamp(), and mayNeedOffRamp().
|
staticprivate |
Definition at line 470 of file NBAlgorithms_Ramps.cpp.
References NBNode::getIncomingEdges(), NBNode::getOutgoingEdges(), and std::swap().
Referenced by buildOffRamp(), buildOnRamp(), and mayNeedOnRamp().
|
inlinestaticprivate |
Definition at line 147 of file NBAlgorithms_Ramps.h.
References toString().
Referenced by buildOffRamp(), and buildOnRamp().
|
staticprivate |
whether the edge has a mode that does not indicate a ramp edge
Definition at line 598 of file NBAlgorithms_Ramps.cpp.
References NBEdge::getNumLanes(), NBEdge::getPermissions(), SVC_BICYCLE, SVC_PASSENGER, and SVC_PEDESTRIAN.
Referenced by fulfillsRampConstraints().
|
staticprivate |
Determines whether the given node may be an off-ramp end.
[in] | cur | The node to check |
[in] | minHighwaySpeed | The minimum speed limit a highway must have for being a highway |
[in] | maxRampSpeed | The maximum speed limit a ramp must have for being a ramp |
[in] | noramps | Edges that shall not be treated as ramps |
Definition at line 181 of file NBAlgorithms_Ramps.cpp.
References DEBUGCOND, fulfillsRampConstraints(), NBEdge::getID(), NBNode::getIncomingEdges(), getOffRampEdges(), and NBNode::getOutgoingEdges().
Referenced by computeRamps().
|
staticprivate |
Determines whether the given node may be an on-ramp begin.
[in] | cur | The node to check |
[in] | minHighwaySpeed | The minimum speed limit a highway must have for being a highway |
[in] | maxRampSpeed | The maximum speed limit a ramp must have for being a ramp |
[in] | noramps | Edges that shall not be treated as ramps |
[in] | minWeaveLength | The minimum length for weaving areas |
Definition at line 149 of file NBAlgorithms_Ramps.cpp.
References DEBUGCOND, fulfillsRampConstraints(), NBEdge::getID(), NBNode::getIncomingEdges(), NBEdge::getLength(), getOnRampEdges(), NBNode::getOutgoingEdges(), and NBEdge::getToNode().
Referenced by computeRamps().
|
private |
Moves the ramp to the right, as new lanes were added.
[in] | ramp | The ramp to move |
[in] | addedLanes | The number of added lanes |
Definition at line 425 of file NBAlgorithms_Ramps.cpp.
References CENTER, NBEdge::getGeometry(), NBEdge::getID(), NBEdge::getLaneSpreadFunction(), NBEdge::getLaneWidth(), PositionVector::move2side(), myShiftedEdges, NBEdge::setGeometry(), SUMO_const_laneWidth, TL, NBEdge::UNSPECIFIED_WIDTH, and WRITE_WARNINGF.
Referenced by buildOffRamp(), and buildOnRamp().
|
staticprivate |
shift ramp geometry to merge smoothly with the motorway
Definition at line 613 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().
|
static |
suffix for newly generated on-ramp edges
Definition at line 57 of file NBAlgorithms_Ramps.h.
Referenced by buildOnRamp().
|
private |
Definition at line 61 of file NBAlgorithms_Ramps.h.
Referenced by buildOffRamp(), buildOnRamp(), and moveRampRight().