 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
43 myFrom(from), myTo(to),
44 myFromID(from->getID()), myToID(to->getID()),
45 myFromLane(-1), myToLane(-1),
46 myTlIndex(InvalidTlIndex),
47 myTlIndex2(InvalidTlIndex) {
52 const std::string& toID,
NBEdge* to) :
53 myFrom(from), myTo(to),
54 myFromID(fromID), myToID(toID),
55 myFromLane(-1), myToLane(-1),
56 myTlIndex(InvalidTlIndex),
57 myTlIndex2(InvalidTlIndex) {
62 NBEdge* to,
int toLane,
int tlIndex,
int tlIndex2) :
63 myFrom(from), myTo(to),
64 myFromLane(fromLane), myToLane(toLane),
66 myTlIndex2(tlIndex2) {
80 myFrom(c.myFrom), myTo(c.myTo),
81 myFromID(c.myFromID), myToID(c.myToID),
82 myFromLane(c.myFromLane), myToLane(c.myToLane),
83 myTlIndex(c.myTlIndex),
84 myTlIndex2(c.myTlIndex2) {
138 if (
myTo !=
nullptr) {
154 if (
myTo !=
nullptr) {
227 std::stringstream str;
bool operator==(const NBConnection &c) const
Comparison operator.
static const NBConnection InvalidConnection
NBEdge * retrieve(const std::string &id, bool retrieveExtracted=false) const
Returns the edge that has the given id.
int getTLIndex() const
returns the index within the controlling tls or InvalidTLIndex if this link is unontrolled
Storage for edges, including some functionality operating on multiple edges.
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
NBEdge * getFrom() const
returns the from-edge (start of the connection)
static const int InvalidTlIndex
NBEdge * getTo() const
returns the to-edge (end of the connection)
NBEdge * checkTo(const NBEdgeCont &ec)
Checks whether the to-edge is still valid.
The representation of a single edge during network building.
std::string myFromID
The names of both edges, needed for verification of validity.
NBEdge * myFrom
The from- and the to-edges.
std::string getID() const
returns the id of the connection (!!! not really pretty)
virtual ~NBConnection()
Destructor.
int getToLane() const
returns the to-lane
bool operator<(const NBConnection &c1, const NBConnection &c2)
NBEdge * retrievePossiblySplit(const std::string &id, bool downstream) const
Tries to retrieve an edge, even if it is splitted.
int myTlIndex2
The index of the internal junction within the controlling traffic light (optional)
int myFromLane
The lanes; may be -1 if no certain lane was specified.
bool replaceFrom(NBEdge *which, NBEdge *by)
replaces the from-edge by the one given
NBConnection(NBEdge *from, NBEdge *to)
Constructor.
NBEdge * checkFrom(const NBEdgeCont &ec)
Checks whether the from-edge is still valid.
bool check(const NBEdgeCont &ec)
checks whether the edges are still valid
bool replaceTo(NBEdge *which, NBEdge *by)
replaces the to-edge by the one given
static std::string getIDSecure(const T *obj, const std::string &fallBack="NULL")
get an identifier for Named-like object which may be Null
int getFromLane() const
returns the from-lane
std::ostream & operator<<(std::ostream &os, const NBConnection &c)
const std::string & getID() const