![]() |
SUMO - Simulation of Urban MObility
|
#include <NBConnection.h>
Public Member Functions | |
bool | check (const NBEdgeCont &ec) |
checks whether the edges are still valid More... | |
NBEdge * | getFrom () const |
returns the from-edge (start of the connection) More... | |
int | getFromLane () const |
returns the from-lane More... | |
std::string | getID () const |
returns the id of the connection (!!! not really pretty) More... | |
int | getTLIndex () const |
returns the index within the controlling tls or InvalidTLIndex if this link is unontrolled More... | |
NBEdge * | getTo () const |
returns the to-edge (end of the connection) More... | |
int | getToLane () const |
returns the to-lane More... | |
NBConnection (NBEdge *from, NBEdge *to) | |
Constructor. More... | |
NBConnection (NBEdge *from, int fromLane, NBEdge *to, int toLane, int tlIndex=InvalidTlIndex) | |
Constructor. More... | |
NBConnection (const std::string &fromID, NBEdge *from, const std::string &toID, NBEdge *to) | |
Constructor. More... | |
NBConnection (const NBConnection &c) | |
Constructor. More... | |
bool | operator!= (const NBConnection &c) const |
Comparison operator. More... | |
bool | operator== (const NBConnection &c) const |
Comparison operator. More... | |
bool | replaceFrom (NBEdge *which, NBEdge *by) |
replaces the from-edge by the one given More... | |
bool | replaceFrom (NBEdge *which, int whichLane, NBEdge *by, int byLane) |
replaces the from-edge by the one given More... | |
bool | replaceTo (NBEdge *which, NBEdge *by) |
replaces the to-edge by the one given More... | |
bool | replaceTo (NBEdge *which, int whichLane, NBEdge *by, int byLane) |
replaces the to-edge by the one given More... | |
void | setTLIndex (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 More... | |
virtual | ~NBConnection () |
Destructor. More... | |
Static Public Attributes | |
static const NBConnection | InvalidConnection |
static const int | InvalidTlIndex = -1 |
Private Member Functions | |
NBEdge * | checkFrom (const NBEdgeCont &ec) |
Checks whether the from-edge is still valid. More... | |
NBEdge * | checkTo (const NBEdgeCont &ec) |
Checks whether the to-edge is still valid. More... | |
Private Attributes | |
NBEdge * | myFrom |
The from- and the to-edges. More... | |
std::string | myFromID |
The names of both edges, needed for verification of validity. More... | |
int | myFromLane |
The lanes; may be -1 if no certain lane was specified. More... | |
int | myTlIndex |
NBEdge * | myTo |
std::string | myToID |
int | myToLane |
Friends | |
bool | operator< (const NBConnection &c1, const NBConnection &c2) |
Compares both connections in order to allow sorting. More... | |
std::ostream & | operator<< (std::ostream &os, const NBConnection &c) |
Output operator. More... | |
Definition at line 44 of file NBConnection.h.
Constructor.
Definition at line 43 of file NBConnection.cpp.
NBConnection::NBConnection | ( | NBEdge * | from, |
int | fromLane, | ||
NBEdge * | to, | ||
int | toLane, | ||
int | tlIndex = InvalidTlIndex |
||
) |
Constructor.
Definition at line 60 of file NBConnection.cpp.
References Named::getID(), myFromID, and myToID.
NBConnection::NBConnection | ( | const std::string & | fromID, |
NBEdge * | from, | ||
const std::string & | toID, | ||
NBEdge * | to | ||
) |
Constructor.
Definition at line 51 of file NBConnection.cpp.
NBConnection::NBConnection | ( | const NBConnection & | c | ) |
Constructor.
Definition at line 77 of file NBConnection.cpp.
|
virtual |
Destructor.
Definition at line 74 of file NBConnection.cpp.
bool NBConnection::check | ( | const NBEdgeCont & | ec | ) |
checks whether the edges are still valid
Definition at line 190 of file NBConnection.cpp.
References checkFrom(), checkTo(), myFrom, and myTo.
Referenced by NIVissimDisturbance::addToNode(), NBLoadedTLDef::buildPhaseState(), NBLoadedTLDef::mustBrake(), and NBRequest::NBRequest().
|
private |
Checks whether the from-edge is still valid.
Definition at line 198 of file NBConnection.cpp.
References myFrom, myFromID, myToID, NBEdgeCont::retrieve(), and NBEdgeCont::retrievePossiblySplit().
Referenced by check().
|
private |
Checks whether the to-edge is still valid.
Definition at line 210 of file NBConnection.cpp.
References myFromID, myTo, myToID, NBEdgeCont::retrieve(), and NBEdgeCont::retrievePossiblySplit().
Referenced by check().
NBEdge * NBConnection::getFrom | ( | ) | const |
returns the from-edge (start of the connection)
Definition at line 86 of file NBConnection.cpp.
References myFrom.
Referenced by NBLoadedTLDef::SignalGroup::addConnection(), NBNode::addSortedLinkFoes(), NBLoadedTLDef::addToSignalGroup(), NBLoadedSUMOTLDef::collectEdgeVectors(), NBLoadedTLDef::collectLinks(), NBLoadedTLDef::collectNodes(), NBLoadedSUMOTLDef::initNeedsContRelation(), GNEJunction::invalidateTLS(), NBTrafficLightDefinition::mustBrake(), NBLoadedTLDef::mustBrake(), NBLoadedTLDef::myCompute(), NIXMLConnectionsHandler::myStartElement(), NBRequest::NBRequest(), NBLoadedSUMOTLDef::connection_equal::operator()(), operator<<(), NWWriter_SUMO::prohibitionConnection(), NBLoadedSUMOTLDef::reconstructLogic(), NBNode::remapRemoved(), NBLoadedSUMOTLDef::removeConnection(), NBLoadedSUMOTLDef::setTLControllingInformation(), NBOwnTLDef::setTLControllingInformation(), and NBLoadedTLDef::setTLControllingInformation().
int NBConnection::getFromLane | ( | ) | const |
returns the from-lane
Definition at line 230 of file NBConnection.cpp.
References myFromLane.
Referenced by NBLoadedTLDef::SignalGroup::addConnection(), NBLoadedSUMOTLDef::collectEdgeVectors(), NBLoadedTLDef::collectLinks(), NBLoadedSUMOTLDef::initNeedsContRelation(), GNEJunction::invalidateTLS(), NBLoadedTLDef::myCompute(), NBLoadedSUMOTLDef::connection_equal::operator()(), operator<<(), NBLoadedSUMOTLDef::reconstructLogic(), NBLoadedSUMOTLDef::removeConnection(), NBEdge::removeFromConnections(), NBEdge::setControllingTLInformation(), and NBLoadedSUMOTLDef::setTLControllingInformation().
std::string NBConnection::getID | ( | ) | const |
returns the id of the connection (!!! not really pretty)
Definition at line 222 of file NBConnection.cpp.
References myFromID, myFromLane, myToID, and myToLane.
Referenced by setTLIndex().
|
inline |
returns the index within the controlling tls or InvalidTLIndex if this link is unontrolled
Definition at line 94 of file NBConnection.h.
References myTlIndex.
Referenced by NBLoadedSUMOTLDef::collectEdgeVectors(), NBLoadedTLDef::collectLinks(), NBLoadedSUMOTLDef::initNeedsContRelation(), GNEJunction::invalidateTLS(), NBLoadedTLDef::myCompute(), operator<<(), NBLoadedSUMOTLDef::patchIfCrossingsAdded(), NBLoadedSUMOTLDef::reconstructLogic(), NBEdge::setControllingTLInformation(), NBLoadedSUMOTLDef::setTLControllingInformation(), and NBLoadedTLDef::setTLControllingInformation().
NBEdge * NBConnection::getTo | ( | ) | const |
returns the to-edge (end of the connection)
Definition at line 92 of file NBConnection.cpp.
References myTo.
Referenced by NBNode::addSortedLinkFoes(), NBLoadedTLDef::addToSignalGroup(), NBLoadedSUMOTLDef::collectEdgeVectors(), NBLoadedTLDef::collectLinks(), NBLoadedSUMOTLDef::initNeedsContRelation(), GNEJunction::invalidateTLS(), NBTrafficLightDefinition::mustBrake(), NBLoadedTLDef::myCompute(), NBRequest::NBRequest(), NBLoadedSUMOTLDef::connection_equal::operator()(), operator<<(), NWWriter_SUMO::prohibitionConnection(), NBLoadedSUMOTLDef::reconstructLogic(), NBNode::remapRemoved(), NBLoadedSUMOTLDef::removeConnection(), NBEdge::removeFromConnections(), and NBEdge::setControllingTLInformation().
int NBConnection::getToLane | ( | ) | const |
returns the to-lane
Definition at line 236 of file NBConnection.cpp.
References myToLane.
Referenced by NBLoadedTLDef::collectLinks(), GNEJunction::invalidateTLS(), NBLoadedSUMOTLDef::connection_equal::operator()(), operator<<(), NBLoadedSUMOTLDef::reconstructLogic(), NBLoadedSUMOTLDef::removeConnection(), NBEdge::removeFromConnections(), and NBEdge::setControllingTLInformation().
|
inline |
bool NBConnection::operator== | ( | const NBConnection & | c | ) | const |
Comparison operator.
Definition at line 181 of file NBConnection.cpp.
References myFrom, myFromID, myFromLane, myTlIndex, myTo, myToID, and myToLane.
Referenced by setTLIndex().
replaces the from-edge by the one given
Definition at line 98 of file NBConnection.cpp.
References Named::getID(), myFrom, and myFromID.
Referenced by NBLoadedTLDef::SignalGroup::remapIncoming(), and NBNode::replaceInConnectionProhibitions().
replaces the from-edge by the one given
Definition at line 113 of file NBConnection.cpp.
References Named::getID(), myFrom, myFromID, and myFromLane.
replaces the to-edge by the one given
Definition at line 132 of file NBConnection.cpp.
References Named::getID(), myTo, and myToID.
Referenced by NBLoadedTLDef::SignalGroup::remapOutgoing(), and NBNode::replaceInConnectionProhibitions().
replaces the to-edge by the one given
Definition at line 147 of file NBConnection.cpp.
References Named::getID(), myFromLane, myTo, myToID, and myToLane.
|
inline |
Definition at line 99 of file NBConnection.h.
References getID(), myTlIndex, operator<, and operator==().
Referenced by NBLoadedTLDef::collectLinks().
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 242 of file NBConnection.cpp.
References myFrom, myFromLane, myTo, and myToLane.
Referenced by NBEdge::removeFromConnections().
|
friend |
Compares both connections in order to allow sorting.
Definition at line 166 of file NBConnection.cpp.
Referenced by setTLIndex().
|
friend |
|
static |
Definition at line 121 of file NBConnection.h.
Referenced by GNEConnectorFrame::buildConnection(), NIVissimDisturbance::getConnection(), GNEJunction::invalidateTLS(), NIXMLConnectionsHandler::myStartElement(), and NIXMLConnectionsHandler::parseConnection().
|
static |
Definition at line 120 of file NBConnection.h.
Referenced by NBLoadedSUMOTLDef::collectEdgeVectors(), NBLoadedTLDef::collectLinks(), NBLoadedSUMOTLDef::hasValidIndices(), NBLoadedSUMOTLDef::initNeedsContRelation(), GNEJunction::invalidateTLS(), NBLoadedTLDef::myCompute(), NBLoadedSUMOTLDef::patchIfCrossingsAdded(), NBLoadedSUMOTLDef::reconstructLogic(), NBLoadedTLDef::setTLControllingInformation(), GNEInspectorFrame::AttributesEditor::showAttributeEditorModul(), and NWWriter_SUMO::writeInternalConnection().
|
private |
The from- and the to-edges.
Definition at line 132 of file NBConnection.h.
Referenced by check(), checkFrom(), getFrom(), operator==(), replaceFrom(), and shiftLaneIndex().
|
private |
The names of both edges, needed for verification of validity.
Definition at line 135 of file NBConnection.h.
Referenced by checkFrom(), checkTo(), getID(), NBConnection(), operator<(), operator==(), and replaceFrom().
|
private |
The lanes; may be -1 if no certain lane was specified.
Definition at line 138 of file NBConnection.h.
Referenced by getFromLane(), getID(), operator<(), operator==(), replaceFrom(), replaceTo(), and shiftLaneIndex().
|
private |
Definition at line 141 of file NBConnection.h.
Referenced by getTLIndex(), operator==(), and setTLIndex().
|
private |
Definition at line 132 of file NBConnection.h.
Referenced by check(), checkTo(), getTo(), operator==(), replaceTo(), and shiftLaneIndex().
|
private |
Definition at line 135 of file NBConnection.h.
Referenced by checkFrom(), checkTo(), getID(), NBConnection(), operator<(), operator==(), and replaceTo().
|
private |
Definition at line 138 of file NBConnection.h.
Referenced by getID(), getToLane(), operator<(), operator==(), replaceTo(), and shiftLaneIndex().