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

Container for public transport stops during the net building process. More...

#include <NBPTStopCont.h>

Public Member Functions

void addEdges2Keep (const OptionsCont &oc, std::set< std::string > &into)
 add edges that must be kept
 
void alignIdSigns ()
 
void assignEdgeForFloatingStops (NBEdgeCont &cont, double maxRadius)
 
void assignLanes (NBEdgeCont &cont)
 
int cleanupDeleted (NBEdgeCont &cont)
 remove stops on non existing (removed) edges
 
void findAccessEdgesForRailStops (NBEdgeCont &cont, double maxRadius, int maxCount, double accessFactor)
 
std::shared_ptr< NBPTStopfindStop (const std::string &origEdgeID, Position pos, double threshold=1) const
 
int generateBidiStops (NBEdgeCont &cont)
 duplicate stops for superposed rail edges and return the number of generated stops
 
std::shared_ptr< NBPTStopget (std::string id) const
 Retrieve a previously inserted pt stop.
 
std::shared_ptr< NBPTStopgetReverseStop (std::shared_ptr< NBPTStop > pStop, const NBEdgeCont &ec)
 
const std::map< std::string, std::shared_ptr< NBPTStop > > & getStops () const
 Returns an unmodifiable reference to the stored pt stops.
 
bool insert (std::shared_ptr< NBPTStop > ptStop, bool floating=false)
 Inserts a node into the map.
 
void localizePTStops (NBEdgeCont &cont)
 
void postprocess (std::set< std::string > &usedStops)
 
void replaceEdge (const std::string &edgeID, const std::vector< NBEdge * > &replacement)
 replace the edge with the closes edge on the given edge list in all stops
 
 ~NBPTStopCont ()
 

Static Public Member Functions

static void addIgnored (const std::string &stopID)
 
static NBEdgegetReverseEdge (NBEdge *edge)
 
static bool wasIgnored (const std::string &stopID)
 

Private Types

typedef std::map< std::string, std::shared_ptr< NBPTStop > > PTStopsCont
 Definition of the map of names to pt stops.
 

Private Member Functions

std::shared_ptr< NBPTStopassignAndCreatNewPTStopAsNeeded (std::shared_ptr< NBPTStop > pStop, NBEdgeCont &cont)
 
void assignPTStopToEdgeOfClosestPlatform (std::shared_ptr< NBPTStop > pStop, NBEdgeCont &cont)
 
double computeCrossProductEdgePosition (const NBEdge *edge, const Position &closestPlatform) const
 
const NBPTPlatformgetClosestPlatformToPTStopPosition (std::shared_ptr< NBPTStop > pStop)
 

Static Private Member Functions

static std::string getReverseID (const std::string &id)
 

Private Attributes

std::vector< std::shared_ptr< NBPTStop > > myFloatingStops
 
std::map< std::string, std::vector< std::shared_ptr< NBPTStop > > > myPTStopLookup
 The map of edge ids to stops.
 
PTStopsCont myPTStops
 The map of names to pt stops.
 

Static Private Attributes

static std::set< std::string > myIgnoredStops
 

Detailed Description

Container for public transport stops during the net building process.

Definition at line 44 of file NBPTStopCont.h.

Member Typedef Documentation

◆ PTStopsCont

typedef std::map<std::string, std::shared_ptr<NBPTStop> > NBPTStopCont::PTStopsCont
private

Definition of the map of names to pt stops.

Definition at line 98 of file NBPTStopCont.h.

Constructor & Destructor Documentation

◆ ~NBPTStopCont()

NBPTStopCont::~NBPTStopCont ( )

Definition at line 43 of file NBPTStopCont.cpp.

References myPTStops.

Member Function Documentation

◆ addEdges2Keep()

void NBPTStopCont::addEdges2Keep ( const OptionsCont oc,
std::set< std::string > &  into 
)

add edges that must be kept

Definition at line 338 of file NBPTStopCont.cpp.

References myPTStops.

