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

#include <NBPTLine.h>

Collaboration diagram for NBPTLine:
[legend]

Public Member Functions

void addPTStop (std::shared_ptr< NBPTStop > pStop)
 
void addWayNode (long long int way, long long int node)
 
void deleteDuplicateStops ()
 
void deleteInvalidStops (const NBEdgeCont &ec, const NBPTStopCont &sc)
 remove invalid stops from the line
 
const std::string & getLineID () const
 
const std::string & getName () const
 
const std::string & getRef () const
 get line reference (not unique)
 
const std::vector< NBEdge * > & getRoute () const
 
NBEdgegetRouteEnd (const NBEdgeCont &ec) const
 return last valid edge of myRoute (if it doest not lie before the last stop)
 
NBEdgegetRouteStart (const NBEdgeCont &ec) const
 return first valid edge of myRoute (if it doest not lie after the first stop)
 
std::vector< std::pair< NBEdge *, std::string > > getStopEdges (const NBEdgeCont &ec) const
 get stop edges and stop ids
 
const std::vector< std::shared_ptr< NBPTStop > > & getStops ()
 
const std::string & getType () const
 
SUMOVehicleClass getVClass () const
 
const std::vector< long long int > * getWayNodes (std::string wayId)
 
const std::vector< std::string > & getWays () const
 
bool isConsistent (std::vector< NBEdge * > stops) const
 return whether the mentioned edges appear in that order in the route
 
 NBPTLine (const std::string &id, const std::string &name, const std::string &type, const std::string &ref, int interval, const std::string &nightService, SUMOVehicleClass vClass, RGBColor color)
 
void removeInvalidEdges (const NBEdgeCont &ec)
 remove invalid edges from the line
 
void replaceEdge (const std::string &edgeID, const std::vector< NBEdge * > &replacement)
 replace the edge with the given edge list
 
void replaceStop (std::shared_ptr< NBPTStop > oldStop, std::shared_ptr< NBPTStop > newStop)
 replace the given stop
 
void replaceStops (std::vector< std::shared_ptr< NBPTStop > > stops)
 
void setEdges (const std::vector< NBEdge * > &edges)
 
void setName (const std::string &name)
 
void setNumOfStops (int numStops, int missingBefore, int missingAfter)
 
void setPeriod (int intervalS)
 
void setRef (const std::string &line)
 
void write (OutputDevice &device)
 

Private Attributes

RGBColor myColor
 
std::string myCurrentWay
 
int myInterval
 
int myMissingStopsAfter
 
int myMissingStopsBefore
 
std::string myName
 
std::string myNightService
 
int myNumOfStops
 
std::string myPTLineId
 
std::vector< std::shared_ptr< NBPTStop > > myPTStops
 
std::string myRef
 
std::vector< NBEdge * > myRoute
 
std::string myType
 
SUMOVehicleClass myVClass
 
std::map< std::string, std::vector< long long int > > myWayNodes
 
std::vector< std::string > myWays
 

Detailed Description

Definition at line 43 of file NBPTLine.h.

Constructor & Destructor Documentation

◆ NBPTLine()

NBPTLine::NBPTLine ( const std::string &  id,
const std::string &  name,
const std::string &  type,
const std::string &  ref,
int  interval,
const std::string &  nightService,
SUMOVehicleClass  vClass,
RGBColor  color 
)

Definition at line 37 of file NBPTLine.cpp.

Member Function Documentation

◆ addPTStop()

void NBPTLine::addPTStop ( std::shared_ptr< NBPTStop pStop)

Definition at line 54 of file NBPTLine.cpp.

References myPTStops.

Referenced by NIXMLPTHandler::addPTLineFromFlow(), NIXMLPTHandler::addPTLineStop(), and NIImporter_OpenStreetMap::RelationHandler::myEndElement().

Here is the caller graph for this function:

◆ addWayNode()

void NBPTLine::addWayNode ( long long int  way,
long long int  node 
)

Definition at line 121 of file NBPTLine.cpp.

References myCurrentWay, myWayNodes, myWays, and toString().

Referenced by NIImporter_OpenStreetMap::RelationHandler::myEndElement().

Here is the caller graph for this function:

◆ deleteDuplicateStops()

void NBPTLine::deleteDuplicateStops ( )

Definition at line 324 of file NBPTLine.cpp.

References getLineID(), myPTStops, TL, toString(), and WRITE_WARNINGF.

◆ deleteInvalidStops()

void NBPTLine::deleteInvalidStops ( const NBEdgeCont ec,
const NBPTStopCont sc 
)

remove invalid stops from the line

Definition at line 307 of file NBPTLine.cpp.

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

Referenced by NBPTLineCont::process().

Here is the caller graph for this function:

◆ getLineID()

const std::string & NBPTLine::getLineID ( ) const
inline

Definition at line 51 of file NBPTLine.h.

References myPTLineId.

Referenced by NIXMLPTHandler::addPTLineStop(), NBPTLineCont::constructRoute(), deleteDuplicateStops(), deleteInvalidStops(), NBPTLineCont::findWay(), NBPTLineCont::fixBidiStops(), NBPTLineCont::insert(), and NBPTLineCont::reviseStops().

