Eclipse SUMO - Simulation of Urban MObility
NBRailwayTopologyAnalyzer Class Reference

#include <NBAlgorithms_Railway.h>

Data Structures

class  Track
 routing edge More...
 

Static Public Member Functions

static void analyzeTopology (NBEdgeCont &ec)
 
static void extendDirectionPriority (NBEdgeCont &ec, bool fromUniDir)
 
static double getTravelTimeStatic (const Track *const track, const NBVehicle *const veh, double time)
 
static int makeAllBidi (NBEdgeCont &ec)
 
static int repairTopology (NBEdgeCont &ec, NBPTStopCont &sc, NBPTLineCont &lc)
 

Static Private Member Functions

static NBEdgeaddBidiEdge (NBEdgeCont &ec, NBEdge *edge, bool update=true)
 add bidi-edge for the given edge More...
 
static int addBidiEdgesBetweenSwitches (NBEdgeCont &ec)
 add bidi-edges to connect switches that are approached in both directions More...
 
static int addBidiEdgesForBufferStops (NBEdgeCont &ec)
 add bidi-edges to connect buffers stops in both directions More...
 
static int addBidiEdgesForStops (NBEdgeCont &ec, NBPTLineCont &lc, NBPTStopCont &sc, bool minimal)
 add bidi-edges to connect successive public transport stops More...
 
static int addBidiEdgesForStraightConnectivity (NBEdgeCont &ec, bool geometryLike)
 add bidi-edges to connect straight tracks More...
 
static bool allBidi (const EdgeVector &edges)
 
static bool allBroken (const NBNode *node, NBEdge *candOut, const EdgeVector &in, const EdgeVector &out)
 
static bool allSharp (const NBNode *node, const EdgeVector &in, const EdgeVector &out, bool countBidiAsSharp=false)
 
static int extendBidiEdges (NBEdgeCont &ec)
 add further bidi-edges near existing bidi-edges More...
 
static int extendBidiEdges (NBEdgeCont &ec, NBNode *node, NBEdge *bidiIn)
 
static std::set< NBPTLine * > findBidiCandidates (NBPTLineCont &lc)
 identify lines that are likely to require bidirectional tracks More...
 
static std::set< NBNode * > getBrokenRailNodes (NBEdgeCont &ec, bool verbose=false)
 
static void getRailEdges (const NBNode *node, EdgeVector &inEdges, EdgeVector &outEdges)
 filter out rail edges among all edges of a the given node More...
 
static std::set< NBNode * > getRailNodes (NBEdgeCont &ec, bool verbose=false)
 
static bool hasRailway (SVCPermissions permissions)
 filter for rail edges but do not return (legacy) all purpose edges More...
 
static bool hasStraightPair (const NBNode *node, const EdgeVector &edges, const EdgeVector &edges2)
 
static NBEdgeisBidiSwitch (const NBNode *n)
 
static bool isStraight (const NBNode *node, const NBEdge *e1, const NBEdge *e2)
 
static int reverseEdges (NBEdgeCont &ec, NBPTStopCont &sc)
 reverse edges sequences that are to broken nodes on both sides More...
 
static void updateTurns (NBEdge *edge)
 recompute turning directions for both nodes of the given edge More...
 

Detailed Description

Definition at line 49 of file NBAlgorithms_Railway.h.

Member Function Documentation

◆ addBidiEdge()

NBEdge * NBRailwayTopologyAnalyzer::addBidiEdge ( NBEdgeCont ec,
NBEdge edge,
bool  update = true 
)
staticprivate

◆ addBidiEdgesBetweenSwitches()

int NBRailwayTopologyAnalyzer::addBidiEdgesBetweenSwitches ( NBEdgeCont ec)
staticprivate

add bidi-edges to connect switches that are approached in both directions

Definition at line 778 of file NBAlgorithms_Railway.cpp.