Referenced by NBRampsComputer::computeRamps(), and NBNodeCont::removeUnwishedNodes().

Here is the caller graph for this function:

◆ addIgnored()

static void NBPTStopCont::addIgnored ( const std::string &  stopID)
inlinestatic

Definition at line 122 of file NBPTStopCont.h.

References myIgnoredStops.

Referenced by NIXMLPTHandler::addPTStop().

Here is the caller graph for this function:

◆ alignIdSigns()

void NBPTStopCont::alignIdSigns ( )

Definition at line 383 of file NBPTStopCont.cpp.

References get(), getReverseID(), and myPTStops.

Referenced by NBNetBuilder::compute().

Here is the caller graph for this function:

◆ assignAndCreatNewPTStopAsNeeded()

std::shared_ptr< NBPTStop > NBPTStopCont::assignAndCreatNewPTStopAsNeeded ( std::shared_ptr< NBPTStop pStop,
NBEdgeCont cont 
)
private

Definition at line 195 of file NBPTStopCont.cpp.

References computeCrossProductEdgePosition(), NBEdgeCont::getByID(), NBEdge::getID(), NBPTPlatform::getLength(), getReverseEdge(), and getReverseStop().

Referenced by localizePTStops().

Here is the caller graph for this function:

◆ assignEdgeForFloatingStops()

void NBPTStopCont::assignEdgeForFloatingStops ( NBEdgeCont cont,
double  maxRadius 
)

Definition at line 408 of file NBPTStopCont.cpp.

References PositionVector::getBoxBoundary(), NBEdge::getGeometry(), NBEdge::getPermissions(), NamedRTree::Insert(), myFloatingStops, myPTStops, NamedRTree::Search(), SVC_BUS, SVC_RAIL, SVC_RAIL_URBAN, SVC_TAXI, SVC_TRAM, TL, WRITE_WARNINGF, Position::x(), Boundary::xmax(), Boundary::xmin(), Position::y(), Boundary::ymax(), and Boundary::ymin().

Referenced by NBNetBuilder::compute().

Here is the caller graph for this function:

◆ assignLanes()

void NBPTStopCont::assignLanes ( NBEdgeCont cont)

Definition at line 105 of file NBPTStopCont.cpp.

References myPTStops, TL, and WRITE_WARNINGF.

Referenced by NBNetBuilder::compute().

Here is the caller graph for this function:

◆ assignPTStopToEdgeOfClosestPlatform()

void NBPTStopCont::assignPTStopToEdgeOfClosestPlatform ( std::shared_ptr< NBPTStop pStop,
NBEdgeCont cont 
)
private

Definition at line 235 of file NBPTStopCont.cpp.

References computeCrossProductEdgePosition(), NBEdgeCont::getByID(), getClosestPlatformToPTStopPosition(), NBEdge::getID(), NBPTPlatform::getLength(), NBPTPlatform::getPos(), and getReverseEdge().

Referenced by localizePTStops().

Here is the caller graph for this function:

◆ cleanupDeleted()

int NBPTStopCont::cleanupDeleted ( NBEdgeCont cont)

remove stops on non existing (removed) edges

Parameters
cont

Definition at line 322 of file NBPTStopCont.cpp.

References NBEdgeCont::getByID(), myPTStops, TL, and WRITE_WARNINGF.

Referenced by NBNetBuilder::compute(), and NIImporter_OpenStreetMap::load().

Here is the caller graph for this function:

◆ computeCrossProductEdgePosition()

double NBPTStopCont::computeCrossProductEdgePosition ( const NBEdge edge,
const Position closestPlatform 
) const
private

Definition at line 258 of file NBPTStopCont.cpp.

References NBEdge::getGeometry(), NBEdge::getID(), PositionVector::indexOfClosest(), PositionVector::nearest_offset_to_point2D(), PositionVector::offsetAtIndex2D(), TL, WRITE_WARNINGF, Position::x(), and Position::y().

Referenced by assignAndCreatNewPTStopAsNeeded(), and assignPTStopToEdgeOfClosestPlatform().

