Eclipse SUMO - Simulation of Urban MObility
NBEdgeCont Class Reference

Storage for edges, including some functionality operating on multiple edges. More...

#include <NBEdgeCont.h>

Collaboration diagram for NBEdgeCont:

Data Structures

struct  PostProcessConnection
 A structure representing a connection between two lanes. More...
 
struct  Split
 A structure which describes changes of lane number or speed along the road. More...
 
class  split_sorter
 Sorts splits by their position (increasing) More...
 

Public Member Functions

void addRoundabout (const EdgeSet &roundabout)
 add user specified roundabout More...
 
void applyOptions (OptionsCont &oc)
 Initialises the storage by applying given options. More...
 
void checkGrade (double threshold) const
 check whether edges are to steep More...
 
void checkOverlap (double threshold, double zThreshold) const
 check whether edges overlap More...
 
void clear ()
 Deletes all edges. More...
 
void generateStreetSigns ()
 assigns street signs to edges based on toNode types More...
 
EdgeVector getAllEdges () const
 return all edges More...
 
RouterEdgeVector getAllRouterEdges () const
 
NBEdgegetByID (const std::string &edgeID) const
 Returns the edge with id if it exists. More...
 
EdgeVector getGeneratedFrom (const std::string &id) const
 Returns the edges which have been built by splitting the edge of the given id. More...
 
NBEdgegetOppositeByID (const std::string &edgeID) const
 Returns the edge with negated id if it exists. More...
 
const std::set< EdgeSetgetRoundabouts () const
 Returns the determined roundabouts. More...
 
int guessRoundabouts ()
 Determines which edges belong to roundabouts and increases their priority. More...
 
int guessSpecialLanes (SUMOVehicleClass svc, double width, double minSpeed, double maxSpeed, bool fromPermissions, const std::string &excludeOpt)
 add sidwalks to edges within the given limits or permissions and return the number of edges affected More...
 
void ignore (std::string id)
 mark the given edge id as ignored More...
 
bool ignoreFilterMatch (NBEdge *edge)
 Returns true if this edge matches one of the removal criteria. More...
 
int joinLanes (SVCPermissions perms)
 join adjacent lanes with the given permissions More...
 
void markRoundabouts ()
 mark edge priorities and prohibit turn-arounds for all roundabout edges More...
 
 NBEdgeCont (NBTypeCont &tc)
 Constructor. More...
 
void patchRoundabouts (NBEdge *orig, NBEdge *part1, NBEdge *part2, std::set< EdgeSet > &roundabouts)
 fix roundabout information after splitting an edge More...
 
int remapIDs (bool numericaIDs, bool reservedIDs, const std::string &prefix, NBPTStopCont &sc)
 remap node IDs accoring to options –numerical-ids and –reserved-ids More...
 
void removeRoundabout (const NBNode *node)
 remove roundabout that contains the given node More...
 
void rename (NBEdge *edge, const std::string &newID)
 Renames the edge. Throws exception if newID already exists. More...
 
bool wasIgnored (std::string id) const
 Returns whether the edge with the id was ignored during parsing. More...
 
bool wasRemoved (std::string id) const
 Returns whether the edge with the id was deleted explicitly. More...
 
 ~NBEdgeCont ()
 Destructor. More...
 
edge access methods
bool insert (NBEdge *edge, bool ignorePrunning=false)
 Adds an edge to the dictionary. More...
 
NBEdgeretrieve (const std::string &id, bool retrieveExtracted=false) const
 Returns the edge that has the given id. More...
 
NBEdgeretrievePossiblySplit (const std::string &id, bool downstream) const
 Tries to retrieve an edge, even if it is splitted. More...
 
NBEdgeretrievePossiblySplit (const std::string &id, const std::string &hint, bool incoming) const
 Tries to retrieve an edge, even if it is splitted. More...
 
NBEdgeretrievePossiblySplit (const std::string &id, double pos) const
 Tries to retrieve an edge, even if it is splitted. More...
 
void erase (NBDistrictCont &dc, NBEdge *edge)
 Removes the given edge from the container (deleting it) More...
 
void extract (NBDistrictCont &dc, NBEdge *edge, bool remember=false)
 Removes the given edge from the container like erase but does not delete it. More...
 
std::map< std::string, NBEdge * >::const_iterator begin () const
 Returns the pointer to the begin of the stored edges. More...
 
std::map< std::string, NBEdge * >::const_iterator end () const
 Returns the pointer to the end of the stored edges. More...
 
explicit edge manipulation methods
void processSplits (NBEdge *e, std::vector< Split > splits, NBNodeCont &nc, NBDistrictCont &dc, NBTrafficLightLogicCont &tlc)
 
bool splitAt (NBDistrictCont &dc, NBEdge *edge, NBNode *node)
 Splits the edge at the position nearest to the given node. More...
 
bool splitAt (NBDistrictCont &dc, NBEdge *edge, NBNode *node, const std::string &firstEdgeName, const std::string &secondEdgeName, int noLanesFirstEdge, int noLanesSecondEdge, const double speed=-1., const int changedLeft=0)
 Splits the edge at the position nearest to the given node using the given modifications. More...
 
bool splitAt (NBDistrictCont &dc, NBEdge *edge, double edgepos, NBNode *node, const std::string &firstEdgeName, const std::string &secondEdgeName, int noLanesFirstEdge, int noLanesSecondEdge, const double speed=-1., const int changedLeft=0)
 Splits the edge at the position nearest to the given node using the given modifications. More...
 
container access methods
int size () const
 Returns the number of edges. More...
 
std::vector< std::string > getAllNames () const
 Returns all ids of known edges. More...
 
int getNoEdgeSplits () const
 Returns the number of edge splits. More...
 
Adapting the input
void removeUnwishedEdges (NBDistrictCont &dc)
 Removes unwished edges (not in keep-edges) More...
 
void splitGeometry (NBDistrictCont &dc, NBNodeCont &nc)
 Splits edges into multiple if they have a complex geometry. More...
 
void reduceGeometries (const double minDist)
 
void checkGeometries (const double maxAngle, const double minRadius, bool fix, bool fixRailways, bool silent=false)
 