References addBidiEdge(), CENTER, getBrokenRailNodes(), NBEdge::getFromNode(), NBEdge::getLaneSpreadFunction(), getRailEdges(), NBEdge::getToNode(), isBidiSwitch(), isStraight(), joinToString(), TL, toString(), and WRITE_MESSAGEF.

Referenced by repairTopology().

Here is the caller graph for this function:

◆ addBidiEdgesForBufferStops()

int NBRailwayTopologyAnalyzer::addBidiEdgesForBufferStops ( NBEdgeCont ec)
staticprivate

add bidi-edges to connect buffers stops in both directions

Definition at line 684 of file NBAlgorithms_Railway.cpp.

References addBidiEdge(), CENTER, getBrokenRailNodes(), NBEdge::getFromNode(), getRailEdges(), getRailNodes(), NBEdge::getToNode(), NBEdge::setLaneSpreadFunction(), TL, StringUtils::toBool(), toString(), WRITE_MESSAGEF, and WRITE_WARNINGF.

Referenced by repairTopology().

Here is the caller graph for this function:

◆ addBidiEdgesForStops()

int NBRailwayTopologyAnalyzer::addBidiEdgesForStops ( NBEdgeCont ec,
NBPTLineCont lc,
NBPTStopCont sc,
bool  minimal 
)
staticprivate

◆ addBidiEdgesForStraightConnectivity()

int NBRailwayTopologyAnalyzer::addBidiEdgesForStraightConnectivity ( NBEdgeCont ec,
bool  geometryLike 
)
staticprivate

add bidi-edges to connect straight tracks

Definition at line 1080 of file NBAlgorithms_Railway.cpp.

References addBidiEdge(), extendBidiEdges(), getBrokenRailNodes(), getRailEdges(), hasRailway(), isStraight(), TL, toString(), and WRITE_MESSAGEF.

Referenced by repairTopology().

Here is the caller graph for this function:

◆ allBidi()

bool NBRailwayTopologyAnalyzer::allBidi ( const EdgeVector edges)
staticprivate

Definition at line 503 of file NBAlgorithms_Railway.cpp.

Referenced by allSharp(), and getBrokenRailNodes().

Here is the caller graph for this function:

◆ allBroken()

bool NBRailwayTopologyAnalyzer::allBroken ( const NBNode node,
NBEdge candOut,
const EdgeVector in,
const EdgeVector out 
)
staticprivate

Definition at line 463 of file NBAlgorithms_Railway.cpp.

References gDebugFlag1, NBEdge::getID(), and isStraight().

Referenced by reverseEdges().

Here is the caller graph for this function:

◆ allSharp()

bool NBRailwayTopologyAnalyzer::allSharp ( const NBNode node,
const EdgeVector in,
const EdgeVector out,
bool  countBidiAsSharp = false 
)
staticprivate

Definition at line 485 of file NBAlgorithms_Railway.cpp.

References allBidi(), and isStraight().

Referenced by extendBidiEdges(), and getBrokenRailNodes().

Here is the caller graph for this function:

◆ analyzeTopology()

void NBRailwayTopologyAnalyzer::analyzeTopology ( NBEdgeCont ec)
static

Definition at line 108 of file NBAlgorithms_Railway.cpp.

References getBrokenRailNodes().

Referenced by NBNetBuilder::compute().

Here is the caller graph for this function:

◆ extendBidiEdges() [1/2]

int NBRailwayTopologyAnalyzer::extendBidiEdges ( NBEdgeCont ec)
staticprivate

add further bidi-edges near existing bidi-edges

Definition at line 514 of file NBAlgorithms_Railway.cpp.

References NBEdgeCont::begin(), NBEdgeCont::end(), NBEdge::getFromNode(), NBEdge::getToNode(), NBEdge::getTurnDestination(), NBEdge::isBidiRail(), TL, toString(), and WRITE_MESSAGEF.

Referenced by addBidiEdgesForStops(), addBidiEdgesForStraightConnectivity(), extendBidiEdges(), and repairTopology().

Here is the caller graph for this function:

◆ extendBidiEdges() [2/2]

int NBRailwayTopologyAnalyzer::extendBidiEdges ( NBEdgeCont ec,
NBNode node,
NBEdge bidiIn 
)
staticprivate

◆ extendDirectionPriority()

void NBRailwayTopologyAnalyzer::extendDirectionPriority ( NBEdgeCont ec,
bool  fromUniDir 
)
static

Definition at line 1178 of file NBAlgorithms_Railway.cpp.

References NBEdgeCont::getAllEdges(), NBEdge::getID(), Named::getIDSecure(), NBEdge::getPermissions(), NBEdge::getPriority(), NBEdge::getStraightContinuation(), NBEdge::getStraightPredecessor(), hasRailway(), joinToString(), NBEdge::setPriority(), TL, WRITE_MESSAGE, WRITE_WARNING, and WRITE_WARNINGF.

Referenced by NBNetBuilder::compute().

Here is the caller graph for this function:

◆ findBidiCandidates()

std::set< NBPTLine * > NBRailwayTopologyAnalyzer::findBidiCandidates ( NBPTLineCont lc)
staticprivate

identify lines that are likely to require bidirectional tracks

Definition at line 838 of file NBAlgorithms_Railway.cpp.

References NBPTLineCont::getLines().

Referenced by addBidiEdgesForStops().

Here is the caller graph for this function:

◆ getBrokenRailNodes()

◆ getRailEdges()

void NBRailwayTopologyAnalyzer::getRailEdges ( const NBNode node,
EdgeVector inEdges,
EdgeVector outEdges 
)
staticprivate

filter out rail edges among all edges of a the given node

Definition at line 219 of file NBAlgorithms_Railway.cpp.

References NBNode::getIncomingEdges(), NBNode::getOutgoingEdges(), and SVC_RAIL_CLASSES.

Referenced by addBidiEdgesBetweenSwitches(), addBidiEdgesForBufferStops(), addBidiEdgesForStops(), addBidiEdgesForStraightConnectivity(), extendBidiEdges(), getBrokenRailNodes(), isBidiSwitch(), and reverseEdges().

Here is the caller graph for this function:

◆ getRailNodes()

std::set< NBNode * > NBRailwayTopologyAnalyzer::getRailNodes ( NBEdgeCont ec,
bool  verbose = false 
)
staticprivate

Definition at line 390 of file NBAlgorithms_Railway.cpp.

References NBEdgeCont::begin(), NBEdgeCont::end(), hasRailway(), RAIL_SIGNAL, TL, toString(), and WRITE_MESSAGEF.

Referenced by addBidiEdgesForBufferStops(), addBidiEdgesForStops(), and getBrokenRailNodes().

Here is the caller graph for this function:

◆ getTravelTimeStatic()

double NBRailwayTopologyAnalyzer::getTravelTimeStatic ( const Track *const  track,
const NBVehicle *const  veh,
double  time 
)
static

Definition at line 1172 of file NBAlgorithms_Railway.cpp.

References NBRailwayTopologyAnalyzer::Track::edge, NBEdge::getTravelTimeStatic(), and NBRailwayTopologyAnalyzer::Track::penalty.

Referenced by addBidiEdgesForStops().

Here is the caller graph for this function:

◆ hasRailway()

static bool NBRailwayTopologyAnalyzer::hasRailway ( SVCPermissions  permissions)
inlinestaticprivate

filter for rail edges but do not return (legacy) all purpose edges

Definition at line 117 of file NBAlgorithms_Railway.h.

References SVC_RAIL_CLASSES, and SVCAll.

Referenced by addBidiEdge(), addBidiEdgesForStraightConnectivity(), extendDirectionPriority(), getRailNodes(), and makeAllBidi().

Here is the caller graph for this function:

◆ hasStraightPair()

bool NBRailwayTopologyAnalyzer::hasStraightPair ( const NBNode node,
const EdgeVector edges,
const EdgeVector edges2 
)
staticprivate

Definition at line 437 of file NBAlgorithms_Railway.cpp.

References isStraight().

Referenced by getBrokenRailNodes().

Here is the caller graph for this function:

◆ isBidiSwitch()

NBEdge * NBRailwayTopologyAnalyzer::isBidiSwitch ( const NBNode n)
staticprivate

Definition at line 756 of file NBAlgorithms_Railway.cpp.

References getRailEdges(), and isStraight().

Referenced by addBidiEdgesBetweenSwitches().

Here is the caller graph for this function:

◆ isStraight()

bool NBRailwayTopologyAnalyzer::isStraight ( const NBNode node,
const NBEdge e1,
const NBEdge e2 
)
staticprivate

Definition at line 414 of file NBAlgorithms_Railway.cpp.

References NBEdge::getAngleAtNode(), NBEdge::getFromNode(), NBEdge::getToNode(), NBHelpers::normRelAngle(), SHARP_THRESHOLD, and SHARP_THRESHOLD_SAMEDIR.

Referenced by addBidiEdgesBetweenSwitches(), addBidiEdgesForStops(), addBidiEdgesForStraightConnectivity(), allBroken(), allSharp(), extendBidiEdges(), hasStraightPair(), and isBidiSwitch().

Here is the caller graph for this function:

◆ makeAllBidi()

int NBRailwayTopologyAnalyzer::makeAllBidi ( NBEdgeCont ec)
static

Definition at line 136 of file NBAlgorithms_Railway.cpp.

References addBidiEdge(), CENTER, NBEdgeCont::getAllEdges(), OptionsCont::getOptions(), OptionsCont::getString(), hasRailway(), NBEdge::invalidateConnections(), NBHelpers::loadEdgesFromFile(), NBEdgeCont::retrieve(), TL, toString(), WRITE_MESSAGEF, and WRITE_WARNINGF.

Referenced by NBNetBuilder::compute().

Here is the caller graph for this function:

◆ repairTopology()

int NBRailwayTopologyAnalyzer::repairTopology ( NBEdgeCont ec,
NBPTStopCont sc,
NBPTLineCont lc 
)
static

Definition at line 114 of file NBAlgorithms_Railway.cpp.

References addBidiEdgesBetweenSwitches(), addBidiEdgesForBufferStops(), addBidiEdgesForStops(), addBidiEdgesForStraightConnectivity(), extendBidiEdges(), OptionsCont::getBool(), NBPTLineCont::getLines(), OptionsCont::getOptions(), and reverseEdges().

Referenced by NBNetBuilder::compute().

Here is the caller graph for this function:

◆ reverseEdges()

int NBRailwayTopologyAnalyzer::reverseEdges ( NBEdgeCont ec,
NBPTStopCont sc 
)
staticprivate

reverse edges sequences that are to broken nodes on both sides

Definition at line 572 of file NBAlgorithms_Railway.cpp.

References allBroken(), DEBUGNODEID, getBrokenRailNodes(), Named::getID(), getRailEdges(), NBPTStopCont::getStops(), joinToString(), NBTrafficLightDefinition::OSM_DIRECTION, Parameterised::setParameter(), TL, toString(), and WRITE_MESSAGEF.

Referenced by repairTopology().

Here is the caller graph for this function:

◆ updateTurns()

void NBRailwayTopologyAnalyzer::updateTurns ( NBEdge edge)
staticprivate

recompute turning directions for both nodes of the given edge

Definition at line 1165 of file NBAlgorithms_Railway.cpp.

References NBTurningDirectionsComputer::computeTurnDirectionsForNode(), NBEdge::getFromNode(), and NBEdge::getToNode().

Referenced by addBidiEdge().

Here is the caller graph for this function:

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