Here is the caller graph for this function:

◆ findAccessEdgesForRailStops()

void NBPTStopCont::findAccessEdgesForRailStops ( NBEdgeCont cont,
double  maxRadius,
int  maxCount,
double  accessFactor 
)

Definition at line 454 of file NBPTStopCont.cpp.

References Position::distanceTo2D(), NBEdgeCont::getByID(), NBEdge::getPermissions(), NamedRTree::Insert(), myPTStops, NamedRTree::Search(), SVC_PEDESTRIAN, Position::x(), Boundary::xmax(), Boundary::xmin(), Position::y(), Boundary::ymax(), and Boundary::ymin().

Referenced by NBNetBuilder::compute().

Here is the caller graph for this function:

◆ findStop()

std::shared_ptr< NBPTStop > NBPTStopCont::findStop ( const std::string &  origEdgeID,
Position  pos,
double  threshold = 1 
) const

Definition at line 507 of file NBPTStopCont.cpp.

References myPTStops.

Referenced by NBPTLineCont::findWay().

Here is the caller graph for this function:

◆ generateBidiStops()

int NBPTStopCont::generateBidiStops ( NBEdgeCont cont)

duplicate stops for superposed rail edges and return the number of generated stops

Definition at line 123 of file NBPTStopCont.cpp.

References NBEdgeCont::getByID(), NBEdge::getID(), getReverseID(), NBEdge::getTurnDestination(), NBEdge::isBidiRail(), myPTStops, TL, toString(), WRITE_MESSAGEF, and WRITE_WARNINGF.

Referenced by NBNetBuilder::compute().

Here is the caller graph for this function:

◆ get()

std::shared_ptr< NBPTStop > NBPTStopCont::get ( std::string  id) const

Retrieve a previously inserted pt stop.

Definition at line 64 of file NBPTStopCont.cpp.

References myPTStops.

Referenced by NBRailwayTopologyAnalyzer::addBidiEdgesForStops(), NIXMLPTHandler::addPTLineStop(), NIXMLPTHandler::addRouteStop(), alignIdSigns(), NBPTLine::deleteInvalidStops(), and NIImporter_OpenStreetMap::insertEdge().

Here is the caller graph for this function:

◆ getClosestPlatformToPTStopPosition()

const NBPTPlatform * NBPTStopCont::getClosestPlatformToPTStopPosition ( std::shared_ptr< NBPTStop pStop)
private

Definition at line 290 of file NBPTStopCont.cpp.

References Position::distanceSquaredTo2D().

Referenced by assignPTStopToEdgeOfClosestPlatform().

Here is the caller graph for this function:

◆ getReverseEdge()

NBEdge * NBPTStopCont::getReverseEdge ( NBEdge edge)
static

Definition at line 307 of file NBPTStopCont.cpp.

References NBEdge::getFromNode(), NBNode::getOutgoingEdges(), and NBEdge::getToNode().

Referenced by assignAndCreatNewPTStopAsNeeded(), assignPTStopToEdgeOfClosestPlatform(), getReverseStop(), and NBPTLineCont::reviseStops().

Here is the caller graph for this function:

◆ getReverseID()

std::string NBPTStopCont::getReverseID ( const std::string &  id)
staticprivate

Definition at line 378 of file NBPTStopCont.cpp.

Referenced by alignIdSigns(), generateBidiStops(), and getReverseStop().

Here is the caller graph for this function:

◆ getReverseStop()

std::shared_ptr< NBPTStop > NBPTStopCont::getReverseStop ( std::shared_ptr< NBPTStop pStop,
const NBEdgeCont ec 
)

Definition at line 177 of file NBPTStopCont.cpp.

References NBEdgeCont::getByID(), NBEdge::getID(), getReverseEdge(), getReverseID(), and myPTStops.

Referenced by NBRailwayTopologyAnalyzer::addBidiEdgesForStops(), assignAndCreatNewPTStopAsNeeded(), localizePTStops(), and NBPTLineCont::reviseStops().