processing methods
void sortOutgoingLanesConnections ()
 Sorts all lanes of all edges within the container by their direction. More...
 
void computeEdge2Edges (bool noLeftMovers)
 Computes for each edge the approached edges. More...
 
void computeLanes2Edges ()
 Computes for each edge which lanes approach the next edges. More...
 
void recheckLanes ()
 Rechecks whether all lanes have a successor for each of the stored edges. More...
 
void appendTurnarounds (bool noTLSControlled, bool onlyDeadends, bool noGeometryLike)
 Appends turnarounds to all edges stored in the container. More...
 
void appendTurnarounds (const std::set< std::string > &ids, bool noTLSControlled)
 Appends turnarounds to all edges stored in the container Calls "NBEdge::appendTurnaround" for edges with the given ids. More...
 
void appendRailwayTurnarounds (const NBPTStopCont &sc)
 Appends turnarounds to all bidiRail edges with stops. More...
 
void computeEdgeShapes (double smoothElevationThreshold=-1)
 Computes the shapes of all edges stored in the container. More...
 
void computeLaneShapes ()
 Computes the shapes of all lanes of all edges stored in the container. More...
 
void clearControllingTLInformation () const
 Clears information about controlling traffic lights for all connenections of all edges. More...
 
void joinSameNodeConnectingEdges (NBDistrictCont &dc, NBTrafficLightLogicCont &tlc, EdgeVector edges)
 Joins the given edges because they connect the same nodes. More...
 
void guessOpposites ()
 Sets opposite lane information for geometrically close edges. More...
 
void recheckLaneSpread ()
 Rechecks whether the lane spread is proper. More...
 
Connections handling
void addPostProcessConnection (const std::string &from, int fromLane, const std::string &to, int toLane, bool mayDefinitelyPass, bool keepClear, double contPos, double visibility, double speed, const PositionVector &customShape, bool uncontrolled, bool warnOnly, SVCPermissions permissions=SVC_UNSPECIFIED)
 Adds a connection which could not be set during loading. More...
 
bool hasPostProcessConnection (const std::string &from, const std::string &to="")
 
void recheckPostProcessConnections ()
 Try to set any stored connections. More...
 

Private Types

typedef std::map< std::string, NBEdge * > EdgeCont
 The type of the dictionary where an edge may be found by its id. More...
 

Private Member Functions

 NBEdgeCont (const NBEdgeCont &s)
 invalidated copy constructor More...
 
NBEdgeContoperator= (const NBEdgeCont &s)
 invalidated assignment operator More...
 

Static Private Member Functions

static double formFactor (const EdgeVector &loopEdges)
 compute the form factor for a loop of edges More...
 

Private Attributes

std::map< std::string, std::vector< PostProcessConnection > > myConnections
 The list of connections to recheck. More...
 
EdgeCont myEdges
 The instance of the dictionary (id->edge) More...
 
int myEdgesSplit
 the number of splits of edges during the building More...
 
EdgeCont myExtractedEdges
 The extracted nodes which are kept for reference. More...
 
std::set< EdgeSetmyGuessedRoundabouts
 Edges marked as belonging to a roundabout after guessing. More...
 
std::set< std::string > myIgnoredEdges
 The ids of ignored edges. More...
 
std::set< EdgeSetmyRoundabouts
 Edges marked as belonging to a roundabout by the user (each EdgeVector is a roundabout) More...
 
NBTypeContmyTypeCont
 The network builder; used to obtain type information. More...
 
Settings for accepting/dismissing edges
double myEdgesMinSpeed
 The minimum speed an edge may have in order to be kept (default: -1) More...
 
bool myRemoveEdgesAfterJoining
 Whether edges shall be joined first, then removed. More...
 
std::set< std::string > myEdges2Keep
 Set of ids of edges which shall explicitly be kept. More...
 
std::set< std::string > myEdges2Remove
 Set of ids of edges which shall explicitly be removed. More...
 
SVCPermissions myVehicleClasses2Keep
 Set of vehicle types which must be allowed on edges in order to keep them. More...
 
SVCPermissions myVehicleClasses2Remove
 Set of vehicle types which need not be supported (edges which allow ONLY these are removed) More...
 
std::set< std::string > myTypes2Keep
 Set of edges types which shall be kept. More...
 
std::set< std::string > myTypes2Remove
 Set of edges types which shall be removed. More...
 
PositionVector myPruningBoundary
 Boundary within which an edge must be located in order to be kept. More...
 
bool myNeedGeoTransformedPruningBoundary
 whether a geo transform has been applied to the pruning boundary More...
 

Detailed Description

Storage for edges, including some functionality operating on multiple edges.

Definition at line 60 of file NBEdgeCont.h.

Member Typedef Documentation

◆ EdgeCont

typedef std::map<std::string, NBEdge*> NBEdgeCont::EdgeCont
private

The type of the dictionary where an edge may be found by its id.

Definition at line 671 of file NBEdgeCont.h.

Constructor & Destructor Documentation

◆ NBEdgeCont() [1/2]

NBEdgeCont::NBEdgeCont ( NBTypeCont tc)

Constructor.

Parameters
[in]tcThe net builded; used to obtain types

Definition at line 58 of file NBEdgeCont.cpp.

◆ ~NBEdgeCont()

NBEdgeCont::~NBEdgeCont ( )

Destructor.

Definition at line 67 of file NBEdgeCont.cpp.

References clear().

◆ NBEdgeCont() [2/2]

NBEdgeCont::NBEdgeCont ( const NBEdgeCont s)
private

invalidated copy constructor

Member Function Documentation

◆ addPostProcessConnection()

void NBEdgeCont::addPostProcessConnection ( const std::string &  from,
int  fromLane,
const std::string &  to,
int  toLane,
bool  mayDefinitelyPass,
bool  keepClear,
double  contPos,
double  visibility,
double  speed,
const PositionVector customShape,
bool  uncontrolled,
bool  warnOnly,
SVCPermissions  permissions = SVC_UNSPECIFIED 
)

Adds a connection which could not be set during loading.

