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