Here is the caller graph for this function:

◆ getStops()

const std::map< std::string, std::shared_ptr< NBPTStop > > & NBPTStopCont::getStops ( ) const
inline

Returns an unmodifiable reference to the stored pt stops.

Returns
The stored pt stops

Definition at line 62 of file NBPTStopCont.h.

References myPTStops.

Referenced by NBEdgeCont::appendRailwayTurnarounds(), NBNetBuilder::compute(), NBRailwaySignalGuesser::guessByStops(), NBNodeCont::joinJunctions(), NIImporter_OpenStreetMap::load(), NBNetBuilder::mirrorX(), NBNetBuilder::moveToOrigin(), NBEdgeCont::remapIDs(), NBNodeCont::removeRailComponents(), NBRailwayTopologyAnalyzer::reverseEdges(), and NWWriter_XML::writePTStops().

Here is the caller graph for this function:

◆ insert()

bool NBPTStopCont::insert ( std::shared_ptr< NBPTStop ptStop,
bool  floating = false 
)

Inserts a node into the map.

Parameters
[in]stopThe pt stop to insert
[in]floatingwhether the stop is not referenced by a way or relation
Returns
Whether the pt stop could be added

Definition at line 49 of file NBPTStopCont.cpp.

References myFloatingStops, and myPTStops.

Referenced by NBRailwayTopologyAnalyzer::addBidiEdgesForStops(), NIXMLPTHandler::addPTStop(), NBPTLineCont::findWay(), NIImporter_OpenStreetMap::insertEdge(), NIImporter_OpenStreetMap::load(), localizePTStops(), NIImporter_VISUM::parse_stopPoints(), and NBPTLineCont::reviseStops().

Here is the caller graph for this function:

◆ localizePTStops()

void NBPTStopCont::localizePTStops ( NBEdgeCont cont)

Definition at line 73 of file NBPTStopCont.cpp.

References assignAndCreatNewPTStopAsNeeded(), assignPTStopToEdgeOfClosestPlatform(), getReverseStop(), insert(), and myPTStops.

Referenced by NBNetBuilder::compute().

Here is the caller graph for this function:

◆ postprocess()

void NBPTStopCont::postprocess ( std::set< std::string > &  usedStops)

Definition at line 367 of file NBPTStopCont.cpp.

References myPTStops.

Referenced by NBNetBuilder::compute().

Here is the caller graph for this function:

◆ replaceEdge()

void NBPTStopCont::replaceEdge ( const std::string &  edgeID,
const std::vector< NBEdge * > &  replacement 
)

replace the edge with the closes edge on the given edge list in all stops

Definition at line 346 of file NBPTStopCont.cpp.

References myPTStopLookup, myPTStops, TL, and WRITE_WARNINGF.

Referenced by NBEdgeCont::joinTramEdges(), and NBNodeCont::removeUnwishedNodes().

Here is the caller graph for this function:

◆ wasIgnored()

static bool NBPTStopCont::wasIgnored ( const std::string &  stopID)
inlinestatic

Definition at line 126 of file NBPTStopCont.h.

References myIgnoredStops.

Referenced by NIXMLPTHandler::addPTLineStop().

Here is the caller graph for this function:

Field Documentation

◆ myFloatingStops

std::vector<std::shared_ptr<NBPTStop> > NBPTStopCont::myFloatingStops
private

Definition at line 106 of file NBPTStopCont.h.

Referenced by assignEdgeForFloatingStops(), and insert().

◆ myIgnoredStops

std::set< std::string > NBPTStopCont::myIgnoredStops
staticprivate

Definition at line 116 of file NBPTStopCont.h.

Referenced by addIgnored(), and wasIgnored().

◆ myPTStopLookup

std::map<std::string, std::vector<std::shared_ptr<NBPTStop> > > NBPTStopCont::myPTStopLookup
private

The map of edge ids to stops.

Definition at line 104 of file NBPTStopCont.h.

Referenced by replaceEdge().

◆ myPTStops


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