Parameters
[in]fromThe id of the edge the connection starts at
[in]fromLaneThe number of the lane the connection starts at
[in]toThe id of the edge the connection ends at
[in]toLaneThe number of the lane the connection ends at
[in]mayDefinitelyPassWhether the connection may be passed without braking
[in]keepClearWhether the connection must check to keep the junction clear
[in]contPosCustom position for internal junction
[in]visibilityCustom foe visiblity connection
[in]speedCustom speed
[in]customShapeCustom shape
[in]warnOnlyWhether a failure to set this connection should only result in a warning

Definition at line 1052 of file NBEdgeCont.cpp.

References myConnections.

Referenced by NIXMLConnectionsHandler::parseLaneBound().

◆ addRoundabout()

void NBEdgeCont::addRoundabout ( const EdgeSet roundabout)

add user specified roundabout

Definition at line 1353 of file NBEdgeCont.cpp.

References myRoundabouts, toString(), and WRITE_WARNING.

Referenced by NIImporter_SUMO::_loadNetwork(), and NIXMLEdgesHandler::addRoundabout().

◆ appendRailwayTurnarounds()

◆ appendTurnarounds() [1/2]

void NBEdgeCont::appendTurnarounds ( bool  noTLSControlled,
bool  onlyDeadends,
bool  noGeometryLike 
)

Appends turnarounds to all edges stored in the container.

Calls "NBEdge::appendTurnaround" for all edges within the container.

Parameters
[in]noTLSControlledWhether the turnaround shall not be connected if the edge is controlled by a tls
[in]exceptDeadendsWhether the turnaround shall only be built at deadends
Todo:
Recheck whether a visitor-pattern should be used herefor
See also
NBEdge::appendTurnaround

Definition at line 838 of file NBEdgeCont.cpp.

References myEdges.

Referenced by NBNetBuilder::compute().

◆ appendTurnarounds() [2/2]

void NBEdgeCont::appendTurnarounds ( const std::set< std::string > &  ids,
bool  noTLSControlled 
)

Appends turnarounds to all edges stored in the container Calls "NBEdge::appendTurnaround" for edges with the given ids.

Parameters
[in]idsThe list of ids for which to append a turnaround
[in]noTLSControlledWhether the turnaround shall not be connected if the edge is controlled by a tls
See also
NBEdge::appendTurnaround

Definition at line 846 of file NBEdgeCont.cpp.

References myEdges.

◆ applyOptions()

void NBEdgeCont::applyOptions ( OptionsCont oc)

Initialises the storage by applying given options.

Options, mainly steering the acceptance of edges, are parsed and the according internal variables are set.

Parameters
[in]ocThe options container to read options from
Todo:
Recheck exceptions

Definition at line 73 of file NBEdgeCont.cpp.

References OptionsCont::exists(), OptionsCont::getBool(), OptionsCont::getFloat(), OptionsCont::getString(), OptionsCont::getStringVector(), OptionsCont::isSet(), NBHelpers::loadEdgesFromFile(), myEdges2Keep, myEdges2Remove, myEdgesMinSpeed, myNeedGeoTransformedPruningBoundary, myPruningBoundary, myRemoveEdgesAfterJoining, myTypes2Keep, myTypes2Remove, myVehicleClasses2Keep, myVehicleClasses2Remove, parseVehicleClasses(), and StringUtils::toDouble().

Referenced by NBNetBuilder::applyOptions().

◆ begin()

◆ checkGeometries()

void NBEdgeCont::checkGeometries ( const double  maxAngle,
const double  minRadius,
bool  fix,
bool  fixRailways,
bool  silent = false 
)
Parameters
[in]maxAngleThe maximum geometry angle allowed
[in]minRadiusThe minimum turning radius allowed at the start and end
[in]fixWhether to prune geometry points to avoid sharp turns at start and end
See also
NBEdge::checkGeometry

Definition at line 752 of file NBEdgeCont.cpp.

References isForbidden(), isRailway(), isSidewalk(), and myEdges.

Referenced by NBNetBuilder::compute().

◆ checkGrade()

◆ checkOverlap()

◆ clear()

void NBEdgeCont::clear ( )

Deletes all edges.

Definition at line 138 of file NBEdgeCont.cpp.

References myEdges, and myExtractedEdges.

Referenced by ~NBEdgeCont().

◆ clearControllingTLInformation()

void NBEdgeCont::clearControllingTLInformation ( ) const

Clears information about controlling traffic lights for all connenections of all edges.

Definition at line 766 of file NBEdgeCont.cpp.

References myEdges.

Referenced by NBTrafficLightLogicCont::setTLControllingInformation().

◆ computeEdge2Edges()

void NBEdgeCont::computeEdge2Edges ( bool  noLeftMovers)

Computes for each edge the approached edges.

Calls "NBEdge::computeEdge2Edges" for all edges within the container.

Parameters
[in]noLeftMoversWhether left-moving connections shall be omitted
Todo:
Recheck whether a visitor-pattern should be used herefor
See also
NBEdge::computeEdge2Edges

Definition at line 782 of file NBEdgeCont.cpp.

References myEdges.

Referenced by NBNetBuilder::compute().

◆ computeEdgeShapes()

void NBEdgeCont::computeEdgeShapes ( double  smoothElevationThreshold = -1)

Computes the shapes of all edges stored in the container.

Calls "NBEdge::computeEdgeShape" for all edges within the container.

Todo:

Recheck whether a visitor-pattern should be used herefor

Recheck usage

See also
NBEdge::computeEdgeShape

Definition at line 875 of file NBEdgeCont.cpp.

References NBEdge::getLaneID(), NBEdge::getLanes(), NBEdge::getLength(), NBEdge::getNumLanes(), myEdges, NUMERICAL_EPS, retrieve(), and NBEdge::setAverageLengthWithOpposite().

Referenced by NBNetBuilder::compute().

◆ computeLanes2Edges()

void NBEdgeCont::computeLanes2Edges ( )

Computes for each edge which lanes approach the next edges.

Calls "NBEdge::computeLanes2Edges" for all edges within the container.

Todo:
Recheck whether a visitor-pattern should be used herefor
See also
NBEdge::computeLanes2Edges

Definition at line 790 of file NBEdgeCont.cpp.

References myEdges.

Referenced by NBNetBuilder::compute().

◆ computeLaneShapes()

void NBEdgeCont::computeLaneShapes ( )

Computes the shapes of all lanes of all edges stored in the container.

Calls "NBEdge::computeLaneShapes" for all edges within the container.

Todo:

Recheck whether a visitor-pattern should be used herefor

Recheck usage

See also
NBEdge::computeLaneShapes

Definition at line 899 of file NBEdgeCont.cpp.

References myEdges.

Referenced by NBNetBuilder::compute().

◆ end()

◆ erase()

void NBEdgeCont::erase ( NBDistrictCont dc,
NBEdge edge 
)

Removes the given edge from the container (deleting it)

Parameters
[in]dcThe district container, in order to remove the edge from sources/sinks
[in]edgeThe edge to remove
Todo:
Recheck whether the district cont is needed - if districts are processed using an external tool

Definition at line 380 of file NBEdgeCont.cpp.

References extract().

Referenced by NIImporter_SUMO::_loadNetwork(), NIXMLEdgesHandler::addEdge(), NBNodeCont::removeComponents(), NBNodeCont::removeIsolatedRoads(), NBNode::removeSelfLoops(), removeUnwishedEdges(), and splitAt().

◆ extract()

void NBEdgeCont::extract ( NBDistrictCont dc,
NBEdge edge,
bool  remember = false 
)

Removes the given edge from the container like erase but does not delete it.

Parameters
[in]dcThe district container, in order to remove the edge from sources/sinks
[in]edgeThe edge to remove
[in]rememberWhether to keep this edge for future reference
Todo:

Recheck whether the district cont is needed - if districts are processed using an external tool

Recheck whether this is used at all and why

Definition at line 387 of file NBEdgeCont.cpp.

References NBEdge::getID(), myEdges, myExtractedEdges, NBEdge::myFrom, NBEdge::myTo, NBNode::removeEdge(), and NBDistrictCont::removeFromSinksAndSources().

Referenced by NIXMLEdgesHandler::deleteEdge(), GNENet::deleteSingleEdge(), erase(), NBNodeCont::joinNodeCluster(), joinSameNodeConnectingEdges(), and NBNodeCont::removeUnwishedNodes().

◆ formFactor()

double NBEdgeCont::formFactor ( const EdgeVector loopEdges)
staticprivate

compute the form factor for a loop of edges

Definition at line 1334 of file NBEdgeCont.cpp.

References PositionVector::append(), PositionVector::area(), PositionVector::length2D(), and M_PI.

Referenced by guessRoundabouts().

◆ generateStreetSigns()

◆ getAllEdges()

EdgeVector NBEdgeCont::getAllEdges ( ) const

◆ getAllNames()

std::vector< std::string > NBEdgeCont::getAllNames ( ) const

Returns all ids of known edges.

Returns
All ids of known edges
Todo:
Recheck usage, probably, filling a given vector would be better...

Definition at line 689 of file NBEdgeCont.cpp.

References myEdges.

Referenced by GNENet::initJunctionsAndEdges(), remapIDs(), NBNodeCont::removeIsolatedRoads(), NWWriter_DlrNavteq::writeNodesUnsplitted(), and NWWriter_DlrNavteq::writeProhibitedManoeuvres().

◆ getAllRouterEdges()

RouterEdgeVector NBEdgeCont::getAllRouterEdges ( ) const

◆ getByID()

◆ getGeneratedFrom()

EdgeVector NBEdgeCont::getGeneratedFrom ( const std::string &  id) const

Returns the edges which have been built by splitting the edge of the given id.

Parameters
[in]idThe id of the original edge
Returns
List of all edges which have been built by splitting the original edge
Todo:
Recheck usage

Definition at line 1115 of file NBEdgeCont.cpp.

References myEdges.

Referenced by NBPTStopCont::assignLanes(), and retrievePossiblySplit().

◆ getNoEdgeSplits()

int NBEdgeCont::getNoEdgeSplits ( ) const
inline

Returns the number of edge splits.

Returns
How often an edge was split

Definition at line 319 of file NBEdgeCont.h.

References myEdgesSplit.

Referenced by NILoader::load().

◆ getOppositeByID()

NBEdge * NBEdgeCont::getOppositeByID ( const std::string &  edgeID) const

Returns the edge with negated id if it exists.

Definition at line 1038 of file NBEdgeCont.cpp.

References myEdges.

Referenced by recheckLaneSpread(), and NWWriter_DlrNavteq::writeNodesUnsplitted().

◆ getRoundabouts()

const std::set< EdgeSet > NBEdgeCont::getRoundabouts ( ) const

◆ guessOpposites()

◆ guessRoundabouts()

int NBEdgeCont::guessRoundabouts ( )

◆ guessSpecialLanes()

int NBEdgeCont::guessSpecialLanes ( SUMOVehicleClass  svc,
double  width,
double  minSpeed,
double  maxSpeed,
bool  fromPermissions,
const std::string &  excludeOpt 
)

add sidwalks to edges within the given limits or permissions and return the number of edges affected

Definition at line 1443 of file NBEdgeCont.cpp.

References NBEdge::addRestrictedLane(), NBEdge::getID(), OptionsCont::getOptions(), NBEdge::getPermissions(), NBEdge::getSpeed(), OptionsCont::getStringVector(), NBEdge::hasRestrictedLane(), and myEdges.

Referenced by NBNetBuilder::compute().

◆ hasPostProcessConnection()

bool NBEdgeCont::hasPostProcessConnection ( const std::string &  from,
const std::string &  to = "" 
)

Definition at line 1059 of file NBEdgeCont.cpp.

References myConnections.

Referenced by NBNodeCont::joinNodeCluster().

◆ ignore()

void NBEdgeCont::ignore ( std::string  id)
inline

mark the given edge id as ignored

Definition at line 506 of file NBEdgeCont.h.

References myIgnoredEdges.

Referenced by NIImporter_SUMO::_loadNetwork().

◆ ignoreFilterMatch()

◆ insert()

bool NBEdgeCont::insert ( NBEdge edge,
bool  ignorePrunning = false 
)

Adds an edge to the dictionary.

First, it is determined whether the edge shall not be discarded due to any reasons (being outside a boundary, or not in the optional list of edges to import, etc.). If so, the edge is deleted and "true" is returned. "true" is also returned if the edge is accepted - no edge with the same name exists within this container. If another edge with the same name exists, false is returned.

Parameters
[in]edgeThe edge to add
[in]ignorePrunningWhether this edge must not be prunned
Returns
Whether the edge was valid (no edge with the same id is already known)

Definition at line 153 of file NBEdgeCont.cpp.

References NBEdge::dismissVehicleClassInformation(), OptionsCont::exists(), OptionsCont::getBool(), NBEdge::getFromNode(), NBEdge::getID(), OptionsCont::getOptions(), NBEdge::getToNode(), ignoreFilterMatch(), myEdges, myIgnoredEdges, and NBNode::removeEdge().

Referenced by NIImporter_SUMO::_loadNetwork(), NBRailwayTopologyAnalyzer::addBidiEdge(), NIVissimEdge::buildNBEdge(), NIVissimDistrictConnection::dict_BuildDistricts(), NBRailwayTopologyAnalyzer::getRailNodes(), NIImporter_OpenStreetMap::insertEdge(), GNENet::insertEdge(), joinSameNodeConnectingEdges(), NIImporter_ArcView::load(), NIImporter_RobocupRescue::loadEdges(), NIImporter_OpenDrive::loadNetwork(), NIXMLEdgesHandler::myEndElement(), NIImporter_VISUM::parse_Connectors_legacy(), NIImporter_VISUM::parse_Edges(), splitAt(), and NGNet::toNB().

◆ joinLanes()

int NBEdgeCont::joinLanes ( SVCPermissions  perms)

join adjacent lanes with the given permissions

Definition at line 1588 of file NBEdgeCont.cpp.

References myEdges.

Referenced by NBNetBuilder::compute().

◆ joinSameNodeConnectingEdges()

void NBEdgeCont::joinSameNodeConnectingEdges ( NBDistrictCont dc,
NBTrafficLightLogicCont tlc,
EdgeVector  edges 
)

Joins the given edges because they connect the same nodes.

Parameters
[in]dcThe district container needed to remove edges
[in]tlcThe tls container needed to remove edges
[in]edgesThe edges to join
Todo:
Recheck and describe usage

Definition at line 907 of file NBEdgeCont.cpp.

References NBEdge::addEdge2EdgeConnection(), extract(), Named::getID(), NBEdge::getLanes(), insert(), MAX2(), NBEdge::moveOutgoingConnectionsFrom(), NBNode::replaceIncoming(), NBNode::replaceOutgoing(), NBTrafficLightLogicCont::replaceRemoved(), NBEdge::setEndOffset(), NBEdge::setLaneWidth(), NBEdge::setPermissions(), NBEdge::UNSPECIFIED_OFFSET, and NBEdge::UNSPECIFIED_WIDTH.

Referenced by NBNodeCont::joinSimilarEdges().

◆ markRoundabouts()

void NBEdgeCont::markRoundabouts ( )

mark edge priorities and prohibit turn-arounds for all roundabout edges

Definition at line 1377 of file NBEdgeCont.cpp.

References NBNode::getIncomingEdges(), getRoundabouts(), NBEdge::LANES2LANES_USER, NBEdge::ROUNDABOUT, and NBNode::setRoundabout().

Referenced by NBNetBuilder::compute().

◆ operator=()

NBEdgeCont& NBEdgeCont::operator= ( const NBEdgeCont s)
private

invalidated assignment operator

◆ patchRoundabouts()

void NBEdgeCont::patchRoundabouts ( NBEdge orig,
NBEdge part1,
NBEdge part2,
std::set< EdgeSet > &  roundabouts 
)

fix roundabout information after splitting an edge

Definition at line 671 of file NBEdgeCont.cpp.

Referenced by splitAt().

◆ processSplits()

◆ recheckLanes()

void NBEdgeCont::recheckLanes ( )

Rechecks whether all lanes have a successor for each of the stored edges.

Calls "NBEdge::recheckLanes" for all edges within the container.

Todo:
Recheck whether a visitor-pattern should be used herefor
See also
NBEdge::recheckLanes

Definition at line 798 of file NBEdgeCont.cpp.

References OptionsCont::getBool(), NBEdge::getFinalLength(), NBEdge::getFromNode(), NBEdge::getID(), NBEdge::getLaneID(), NBEdge::getLanes(), NBEdge::getLaneStruct(), NBEdge::getLoadedLength(), NBEdge::getNumLanes(), OptionsCont::getOptions(), NBEdge::getToNode(), myEdges, NUMERICAL_EPS, NBEdge::recheckLanes(), retrieve(), NBEdge::setLoadedLength(), toString(), WRITE_ERROR, and WRITE_WARNING.

Referenced by NBNetBuilder::compute().

◆ recheckLaneSpread()

void NBEdgeCont::recheckLaneSpread ( )

Rechecks whether the lane spread is proper.

Todo:
Recheck usage; check whether this is really needed and whether it works at all

Definition at line 1024 of file NBEdgeCont.cpp.

References getOppositeByID(), LANESPREAD_CENTER, LANESPREAD_RIGHT, myEdges, and NBEdge::setLaneSpreadFunction().

Referenced by NIImporter_DlrNavteq::loadNetwork().

◆ recheckPostProcessConnections()

◆ reduceGeometries()

void NBEdgeCont::reduceGeometries ( const double  minDist)
Parameters
[in]ncThe node container needed to build (geometry) nodes
See also
NBEdge::reduceGeometry

Definition at line 744 of file NBEdgeCont.cpp.

References myEdges.

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

◆ remapIDs()

int NBEdgeCont::remapIDs ( bool  numericaIDs,
bool  reservedIDs,
const std::string &  prefix,
NBPTStopCont sc 
)

◆ removeRoundabout()

void NBEdgeCont::removeRoundabout ( const NBNode node)

remove roundabout that contains the given node

Definition at line 1364 of file NBEdgeCont.cpp.

References myRoundabouts.

Referenced by NIXMLNodesHandler::processNodeType(), and GNEJunction::setAttribute().

◆ removeUnwishedEdges()

void NBEdgeCont::removeUnwishedEdges ( NBDistrictCont dc)

Removes unwished edges (not in keep-edges)

Parameters
[in,opt.changed] dc The district container needed to remove edges
Todo:
Recheck usage; check whether keep-edges.postload is really useful

Definition at line 700 of file NBEdgeCont.cpp.

References erase(), NBEdge::getFromNode(), NBEdge::getID(), NBEdge::getToNode(), myEdges, myEdges2Keep, and NBNode::removeEdge().

Referenced by NBNetBuilder::compute().

◆ rename()

void NBEdgeCont::rename ( NBEdge edge,
const std::string &  newID 
)

Renames the edge. Throws exception if newID already exists.

Definition at line 399 of file NBEdgeCont.cpp.

References NBEdge::getID(), myEdges, and Named::setID().

Referenced by remapIDs(), and GNENet::renameEdge().

◆ retrieve()

NBEdge * NBEdgeCont::retrieve ( const std::string &  id,
bool  retrieveExtracted = false 
) const

Returns the edge that has the given id.

If no edge that has the given id is known, 0 is returned.

Parameters
[in]idThe id of the edge to retrieve
[in]boolWhether extracted edges shall be retrieved as well
Returns
The edge with the given id, 0 if no such edge exists

Definition at line 246 of file NBEdgeCont.cpp.

References myEdges, and myExtractedEdges.

Referenced by NIImporter_SUMO::_loadNetwork(), NBRailwayTopologyAnalyzer::addBidiEdge(), NIXMLConnectionsHandler::addCrossing(), NIXMLEdgesHandler::addEdge(), NIXMLPTHandler::addPTStop(), NIXMLEdgesHandler::addRoundabout(), NIXMLPTHandler::addRoute(), NIVissimDisturbance::addToNode(), NIXMLConnectionsHandler::addWalkingArea(), NIVissimEdge::buildNBEdge(), NBRampsComputer::buildOffRamp(), NBRampsComputer::buildOnRamp(), NBConnection::checkFrom(), NBConnection::checkTo(), computeEdgeShapes(), NBRampsComputer::computeRamps(), NBPTLineCont::constructRoute(), NIXMLEdgesHandler::deleteEdge(), NIVissimDistrictConnection::dict_BuildDistricts(), NBNodeCont::feasibleCluster(), NIXMLShapeHandler::getLanePos(), NIImporter_VISUM::getNamedEdge(), NIImporter_VISUM::getNamedEdgeContinuating(), NWWriter_SUMO::getOppositeInternalID(), NIImporter_VISUM::getReversedContinuating(), NBPTLine::getRouteEnd(), NBPTLine::getRouteStart(), NBPTLine::getStopEdges(), GNENet::initJunctionsAndEdges(), NIImporter_ArcView::load(), NIImporter_OpenDrive::loadNetwork(), NIXMLConnectionsHandler::myStartElement(), NIImporter_VISUM::parse_Connectors_legacy(), NIImporter_VISUM::parse_Edges(), NIImporter_VISUM::parse_Lanes(), NIImporter_VISUM::parse_LanesConnections(), NIImporter_VISUM::parse_TurnsToSignalGroups(), NIXMLConnectionsHandler::parseConnection(), processSplits(), recheckLanes(), NBNodeCont::removeIsolatedRoads(), NIXMLTrafficLightsHandler::retrieveEdge(), retrievePossiblySplit(), splitGeometry(), NBParking::write(), NBPTLine::write(), and NWWriter_SUMO::writeRoundabout().

◆ retrievePossiblySplit() [1/3]

NBEdge * NBEdgeCont::retrievePossiblySplit ( const std::string &  id,
bool  downstream 
) const

Tries to retrieve an edge, even if it is splitted.

The edge given with the id should exist and is followed downstream or upstream, depending on the parameter to the last edge still starting with the id.

Parameters
[in]idThe id of the edge to retrieve
[in]downstreamsearch direction
Returns
The searched edge
Todo:
Recheck usage

Definition at line 282 of file NBEdgeCont.cpp.

References retrieve().

Referenced by NIVissimTL::NIVissimTLSignal::addTo(), NIVissimDisturbance::addToNode(), NIVissimConnection::buildEdgeConnections(), NBConnection::checkFrom(), NBConnection::checkTo(), NIVissimDistrictConnection::dict_BuildDistricts(), recheckPostProcessConnections(), and NIVissimConflictArea::setPriorityRegulation().

◆ retrievePossiblySplit() [2/3]

NBEdge * NBEdgeCont::retrievePossiblySplit ( const std::string &  id,
const std::string &  hint,
bool  incoming 
) const

Tries to retrieve an edge, even if it is splitted.

To describe which part of the edge shall be returned, the id of a second edge, participating at the node and the information whether to return the outgoing or the incoming is needed.

Parameters
[in]idThe id of the edge to retrieve
[in]hintAn additional information which helps to retrieve the correct edge
[in]incomingWhether the edge to find is an incoming edge at the node "hint" participates
Returns
The searched edge
Todo:
Recheck usage

Definition at line 301 of file NBEdgeCont.cpp.

References getGeneratedFrom(), NBNode::getIncomingEdges(), NBNode::getOutgoingEdges(), NBEdge::myFrom, NBEdge::myTo, and retrieve().

◆ retrievePossiblySplit() [3/3]

NBEdge * NBEdgeCont::retrievePossiblySplit ( const std::string &  id,
double  pos 
) const

Tries to retrieve an edge, even if it is splitted.

To describe which part of the edge shall be returned, a position hint is supplied.

Parameters
[in]idThe id of the edge to retrieve
[in]posAn additional about the position of the basic edge's subpart
Returns
The searched edge
Todo:
Recheck usage

Definition at line 335 of file NBEdgeCont.cpp.

References NBEdge::getLength(), MAX2(), myEdges, and retrieve().

◆ size()

int NBEdgeCont::size ( ) const
inline

Returns the number of edges.

Returns
The number of edges stored in this container

Definition at line 304 of file NBEdgeCont.h.

References myEdges.

Referenced by NBRailwayTopologyAnalyzer::addBidiEdgesForStops(), NILoader::load(), and main().

◆ sortOutgoingLanesConnections()

void NBEdgeCont::sortOutgoingLanesConnections ( )

Sorts all lanes of all edges within the container by their direction.

Calls "NBEdge::sortOutgoingLanesConnections" for all edges within the container.

Todo:
Recheck whether a visitor-pattern should be used herefor
See also
NBEdge::sortOutgoingLanesConnections

Definition at line 774 of file NBEdgeCont.cpp.

References myEdges.

Referenced by NBNetBuilder::compute().

◆ splitAt() [1/3]

bool NBEdgeCont::splitAt ( NBDistrictCont dc,
NBEdge edge,
double  edgepos,
NBNode node,
const std::string &  firstEdgeName,
const std::string &  secondEdgeName,
int  noLanesFirstEdge,
int  noLanesSecondEdge,
const double  speed = -1.,
const int  changedLeft = 0 
)

Splits the edge at the position nearest to the given node using the given modifications.

Parameters
[in]dcThe district container, in order to remove/add the edge from/to sources/sinks
[in]edgeThe edge to split
[in]nodeThe node to split the edge at
[in]firstEdgeNameThe id the first part of the split edge shall have
[in]secondEdgeNameThe id the second part of the split edge shall have
[in]noLanesFirstEdgeThe number of lanes the second part of the split edge shall have
[in]noLanesSecondEdgeThe number of lanes the second part of the split edge shall have
[in]speedThe speed for the edge after the split
[in]changedLeftThe number of lanes that is added or removed on the left side of the edge (By default all added/removed lanes are assumed to be on the right when computing connections)
Returns
Whether the edge could be split
Exceptions
ProcessErrorIf connections between the edges can not be built

Definition at line 586 of file NBEdgeCont.cpp.

References NBEdge::addLane2LaneConnection(), NBEdge::copyConnectionsFrom(), erase(), NBNode::getControllingTLS(), NBEdge::getGeometry(), NBEdge::getID(), NBEdge::getLaneStruct(), NBEdge::getNumLanes(), OptionsCont::getOptions(), Parameterised::getParameter(), insert(), NBEdge::L2L_COMPUTED, MAX2(), MIN2(), myEdges2Keep, myEdges2Remove, myEdgesSplit, NBEdge::myFrom, myGuessedRoundabouts, myRemoveEdgesAfterJoining, myRoundabouts, NBEdge::myTo, patchRoundabouts(), NBNode::removeDoubleEdges(), NBNode::replaceIncoming(), NBNode::replaceOutgoing(), NBEdge::setOrigID(), NBEdge::setSpeed(), PositionVector::splitAt(), SUMO_PARAM_ORIGID, and WRITE_ERROR.

◆ splitAt() [2/3]

bool NBEdgeCont::splitAt ( NBDistrictCont dc,
NBEdge edge,
NBNode node 
)

Splits the edge at the position nearest to the given node.

Uses "splitAt(NBDistrictCont &, NBEdge *, NBNode *, const std::string &, const std::string &, int , int)" to perform the split; the edge names are built by appending "[0]" and "[1]", respectively. Both edges will have the same number of lanes.

Parameters
[in]dcThe district container, in order to remove/add the edge from/to sources/sinks
[in]edgeThe edge to split
[in]nodeThe node to split the edge at
Returns
Whether the edge could be split
Exceptions
ProcessErrorIf connections between the edges can not be built
See also
NBEdge::splitAt(NBDistrictCont &, NBEdge *, NBNode *, const std::string &, const std::string &, int , int)

Definition at line 557 of file NBEdgeCont.cpp.

References NBEdge::getID(), and NBEdge::myLanes.

Referenced by NIVissimDisturbance::addToNode(), NIVissimEdge::buildNBEdge(), NBRampsComputer::buildOffRamp(), NBRampsComputer::buildOnRamp(), NIImporter_VISUM::parse_Lanes(), processSplits(), splitAt(), and splitGeometry().

◆ splitAt() [3/3]

bool NBEdgeCont::splitAt ( NBDistrictCont dc,
NBEdge edge,
NBNode node,
const std::string &  firstEdgeName,
const std::string &  secondEdgeName,
int  noLanesFirstEdge,
int  noLanesSecondEdge,
const double  speed = -1.,
const int  changedLeft = 0 
)

Splits the edge at the position nearest to the given node using the given modifications.

Determines the position of the split by finding the nearest position on the edge to the given node. If this position is too near to the edges begin/end, false is returned.

Otherwise, "splitAt(NBDistrictCont &, NBEdge *, double, NBNode *, const std::string &, const std::string &, int , int)" is used to perform the split.

Parameters
[in]dcThe district container, in order to remove/add the edge from/to sources/sinks
[in]edgeThe edge to split
[in]nodeThe node to split the edge at
[in]firstEdgeNameThe id the first part of the split edge shall have
[in]secondEdgeNameThe id the second part of the split edge shall have
[in]noLanesFirstEdgeThe number of lanes the second part of the split edge shall have
[in]noLanesSecondEdgeThe number of lanes the second part of the split edge shall have
[in]speedThe speed for the edge after the split
[in]changedLeftThe number of lanes that is added or removed on the left side of the edge (By default all added/removed lanes are assumed to be on the right when computing connections)
Returns
Whether the edge could be split
Exceptions
ProcessErrorIf connections between the edges can not be built
See also
NBEdge::splitAt(NBDistrictCont &, NBEdge *, double, NBNode *, const std::string &, const std::string &, int , int)

Definition at line 564 of file NBEdgeCont.cpp.

References NBEdge::getGeometry(), NBNode::getPosition(), PositionVector::length(), NBEdge::myFrom, NBEdge::myTo, GeomHelper::nearest_offset_on_line_to_point2D(), PositionVector::nearest_offset_to_point2D(), and splitAt().

◆ splitGeometry()

void NBEdgeCont::splitGeometry ( NBDistrictCont dc,
NBNodeCont nc 
)

Splits edges into multiple if they have a complex geometry.

Calls "NBEdge::splitGeometry" for all edges within the container which have more than three positions in their geometry.