Here is the caller graph for this function:

◆ getName()

const std::string & NBPTLine::getName ( ) const
inline

Definition at line 55 of file NBPTLine.h.

References myName.

Referenced by NIXMLPTHandler::addPTLineRoute(), NIXMLPTHandler::addRoute(), and NBPTLineCont::constructRoute().

Here is the caller graph for this function:

◆ getRef()

const std::string & NBPTLine::getRef ( ) const
inline

get line reference (not unique)

Definition at line 70 of file NBPTLine.h.

References myRef.

Referenced by NBRailwayTopologyAnalyzer::addBidiEdgesForStops(), NBPTLineCont::fixBidiStops(), NBPTLineCont::reviseSingleWayStops(), and NBPTLineCont::reviseStops().

Here is the caller graph for this function:

◆ getRoute()

const std::vector< NBEdge * > & NBPTLine::getRoute ( ) const

Definition at line 174 of file NBPTLine.cpp.

References myRoute.

Referenced by NBPTLineCont::findWay(), NBPTLineCont::fixPermissions(), NBPTLineCont::process(), and NBPTLineCont::reviseStops().

Here is the caller graph for this function:

◆ getRouteEnd()

NBEdge * NBPTLine::getRouteEnd ( const NBEdgeCont ec) const

return last valid edge of myRoute (if it doest not lie before the last stop)

Definition at line 223 of file NBPTLine.cpp.

References NBEdge::getID(), myPTLineId, myPTStops, myRoute, NBEdgeCont::retrieve(), TL, and WRITE_WARNINGF.

Referenced by NBRailwayTopologyAnalyzer::addBidiEdgesForStops().

Here is the caller graph for this function:

◆ getRouteStart()

NBEdge * NBPTLine::getRouteStart ( const NBEdgeCont ec) const

return first valid edge of myRoute (if it doest not lie after the first stop)

Definition at line 193 of file NBPTLine.cpp.

References NBEdge::getID(), myPTLineId, myPTStops, myRoute, NBEdgeCont::retrieve(), TL, and WRITE_WARNINGF.

Referenced by NBRailwayTopologyAnalyzer::addBidiEdgesForStops().

Here is the caller graph for this function:

◆ getStopEdges()

std::vector< std::pair< NBEdge *, std::string > > NBPTLine::getStopEdges ( const NBEdgeCont ec) const

get stop edges and stop ids

Definition at line 180 of file NBPTLine.cpp.

References NBEdge::getID(), myPTStops, and NBEdgeCont::retrieve().

Referenced by NBRailwayTopologyAnalyzer::addBidiEdgesForStops().

Here is the caller graph for this function:

◆ getStops()

const std::vector< std::shared_ptr< NBPTStop > > & NBPTLine::getStops ( )

Definition at line 68 of file NBPTLine.cpp.

References myPTStops.

Referenced by NBPTLineCont::fixBidiStops(), NIXMLPTHandler::myEndElement(), NIImporter_OpenStreetMap::RelationHandler::myEndElement(), NBPTLineCont::process(), NBPTLineCont::reviseSingleWayStops(), and NBPTLineCont::reviseStops().

Here is the caller graph for this function:

◆ getType()

const std::string & NBPTLine::getType ( ) const
inline

Definition at line 59 of file NBPTLine.h.

References myType.

Referenced by NBPTLineCont::fixBidiStops().

Here is the caller graph for this function:

◆ getVClass()

SUMOVehicleClass NBPTLine::getVClass ( ) const
inline

Definition at line 89 of file NBPTLine.h.

References myVClass.

Referenced by NBPTLineCont::constructRoute(), and NBPTLineCont::fixPermissions().

Here is the caller graph for this function:

◆ getWayNodes()

const std::vector< long long int > * NBPTLine::getWayNodes ( std::string  wayId)

Definition at line 132 of file NBPTLine.cpp.

References myWayNodes.

Referenced by NBPTLineCont::reviseStops().

Here is the caller graph for this function:

◆ getWays()

const std::vector< std::string > & NBPTLine::getWays ( ) const
inline

Definition at line 118 of file NBPTLine.h.

References myWays.

Referenced by NBPTLineCont::constructRoute(), NBPTLineCont::findWay(), NBPTLineCont::reviseSingleWayStops(), and NBPTLineCont::reviseStops().

Here is the caller graph for this function:

◆ isConsistent()

bool NBPTLine::isConsistent ( std::vector< NBEdge * >  stops) const

return whether the mentioned edges appear in that order in the route

Definition at line 253 of file NBPTLine.cpp.

References myRoute.

Referenced by NBRailwayTopologyAnalyzer::addBidiEdgesForStops().

Here is the caller graph for this function:

◆ removeInvalidEdges()

void NBPTLine::removeInvalidEdges ( const NBEdgeCont ec)

remove invalid edges from the line

Definition at line 346 of file NBPTLine.cpp.

References NBEdgeCont::getSplit(), myRoute, NBEdgeCont::retrieve(), and split().

◆ replaceEdge()

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

replace the edge with the given edge list

Definition at line 289 of file NBPTLine.cpp.

References myRoute.

◆ replaceStop()

void NBPTLine::replaceStop ( std::shared_ptr< NBPTStop oldStop,
std::shared_ptr< NBPTStop newStop 
)

replace the given stop

Definition at line 279 of file NBPTLine.cpp.

References myPTStops.

Referenced by NBPTLineCont::findWay(), and NBPTLineCont::reviseStops().

Here is the caller graph for this function:

◆ replaceStops()

void NBPTLine::replaceStops ( std::vector< std::shared_ptr< NBPTStop > >  stops)
inline

Definition at line 74 of file NBPTLine.h.

References myPTStops.

Referenced by NBPTLineCont::fixBidiStops().

Here is the caller graph for this function:

◆ setEdges()

void NBPTLine::setEdges ( const std::vector< NBEdge * > &  edges)

Definition at line 141 of file NBPTLine.cpp.

References myRoute, myVClass, SUMO_const_laneWidth, SVC_BICYCLE, and SVC_PEDESTRIAN.

Referenced by NIXMLPTHandler::addPTLineFromFlow(), NIXMLPTHandler::addPTLineRoute(), NBPTLineCont::constructRoute(), and NBPTLineCont::process().

Here is the caller graph for this function:

◆ setName()

void NBPTLine::setName ( const std::string &  name)
inline

Definition at line 106 of file NBPTLine.h.

References myName.

Referenced by NIXMLPTHandler::addPTLine(), and NIXMLPTHandler::myStartElement().

Here is the caller graph for this function:

◆ setNumOfStops()

void NBPTLine::setNumOfStops ( int  numStops,
int  missingBefore,
int  missingAfter 
)

Definition at line 166 of file NBPTLine.cpp.

References myMissingStopsAfter, myMissingStopsBefore, and myNumOfStops.

Referenced by NIXMLPTHandler::myEndElement(), and NIImporter_OpenStreetMap::RelationHandler::myEndElement().

Here is the caller graph for this function:

◆ setPeriod()

void NBPTLine::setPeriod ( int  intervalS)
inline

Definition at line 114 of file NBPTLine.h.

References myInterval.

Referenced by NIXMLPTHandler::addPTLine().

Here is the caller graph for this function:

◆ setRef()

void NBPTLine::setRef ( const std::string &  line)
inline

Definition at line 110 of file NBPTLine.h.

References myRef.

Referenced by NIXMLPTHandler::addPTLine().

Here is the caller graph for this function:

◆ write()

Field Documentation

◆ myColor

RGBColor NBPTLine::myColor
private

Definition at line 134 of file NBPTLine.h.

Referenced by write().

◆ myCurrentWay

std::string NBPTLine::myCurrentWay
private

Definition at line 130 of file NBPTLine.h.

Referenced by addWayNode().

◆ myInterval

int NBPTLine::myInterval
private

Definition at line 137 of file NBPTLine.h.

Referenced by setPeriod(), and write().

◆ myMissingStopsAfter

int NBPTLine::myMissingStopsAfter
private

Definition at line 153 of file NBPTLine.h.

Referenced by setNumOfStops(), and write().

◆ myMissingStopsBefore

int NBPTLine::myMissingStopsBefore
private

Definition at line 152 of file NBPTLine.h.

Referenced by setNumOfStops(), and write().

◆ myName

std::string NBPTLine::myName
private

Definition at line 125 of file NBPTLine.h.

Referenced by getName(), setName(), and write().

◆ myNightService

std::string NBPTLine::myNightService
private

Definition at line 139 of file NBPTLine.h.

Referenced by write().

◆ myNumOfStops

int NBPTLine::myNumOfStops
private

Definition at line 151 of file NBPTLine.h.

Referenced by setNumOfStops(), and write().

◆ myPTLineId

std::string NBPTLine::myPTLineId
private

Definition at line 131 of file NBPTLine.h.

Referenced by getLineID(), getRouteEnd(), getRouteStart(), and write().

◆ myPTStops

std::vector<std::shared_ptr<NBPTStop> > NBPTLine::myPTStops
private

◆ myRef

std::string NBPTLine::myRef
private

Definition at line 132 of file NBPTLine.h.

Referenced by getRef(), setRef(), and write().

◆ myRoute

std::vector<NBEdge*> NBPTLine::myRoute
private

◆ myType

std::string NBPTLine::myType
private

Definition at line 126 of file NBPTLine.h.

Referenced by getType(), and write().

◆ myVClass

SUMOVehicleClass NBPTLine::myVClass
private

Definition at line 140 of file NBPTLine.h.

Referenced by getVClass(), setEdges(), and write().

◆ myWayNodes

std::map<std::string, std::vector<long long int> > NBPTLine::myWayNodes
private

Definition at line 128 of file NBPTLine.h.

Referenced by addWayNode(), and getWayNodes().

◆ myWays

std::vector<std::string> NBPTLine::myWays
private

Definition at line 129 of file NBPTLine.h.

Referenced by addWayNode(), and getWays().


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