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 (NBNetBuilder &nb)
 Computes highway on-/off-ramps (if wished) More...
 
static void assignDirectionPriority (NBNetBuilder &nb)
 
static double getTravelTimeStatic (const Track *const track, const NBVehicle *const veh, double time)
 
static void makeAllBidi (NBNetBuilder &nb)
 
static void repairTopology (NBNetBuilder &nb)
 

Static Private Member Functions

static NBEdgeaddBidiEdge (NBNetBuilder &nb, NBEdge *edge, bool update=true)
 add bidi-edge for the given edge More...
 
static void addBidiEdgesBetweenSwitches (NBNetBuilder &nb)
 add bidi-edges to connect switches that are approached in both directions More...
 
static void addBidiEdgesForBufferStops (NBNetBuilder &nb)
 add bidi-edges to connect buffers stops in both directions More...
 
static void addBidiEdgesForStops (NBNetBuilder &nb)
 add bidi-edges to connect successive public transport stops More...
 
static void addBidiEdgesForStraightConnectivity (NBNetBuilder &nb, 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 (NBNetBuilder &nb)
 add further bidi-edges near existing bidi-edges More...
 
static int extendBidiEdges (NBNetBuilder &nb, NBNode *node, NBEdge *bidiIn)
 
static std::set< NBNode * > getBrokenRailNodes (NBNetBuilder &nb, 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 (NBNetBuilder &nb, bool verbose=false)
 
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 void reverseEdges (NBNetBuilder &nb)
 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 45 of file NBAlgorithms_Railway.h.

Member Function Documentation

◆ addBidiEdge()

NBEdge * NBRailwayTopologyAnalyzer::addBidiEdge ( NBNetBuilder nb,
NBEdge edge,
bool  update = true 
)
staticprivate

◆ addBidiEdgesBetweenSwitches()

void NBRailwayTopologyAnalyzer::addBidiEdgesBetweenSwitches ( NBNetBuilder nb)
staticprivate

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

Definition at line 755 of file NBAlgorithms_Railway.cpp.

References addBidiEdge(), getBrokenRailNodes(), NBEdge::getFromNode(), getRailEdges(), NBEdge::getToNode(), isBidiSwitch(), isStraight(), joinToString(), toString(), and WRITE_MESSAGE.

Referenced by repairTopology().

Here is the caller graph for this function:

◆ addBidiEdgesForBufferStops()

void NBRailwayTopologyAnalyzer::addBidiEdgesForBufferStops ( NBNetBuilder nb)
staticprivate

add bidi-edges to connect buffers stops in both directions

Definition at line 662 of file NBAlgorithms_Railway.cpp.

References addBidiEdge(), CENTER, getBrokenRailNodes(), NBEdge::getFromNode(), getRailEdges(), getRailNodes(), NBEdge::getToNode(), NBEdge::setLaneSpreadFunction(), StringUtils::toBool(), toString(), WRITE_MESSAGE, and WRITE_WARNING.

Referenced by repairTopology().

Here is the caller graph for this function:

◆ addBidiEdgesForStops()

void NBRailwayTopologyAnalyzer::addBidiEdgesForStops ( NBNetBuilder nb)
staticprivate

◆ addBidiEdgesForStraightConnectivity()

void NBRailwayTopologyAnalyzer::addBidiEdgesForStraightConnectivity ( NBNetBuilder nb,
bool  geometryLike 
)
staticprivate

add bidi-edges to connect straight tracks

Definition at line 987 of file NBAlgorithms_Railway.cpp.

References addBidiEdge(), extendBidiEdges(), getBrokenRailNodes(), NBNetBuilder::getEdgeCont(), getRailEdges(), isRailway(), isStraight(), toString(), and WRITE_MESSAGE.

Referenced by repairTopology().

Here is the caller graph for this function:

◆ allBidi()

bool NBRailwayTopologyAnalyzer::allBidi ( const EdgeVector edges)
staticprivate

Definition at line 484 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 444 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 466 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 ( NBNetBuilder nb)
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 105 of file NBAlgorithms_Railway.cpp.

References getBrokenRailNodes().

Referenced by NBNetBuilder::compute().

Here is the caller graph for this function:

◆ assignDirectionPriority()

void NBRailwayTopologyAnalyzer::assignDirectionPriority ( NBNetBuilder nb)
static

Definition at line 1083 of file NBAlgorithms_Railway.cpp.

References NBEdgeCont::getAllEdges(), NBNetBuilder::getEdgeCont(), NBEdge::getID(), Named::getIDSecure(), NBEdge::getPermissions(), NBEdge::getStraightContinuation(), NBEdge::getStraightPredecessor(), isRailway(), joinToString(), NBEdge::setPriority(), WRITE_MESSAGE, and WRITE_WARNING.

Referenced by NBNetBuilder::compute().

Here is the caller graph for this function:

◆ extendBidiEdges() [1/2]

int NBRailwayTopologyAnalyzer::extendBidiEdges ( NBNetBuilder nb)
staticprivate

add further bidi-edges near existing bidi-edges

Definition at line 495 of file NBAlgorithms_Railway.cpp.

References NBEdgeCont::begin(), NBEdgeCont::end(), NBNetBuilder::getEdgeCont(), NBEdge::getFromNode(), NBEdge::getToNode(), NBEdge::getTurnDestination(), NBEdge::isBidiRail(), toString(), and WRITE_MESSAGE.

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

Here is the caller graph for this function:

◆ extendBidiEdges() [2/2]

int NBRailwayTopologyAnalyzer::extendBidiEdges ( NBNetBuilder nb,
NBNode node,
NBEdge bidiIn 
)
staticprivate

◆ 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 196 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 ( NBNetBuilder nb,
bool  verbose = false 
)
staticprivate

Definition at line 368 of file NBAlgorithms_Railway.cpp.

References NBEdgeCont::begin(), NBEdgeCont::end(), NBNetBuilder::getEdgeCont(), NBEdgeCont::insert(), isRailway(), RAIL_SIGNAL, toString(), and WRITE_MESSAGE.

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

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

Referenced by addBidiEdgesForStops().

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 418 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 733 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 395 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()

void NBRailwayTopologyAnalyzer::makeAllBidi ( NBNetBuilder nb)
static

Definition at line 126 of file NBAlgorithms_Railway.cpp.

References addBidiEdge(), CENTER, NBEdgeCont::getAllEdges(), NBNetBuilder::getEdgeCont(), OptionsCont::getOptions(), OptionsCont::getString(), NBEdge::invalidateConnections(), NBHelpers::loadEdgesFromFile(), NBEdgeCont::retrieve(), SVC_RAIL_CLASSES, toString(), WRITE_MESSAGE, and WRITE_WARNING.

Referenced by NBNetBuilder::compute().

Here is the caller graph for this function:

◆ repairTopology()

void NBRailwayTopologyAnalyzer::repairTopology ( NBNetBuilder nb)
static

Definition at line 111 of file NBAlgorithms_Railway.cpp.

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

Referenced by NBNetBuilder::compute().

Here is the caller graph for this function:

◆ reverseEdges()

void NBRailwayTopologyAnalyzer::reverseEdges ( NBNetBuilder nb)
staticprivate

reverse edges sequences that are to broken nodes on both sides

Definition at line 554 of file NBAlgorithms_Railway.cpp.

References allBroken(), DEBUGNODEID, getBrokenRailNodes(), NBNetBuilder::getEdgeCont(), Named::getID(), NBNetBuilder::getPTStopCont(), getRailEdges(), NBPTStopCont::getStops(), joinToString(), toString(), and WRITE_MESSAGE.

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