Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
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 std::set< NBNode * > getRailNodes (NBEdgeCont &ec, bool verbose=false)
 
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 void setPTLinePriority (NBEdgeCont &ec, NBPTLineCont &lc, SVCPermissions vClasses)
 

Static Private Member Functions

static NBEdge * addBidiEdge (NBEdgeCont &ec, NBEdge *edge, bool update=true)
 add bidi-edge for the given edge
 
static int addBidiEdgesBetweenSwitches (NBEdgeCont &ec)
 add bidi-edges to connect switches that are approached in both directions
 
static int addBidiEdgesForBufferStops (NBEdgeCont &ec)
 add bidi-edges to connect buffers stops in both directions
 
static int addBidiEdgesForStops (NBEdgeCont &ec, NBPTLineCont &lc, NBPTStopCont &sc, bool minimal)
 add bidi-edges to connect successive public transport stops
 
static int addBidiEdgesForStraightConnectivity (NBEdgeCont &ec, bool geometryLike)
 add bidi-edges to connect straight tracks
 
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
 
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
 
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
 
static bool hasRailway (SVCPermissions permissions)
 filter for rail edges but do not return (legacy) all purpose edges
 
static bool hasStraightPair (const NBNode *node, const EdgeVector &edges, const EdgeVector &edges2)
 
static NBEdge * isBidiSwitch (const NBNode *n)
 
static bool isStraight (const NBNode *node, const NBEdge *e1, const NBEdge *e2)
 
static void reverseEdge (NBEdge *e)
 reverse a single edge
 
static int reverseEdges (NBEdgeCont &ec, NBPTStopCont &sc, NBPTLineCont &lc)
 reverse edges sequences that are to broken nodes on both sides
 
static void updateTurns (NBEdge *edge)
 recompute turning directions for both nodes of the given edge
 

Detailed Description

Definition at line 49 of file NBAlgorithms_Railway.h.

Member Function Documentation

◆ addBidiEdge()

◆ addBidiEdgesBetweenSwitches()

int NBRailwayTopologyAnalyzer::addBidiEdgesBetweenSwitches ( NBEdgeCont &  ec)
staticprivate

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

Definition at line 798 of file NBAlgorithms_Railway.cpp.

References addBidiEdge(), CENTER, forward, 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 704 of file NBAlgorithms_Railway.cpp.

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

Referenced by repairTopology().

Here is the caller graph for this function:

◆ addBidiEdgesForStops()

◆ addBidiEdgesForStraightConnectivity()

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

add bidi-edges to connect straight tracks

Definition at line 1125 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 508 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 468 of file NBAlgorithms_Railway.cpp.

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

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 490 of file NBAlgorithms_Railway.cpp.

References allBidi(), isStraight(), and node.

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 519 of file NBAlgorithms_Railway.cpp.

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

Referenced by addBidiEdgesForStops(), addBidiEdgesForStraightConnectivity(), extendBidiEdges(), 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 1249 of file NBAlgorithms_Railway.cpp.

References forward, NBEdgeCont::getAllEdges(), NBEdge::getID(), Named::getIDSecure(), NBEdge::getPermissions(), NBEdge::getPriority(), NBEdge::getStraightContinuation(), NBEdge::getStraightPredecessor(), hasRailway(), joinToString(), NBEdge::setPriority(), NBEdge::setRoutingType(), TL, toString(), 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 858 of file NBAlgorithms_Railway.cpp.

References NBPTLineCont::getLines().

Referenced by addBidiEdgesForStops().

Here is the caller graph for this function:

◆ getBrokenRailNodes()

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

◆ 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 224 of file NBAlgorithms_Railway.cpp.

References node, 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 
)
static

Definition at line 395 of file NBAlgorithms_Railway.cpp.

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

Referenced by addBidiEdgesForBufferStops(), addBidiEdgesForStops(), getBrokenRailNodes(), and NBRailwayGeometryHelper::straigthenCorrdidor().

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 1217 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 118 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 442 of file NBAlgorithms_Railway.cpp.

References isStraight(), and node.

Referenced by getBrokenRailNodes().

Here is the caller graph for this function:

◆ isBidiSwitch()

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

Definition at line 776 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 419 of file NBAlgorithms_Railway.cpp.

References NBEdge::getAngleAtNode(), NBEdge::getFromNode(), NBEdge::getToNode(), node, 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:

◆ reverseEdge()

void NBRailwayTopologyAnalyzer::reverseEdge ( NBEdge *  e)
staticprivate

reverse a single edge

Definition at line 694 of file NBAlgorithms_Railway.cpp.

References NBEdge::getFromNode(), NBEdge::getGeometry(), Parameterised::getParameter(), NBEdge::getToNode(), NBTrafficLightDefinition::OSM_DIRECTION, NBEdge::reinitNodes(), PositionVector::reverse(), NBEdge::setGeometry(), and Parameterised::setParameter().

Referenced by addBidiEdgesForStops(), and reverseEdges().

Here is the caller graph for this function:

◆ reverseEdges()

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

reverse edges sequences that are to broken nodes on both sides

Definition at line 577 of file NBAlgorithms_Railway.cpp.

References allBroken(), DEBUGNODEID, forward, getBrokenRailNodes(), Named::getID(), NBPTLineCont::getLines(), getRailEdges(), NBPTStopCont::getStops(), joinToString(), reverseEdge(), TL, toString(), and WRITE_MESSAGEF.

Referenced by repairTopology().

Here is the caller graph for this function:

◆ setPTLinePriority()

void NBRailwayTopologyAnalyzer::setPTLinePriority ( NBEdgeCont &  ec,
NBPTLineCont &  lc,
SVCPermissions  vClasses 
)
static

Definition at line 1223 of file NBAlgorithms_Railway.cpp.

References NBEdgeCont::getAllEdges(), NBPTLineCont::getLines(), StringUtils::isInt(), isRailway(), and StringUtils::toInt().

Referenced by NBNetBuilder::compute().

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 1210 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: