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

#include <NBConnection.h>

Collaboration diagram for NBConnection:
[legend]

Public Member Functions

bool check (const NBEdgeCont &ec)
 checks whether the edges are still valid
NBEdgegetFrom () const
 returns the from-edge (start of the connection)
int getFromLane () const
 returns the from-lane
std::string getID () const
 returns the id of the connection (!!! not really pretty)
int getTLIndex () const
 returns the index within the controlling tls or InvalidTLIndex if this link is unontrolled
int getTLIndex2 () const
NBEdgegetTo () const
 returns the to-edge (end of the connection)
int getToLane () const
 returns the to-lane
 NBConnection (const NBConnection &c)
 Constructor.
 NBConnection (const std::string &fromID, NBEdge *from, const std::string &toID, NBEdge *to)
 Constructor.
 NBConnection (NBEdge *from, int fromLane, NBEdge *to, int toLane, int tlIndex=InvalidTlIndex, int tlIndex2=InvalidTlIndex)
 Constructor.
 NBConnection (NBEdge *from, NBEdge *to)
 Constructor.
bool operator!= (const NBConnection &c) const
 Comparison operator.
bool operator== (const NBConnection &c) const
 Comparison operator.
bool replaceFrom (NBEdge *which, int whichLane, NBEdge *by, int byLane)
 replaces the from-edge by the one given
bool replaceFrom (NBEdge *which, NBEdge *by)
 replaces the from-edge by the one given
bool replaceTo (NBEdge *which, int whichLane, NBEdge *by, int byLane)
 replaces the to-edge by the one given
bool replaceTo (NBEdge *which, NBEdge *by)
 replaces the to-edge by the one given
void setTLIndex (int tlIndex)
void setTLIndex2 (int tlIndex)
void shiftLaneIndex (NBEdge *edge, int offset, int threshold=-1)
 patches lane indices refering to the given edge and above the threshold by the given offset
virtual ~NBConnection ()
 Destructor.

Static Public Attributes

static const NBConnection InvalidConnection
static const int InvalidTlIndex = -1

Private Member Functions

NBEdgecheckFrom (const NBEdgeCont &ec)
 Checks whether the from-edge is still valid.
NBEdgecheckTo (const NBEdgeCont &ec)
 Checks whether the to-edge is still valid.

Private Attributes

NBEdgemyFrom
 The from- and the to-edges.
std::string myFromID
 The names of both edges, needed for verification of validity.
int myFromLane
 The lanes; may be -1 if no certain lane was specified.
int myTlIndex
int myTlIndex2
 The index of the internal junction within the controlling traffic light (optional).
NBEdgemyTo
std::string myToID
int myToLane

Friends

bool operator< (const NBConnection &c1, const NBConnection &c2)
 Compares both connections in order to allow sorting.
std::ostream & operator<< (std::ostream &os, const NBConnection &c)
 Output operator.

Detailed Description

Definition at line 41 of file NBConnection.h.

Constructor & Destructor Documentation

◆ NBConnection() [1/4]

NBConnection::NBConnection ( NBEdge * from,
NBEdge * to )

Constructor.

Definition at line 41 of file NBConnection.cpp.

References getID(), InvalidTlIndex, myFrom, myFromID, myFromLane, myTlIndex, myTlIndex2, myTo, myToID, and myToLane.

Referenced by NBConnection(), operator!=(), operator<, operator<<, and operator==().

Here is the caller graph for this function:

◆ NBConnection() [2/4]

NBConnection::NBConnection ( NBEdge * from,
int fromLane,
NBEdge * to,
int toLane,
int tlIndex = InvalidTlIndex,
int tlIndex2 = InvalidTlIndex )

Constructor.

Definition at line 60 of file NBConnection.cpp.

References NBEdge::getID(), myFrom, myFromID, myFromLane, myTlIndex, myTlIndex2, myTo, myToID, and myToLane.

◆ NBConnection() [3/4]

NBConnection::NBConnection ( const std::string & fromID,
NBEdge * from,
const std::string & toID,
NBEdge * to )

Constructor.

Definition at line 50 of file NBConnection.cpp.

References InvalidTlIndex, myFrom, myFromID, myFromLane, myTlIndex, myTlIndex2, myTo, myToID, and myToLane.

◆ NBConnection() [4/4]

NBConnection::NBConnection ( const NBConnection & c)

Constructor.

Definition at line 78 of file NBConnection.cpp.

References myFrom, myFromID, myFromLane, myTlIndex, myTlIndex2, myTo, myToID, myToLane, and NBConnection().

◆ ~NBConnection()

NBConnection::~NBConnection ( )
virtual

Destructor.

Definition at line 75 of file NBConnection.cpp.

Member Function Documentation

◆ check()

bool NBConnection::check ( const NBEdgeCont & ec)

checks whether the edges are still valid

Definition at line 193 of file NBConnection.cpp.

References checkFrom(), checkTo(), myFrom, and myTo.

Referenced by NIVissimDisturbance::addToNode(), NBLoadedTLDef::buildPhaseState(), NBLoadedTLDef::collectLinks(), NBLoadedTLDef::mustBrake(), and NBRequest::NBRequest().

Here is the caller graph for this function:

◆ checkFrom()

NBEdge * NBConnection::checkFrom ( const NBEdgeCont & ec)
private

Checks whether the from-edge is still valid.

Definition at line 201 of file NBConnection.cpp.

References myFrom, myFromID, myToID, NBEdgeCont::retrieve(), and NBEdgeCont::retrievePossiblySplit().

Referenced by check().

Here is the caller graph for this function:

◆ checkTo()

NBEdge * NBConnection::checkTo ( const NBEdgeCont & ec)
private

Checks whether the to-edge is still valid.

Definition at line 213 of file NBConnection.cpp.

References myFromID, myTo, myToID, NBEdgeCont::retrieve(), and NBEdgeCont::retrievePossiblySplit().

Referenced by check().

Here is the caller graph for this function:

◆ getFrom()

◆ getFromLane()

int NBConnection::getFromLane ( ) const

◆ getID()

std::string NBConnection::getID ( ) const

returns the id of the connection (!!! not really pretty)

Definition at line 225 of file NBConnection.cpp.

References myFromID, myFromLane, myToID, and myToLane.

Referenced by NBConnection().

Here is the caller graph for this function:

◆ getTLIndex()

int NBConnection::getTLIndex ( ) const
inline

returns the index within the controlling tls or InvalidTLIndex if this link is unontrolled

Definition at line 91 of file NBConnection.h.

References myTlIndex.

Referenced by NBLoadedSUMOTLDef::collectEdgeVectors(), NBLoadedTLDef::collectLinks(), NBLoadedSUMOTLDef::copyIndices(), NBLoadedSUMOTLDef::initNeedsContRelation(), GNEJunction::invalidateTLS(), NBLoadedTLDef::myCompute(), operator<<, NBLoadedSUMOTLDef::patchIfCrossingsAdded(), NBLoadedSUMOTLDef::reconstructLogic(), NBLoadedSUMOTLDef::removeConnection(), NBEdge::setControllingTLInformation(), NBLoadedTLDef::setTLControllingInformation(), and NBLoadedSUMOTLDef::ungroupSignals().

Here is the caller graph for this function:

◆ getTLIndex2()

int NBConnection::getTLIndex2 ( ) const
inline

Definition at line 94 of file NBConnection.h.

References myTlIndex2.

Referenced by GNEJunction::invalidateTLS(), and NBEdge::setControllingTLInformation().

Here is the caller graph for this function:

◆ getTo()

◆ getToLane()

int NBConnection::getToLane ( ) const

returns the to-lane

Definition at line 239 of file NBConnection.cpp.

References myToLane.

Referenced by NBLoadedTLDef::collectLinks(), NBLoadedSUMOTLDef::initNeedsContRelation(), GNEJunction::invalidateTLS(), NBLoadedSUMOTLDef::isValid(), NBLoadedSUMOTLDef::connection_equal::operator()(), operator<<, NBLoadedSUMOTLDef::removeConnection(), NBEdge::removeFromConnections(), and NBEdge::setControllingTLInformation().

Here is the caller graph for this function:

◆ operator!=()

bool NBConnection::operator!= ( const NBConnection & c) const
inline

Comparison operator.

Definition at line 116 of file NBConnection.h.

References NBConnection().

◆ operator==()

bool NBConnection::operator== ( const NBConnection & c) const

Comparison operator.

Definition at line 183 of file NBConnection.cpp.

References myFrom, myFromID, myFromLane, myTlIndex, myTlIndex2, myTo, myToID, myToLane, and NBConnection().

◆ replaceFrom() [1/2]

bool NBConnection::replaceFrom ( NBEdge * which,
int whichLane,
NBEdge * by,
int byLane )

replaces the from-edge by the one given

Definition at line 115 of file NBConnection.cpp.

References myFrom, myFromID, and myFromLane.

◆ replaceFrom() [2/2]

bool NBConnection::replaceFrom ( NBEdge * which,
NBEdge * by )

replaces the from-edge by the one given

Definition at line 100 of file NBConnection.cpp.

References myFrom, and myFromID.

Referenced by NBLoadedTLDef::SignalGroup::remapIncoming(), and NBNode::replaceInConnectionProhibitions().

Here is the caller graph for this function:

◆ replaceTo() [1/2]

bool NBConnection::replaceTo ( NBEdge * which,
int whichLane,
NBEdge * by,
int byLane )

replaces the to-edge by the one given

Definition at line 149 of file NBConnection.cpp.

References myFromLane, myTo, myToID, and myToLane.

◆ replaceTo() [2/2]

bool NBConnection::replaceTo ( NBEdge * which,
NBEdge * by )

replaces the to-edge by the one given

Definition at line 134 of file NBConnection.cpp.

References myTo, and myToID.

Referenced by NBLoadedTLDef::SignalGroup::remapOutgoing(), and NBNode::replaceInConnectionProhibitions().

Here is the caller graph for this function:

◆ setTLIndex()

void NBConnection::setTLIndex ( int tlIndex)
inline

Definition at line 99 of file NBConnection.h.

References myTlIndex.

Referenced by NBLoadedTLDef::collectLinks(), NBLoadedSUMOTLDef::copyIndices(), and NBLoadedSUMOTLDef::ungroupSignals().

Here is the caller graph for this function:

◆ setTLIndex2()

void NBConnection::setTLIndex2 ( int tlIndex)
inline

Definition at line 102 of file NBConnection.h.

References myTlIndex2.

Referenced by NBTrafficLightDefinition::collectAllLinks().

Here is the caller graph for this function:

◆ shiftLaneIndex()

void NBConnection::shiftLaneIndex ( NBEdge * edge,
int offset,
int threshold = -1 )

patches lane indices refering to the given edge and above the threshold by the given offset

Definition at line 245 of file NBConnection.cpp.

References myFrom, myFromLane, myTo, and myToLane.

Referenced by NBEdge::removeFromConnections().

Here is the caller graph for this function:

◆ operator<

bool operator< ( const NBConnection & c1,
const NBConnection & c2 )
friend

Compares both connections in order to allow sorting.

Definition at line 167 of file NBConnection.cpp.

References myFromID, myFromLane, myToID, myToLane, and NBConnection().

◆ operator<<

std::ostream & operator<< ( std::ostream & os,
const NBConnection & c )
friend

Output operator.

Definition at line 254 of file NBConnection.cpp.

References getFrom(), getFromLane(), Named::getIDSecure(), getTLIndex(), getTo(), getToLane(), and NBConnection().

Field Documentation

◆ InvalidConnection

◆ InvalidTlIndex

◆ myFrom

NBEdge* NBConnection::myFrom
private

◆ myFromID

std::string NBConnection::myFromID
private

The names of both edges, needed for verification of validity.

Definition at line 138 of file NBConnection.h.

Referenced by checkFrom(), checkTo(), getID(), NBConnection(), NBConnection(), NBConnection(), NBConnection(), operator<, operator==(), replaceFrom(), and replaceFrom().

◆ myFromLane

int NBConnection::myFromLane
private

The lanes; may be -1 if no certain lane was specified.

Definition at line 141 of file NBConnection.h.

Referenced by getFromLane(), getID(), NBConnection(), NBConnection(), NBConnection(), NBConnection(), operator<, operator==(), replaceFrom(), replaceTo(), and shiftLaneIndex().

◆ myTlIndex

int NBConnection::myTlIndex
private

◆ myTlIndex2

int NBConnection::myTlIndex2
private

The index of the internal junction within the controlling traffic light (optional).

Definition at line 146 of file NBConnection.h.

Referenced by getTLIndex2(), NBConnection(), NBConnection(), NBConnection(), NBConnection(), operator==(), and setTLIndex2().

◆ myTo

◆ myToID

std::string NBConnection::myToID
private

◆ myToLane

int NBConnection::myToLane
private

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