Parameters
[in]ncThe node container needed to build (geometry) nodes
See also
NBEdge::splitGeometry

Definition at line 717 of file NBEdgeCont.cpp.

References NBEdge::getGeometry(), NBEdge::getID(), NBEdge::getNumLanes(), NBNodeCont::insert(), myEdges, NBNodeCont::retrieve(), retrieve(), splitAt(), toString(), and WRITE_WARNING.

Referenced by NBNetBuilder::compute().

◆ wasIgnored()

bool NBEdgeCont::wasIgnored ( std::string  id) const
inline

Returns whether the edge with the id was ignored during parsing.

Returns
Whether the edge with the id was ignored during parsing

Definition at line 501 of file NBEdgeCont.h.

References myIgnoredEdges.

Referenced by NIImporter_SUMO::_loadNetwork(), NIXMLEdgesHandler::addRoundabout(), NIImporter_OpenDrive::loadNetwork(), and NIXMLConnectionsHandler::myStartElement().

◆ wasRemoved()

bool NBEdgeCont::wasRemoved ( std::string  id) const
inline

Returns whether the edge with the id was deleted explicitly.

Definition at line 512 of file NBEdgeCont.h.

References myExtractedEdges.

Referenced by NIXMLConnectionsHandler::addCrossing(), and NIXMLConnectionsHandler::myStartElement().

Field Documentation

◆ myConnections

std::map<std::string, std::vector<PostProcessConnection> > NBEdgeCont::myConnections
private

The list of connections to recheck.

Definition at line 667 of file NBEdgeCont.h.

Referenced by addPostProcessConnection(), hasPostProcessConnection(), and recheckPostProcessConnections().

◆ myEdges

◆ myEdges2Keep

std::set<std::string> NBEdgeCont::myEdges2Keep
private

Set of ids of edges which shall explicitly be kept.

Definition at line 695 of file NBEdgeCont.h.

Referenced by applyOptions(), ignoreFilterMatch(), removeUnwishedEdges(), and splitAt().

◆ myEdges2Remove

std::set<std::string> NBEdgeCont::myEdges2Remove
private

Set of ids of edges which shall explicitly be removed.

Definition at line 698 of file NBEdgeCont.h.

Referenced by applyOptions(), ignoreFilterMatch(), and splitAt().

◆ myEdgesMinSpeed

double NBEdgeCont::myEdgesMinSpeed
private

The minimum speed an edge may have in order to be kept (default: -1)

Definition at line 689 of file NBEdgeCont.h.

Referenced by applyOptions(), and ignoreFilterMatch().

◆ myEdgesSplit

int NBEdgeCont::myEdgesSplit
private

the number of splits of edges during the building

Definition at line 683 of file NBEdgeCont.h.

Referenced by getNoEdgeSplits(), and splitAt().

◆ myExtractedEdges

EdgeCont NBEdgeCont::myExtractedEdges
private

The extracted nodes which are kept for reference.

Definition at line 677 of file NBEdgeCont.h.

Referenced by clear(), extract(), retrieve(), and wasRemoved().

◆ myGuessedRoundabouts

std::set<EdgeSet> NBEdgeCont::myGuessedRoundabouts
private

Edges marked as belonging to a roundabout after guessing.

Definition at line 722 of file NBEdgeCont.h.

Referenced by getRoundabouts(), guessRoundabouts(), and splitAt().

◆ myIgnoredEdges

std::set<std::string> NBEdgeCont::myIgnoredEdges
private

The ids of ignored edges.

Definition at line 680 of file NBEdgeCont.h.

Referenced by ignore(), insert(), and wasIgnored().

◆ myNeedGeoTransformedPruningBoundary

bool NBEdgeCont::myNeedGeoTransformedPruningBoundary
private

whether a geo transform has been applied to the pruning boundary

Definition at line 716 of file NBEdgeCont.h.

Referenced by applyOptions(), and ignoreFilterMatch().

◆ myPruningBoundary

PositionVector NBEdgeCont::myPruningBoundary
private

Boundary within which an edge must be located in order to be kept.

Definition at line 713 of file NBEdgeCont.h.

Referenced by applyOptions(), and ignoreFilterMatch().

◆ myRemoveEdgesAfterJoining

bool NBEdgeCont::myRemoveEdgesAfterJoining
private

Whether edges shall be joined first, then removed.

Definition at line 692 of file NBEdgeCont.h.

Referenced by applyOptions(), ignoreFilterMatch(), and splitAt().

◆ myRoundabouts

std::set<EdgeSet> NBEdgeCont::myRoundabouts
private

Edges marked as belonging to a roundabout by the user (each EdgeVector is a roundabout)

Definition at line 720 of file NBEdgeCont.h.

Referenced by addRoundabout(), getRoundabouts(), guessRoundabouts(), removeRoundabout(), and splitAt().

◆ myTypeCont

NBTypeCont& NBEdgeCont::myTypeCont
private

The network builder; used to obtain type information.

Definition at line 611 of file NBEdgeCont.h.

Referenced by ignoreFilterMatch().

◆ myTypes2Keep

std::set<std::string> NBEdgeCont::myTypes2Keep
private

Set of edges types which shall be kept.

Definition at line 707 of file NBEdgeCont.h.

Referenced by applyOptions(), and ignoreFilterMatch().

◆ myTypes2Remove

std::set<std::string> NBEdgeCont::myTypes2Remove
private

Set of edges types which shall be removed.

Definition at line 710 of file NBEdgeCont.h.

Referenced by applyOptions(), and ignoreFilterMatch().

◆ myVehicleClasses2Keep

SVCPermissions NBEdgeCont::myVehicleClasses2Keep
private

Set of vehicle types which must be allowed on edges in order to keep them.

Definition at line 701 of file NBEdgeCont.h.

Referenced by applyOptions(), and ignoreFilterMatch().

◆ myVehicleClasses2Remove

SVCPermissions NBEdgeCont::myVehicleClasses2Remove
private

Set of vehicle types which need not be supported (edges which allow ONLY these are removed)

Definition at line 704 of file NBEdgeCont.h.

Referenced by applyOptions(), and ignoreFilterMatch().


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