68 #ifdef CHECK_MEMORY_LEAKS
70 #endif // CHECK_MEMORY_LEAKS
85 myApproaching(approaching), myCurrentOutgoing(currentOutgoing) {
96 assert(myApproaching->size() > src);
98 NBEdge* incomingEdge = (*myApproaching)[src];
102 std::vector<int> approachingLanes =
104 assert(approachingLanes.size() != 0);
105 std::deque<int>* approachedLanes = spread(approachingLanes, dest);
106 assert(approachedLanes->size() <= myCurrentOutgoing->getNumLanes());
108 for (
unsigned int i = 0; i < approachedLanes->size(); i++) {
109 unsigned int approached = (*approachedLanes)[i];
110 assert(approachedLanes->size() > i);
111 assert(approachingLanes.size() > i);
112 incomingEdge->setConnection((
unsigned int) approachingLanes[i], myCurrentOutgoing,
115 delete approachedLanes;
122 std::deque<int>* ret =
new std::deque<int>();
123 unsigned int noLanes = (
unsigned int) approachingLanes.size();
127 ret->push_back(dest);
131 unsigned int noOutgoingLanes = myCurrentOutgoing->getNumLanes();
133 ret->push_back(dest);
134 unsigned int noSet = 1;
137 while (noSet < noLanes) {
143 if (noOutgoingLanes == noSet) {
152 if (dest + loffset >= static_cast<int>(noOutgoingLanes)) {
155 for (
unsigned int i = 0; i < ret->size(); i++) {
156 (*ret)[i] = (*ret)[i] - 1;
161 ret->push_back(dest + loffset);
166 if (noOutgoingLanes == noSet) {
171 if (noSet < noLanes) {
174 if (dest < roffset) {
177 for (
unsigned int i = 0; i < ret->size(); i++) {
178 (*ret)[i] = (*ret)[i] + 1;
181 ret->push_front(dest - roffset);
205 myPosition(position),
217 bool updateEdgeGeometries) {
224 if (updateEdgeGeometries) {
228 (*i)->setGeometry(geom);
233 (*i)->setGeometry(geom);
268 for (std::set<NBTrafficLightDefinition*>::const_iterator i = trafficLights.begin(); i != trafficLights.end(); ++i) {
280 if ((*i)->getID().find(
"joined") == 0) {
292 for (std::set<NBTrafficLightDefinition*>::iterator it = oldDefs.begin(); it != oldDefs.end(); ++it) {
294 if (dynamic_cast<NBOwnTLDef*>(orig) == 0) {
296 const std::vector<NBNode*>& nodes = orig->
getNodes();
297 while (!nodes.empty()) {
298 nodes.front()->removeTrafficLight(orig);
299 newDef->
addNode(nodes.front());
312 unsigned int ret = 0;
313 unsigned int pos = 0;
329 if ((*i)->isConnectedTo(dummy) && *i != dummy) {
330 incomingConnected.push_back(*i);
337 outgoingConnected.push_back(*i);
342 remapRemoved(tc, dummy, incomingConnected, outgoingConnected);
391 if (in->
getNumLanes() != (*opposite)->getNumLanes()) {
404 NBEdge* toE,
int toL,
int numPoints)
const {
411 bool noSpline =
false;
417 unsigned int noInitialPoints = 0;
431 Line cross(straightConn);
432 cross.
sub(cross.
p1().
x(), cross.
p1().
y());
434 center.
sub(cross.
p2());
439 if (angle < M_PI / 4. || angle > 7. / 4.*
M_PI) {
480 WRITE_WARNING(
"Could not use edge geometry for internal lane, node '" +
getID() +
"'.");
497 for (
int i = 0; i < (
int) init.size(); ++i) {
499 def[i * 3 + 1] = init[i].x();
501 def[i * 3 + 3] = init[i].y();
504 bezier(noInitialPoints, def, numPoints, ret_buf);
507 for (
int i = 0; i < (
int) numPoints; i++) {
508 Position current(ret_buf[i * 3 + 1], ret_buf[i * 3 + 3]);
509 if (prev != current) {
531 if (fromE == otherFromE) {
535 if (!
foes(otherFromE, otherToE, fromE, toE)) {
543 bool bothLeft = thisLeft && otherLeft;
544 if (c.
tlID !=
"" && !bothLeft) {
577 if (numConnections >= 64) {
579 WRITE_WARNING(
"Junction '" +
getID() +
"' is too complicated (#links>64); will be set to unregulated.");
583 }
else if (numConnections == 0) {
615 if (mismatchThreshold >= 0
674 std::swap(inc1, inc2);
697 std::swap(out1, out2);
708 EdgeVector::reverse_iterator i;
710 NBEdge* currentOutgoing = *i;
713 if (approaching->size() != 0) {
725 (*i)->markAsInLane2LaneState();
734 EdgeVector::const_iterator i = find(
myAllEdges.begin(),
740 for (; *i != currentOutgoing;) {
742 if ((*i)->getToNode() ==
this && (*i)->getTurnDestination() != currentOutgoing) {
743 std::vector<int> connLanes = (*i)->getConnectionLanes(currentOutgoing);
744 if (connLanes.size() != 0) {
745 approaching->push_back(*i);
775 unsigned int laneOff = 0;
776 for (EdgeVector::const_iterator i = which.begin(); i != which.end(); i++) {
778 laneOff += (*i)->getNumLanes();
807 unsigned int laneOff = 0;
808 for (EdgeVector::const_iterator i = which.begin(); i != which.end(); i++) {
810 laneOff += (*i)->getNumLanes();
825 unsigned int whichLaneOff,
unsigned int byLaneOff) {
829 bool changed =
false;
831 if (c.
replaceFrom(which, whichLaneOff, by, byLaneOff)) {
834 if (c.
replaceTo(which, whichLaneOff, by, byLaneOff)) {
848 for (NBConnectionVector::iterator k = prohibiting.begin(); k != prohibiting.end(); k++) {
850 sprohibiting.
replaceFrom(which, whichLaneOff, by, byLaneOff);
851 sprohibiting.
replaceTo(which, whichLaneOff, by, byLaneOff);
912 if (find(edges.begin(), edges.end(), e) != edges.end()) {
913 edges.erase(find(edges.begin(), edges.end(), e));
915 if (edges.size() == 0) {
931 mayDrive.
getTo() == 0 ||
933 mustStop.
getTo() == 0) {
935 WRITE_WARNING(
"Something went wrong during the building of a connection...");
939 conn.push_back(mayDrive);
946 unsigned int size = (
unsigned int) edgeid.length();
948 std::string
id = (*i)->
getID();
949 if (
id.substr(0, size) == edgeid) {
959 unsigned int size = (
unsigned int) edgeid.length();
961 std::string
id = (*i)->
getID();
962 if (
id.substr(0, size) == edgeid) {
987 if (removeFromConnections) {
989 (*i)->removeFromConnections(edge);
999 EdgeVector::const_iterator i;
1001 NBNode* conn = (*i)->getFromNode();
1004 toAdd.
mul((
SUMOReal) 1.0 / sqrt(toAdd.
x()*toAdd.
x() + toAdd.
y()*toAdd.
y()));
1008 NBNode* conn = (*i)->getToNode();
1011 toAdd.
mul((
SUMOReal) 1.0 / sqrt(toAdd.
x()*toAdd.
x() + toAdd.
y()*toAdd.
y()));
1015 if (pos.
x() == 0 && pos.
y() == 0) {
1027 (*i)->invalidateConnections();
1035 (*i)->invalidateConnections();
1075 std::vector<NBEdge*>::const_iterator i = std::find(
myAllEdges.begin(),
myAllEdges.end(), from);
1085 const NBEdge*
const possProhibitedFrom,
const NBEdge*
const possProhibitedTo,
1086 bool regardNonSignalisedLowerPriority)
const {
1088 possProhibitedFrom, possProhibitedTo,
1089 regardNonSignalisedLowerPriority);
1095 const NBEdge*
const from2,
const NBEdge*
const to2)
const {
1104 assert(find(incoming.begin(), incoming.end(), removed) == incoming.end());
1105 bool changed =
true;
1111 for (NBConnectionProhibits::iterator i = blockedConnectionsTmp.begin(); i != blockedConnectionsTmp.end(); i++) {
1116 bool blockedChanged =
false;
1118 NBConnectionVector::const_iterator j;
1119 for (j = blocked.begin(); j != blocked.end(); j++) {
1121 if (sblocked.
getFrom() == removed || sblocked.
getTo() == removed) {
1122 blockedChanged =
true;
1126 for (j = blocked.begin(); blockedChanged && j != blocked.end(); j++) {
1128 if (sblocked.
getFrom() == removed && sblocked.
getTo() == removed) {
1132 }
else if (sblocked.
getFrom() == removed) {
1133 assert(sblocked.
getTo() != removed);
1134 for (EdgeVector::const_iterator k = incoming.begin(); k != incoming.end(); k++) {
1137 }
else if (sblocked.
getTo() == removed) {
1138 assert(sblocked.
getFrom() != removed);
1139 for (EdgeVector::const_iterator k = outgoing.begin(); k != outgoing.end(); k++) {
1146 if (blockedChanged) {
1147 blockedConnectionsNew[blocker] = newBlocked;
1152 if (blocker.
getFrom() == removed && blocker.
getTo() == removed) {
1157 }
else if (blocker.
getFrom() == removed) {
1158 assert(blocker.
getTo() != removed);
1160 for (EdgeVector::const_iterator k = incoming.begin(); k != incoming.end(); k++) {
1163 }
else if (blocker.
getTo() == removed) {
1164 assert(blocker.
getFrom() != removed);
1166 for (EdgeVector::const_iterator k = outgoing.begin(); k != outgoing.end(); k++) {
1170 blockedConnectionsNew[blocker] = blocked;
1184 if (outgoing == 0) {
1195 if (
abs((
int) angle) + 1 < 45) {
1202 EdgeVector::const_iterator i =
1205 while ((*i) != incoming) {
1206 if ((*i)->getFromNode() ==
this) {
1214 EdgeVector::const_iterator i =
1217 while ((*i) != incoming) {
1229 bool mayDefinitelyPass,
const std::string& tlID)
const {
1233 if (outgoing == 0) {
1242 if ((!incoming->
isInnerEdge() &&
mustBrake(incoming, outgoing, fromlane)) && !mayDefinitelyPass) {
1256 EdgeVector::const_iterator i;
1269 std::set<NBNode*> origSet;
1271 origSet.insert((*i)->getFromNode());
1273 if (origSet.size() < 2) {
1280 NBNode* origin = (*i)->getFromNode();
1282 EdgeVector::const_iterator j =
1291 if (!(*i)->expandableBy(*j)) {
1307 std::vector<std::pair<NBEdge*, NBEdge*> >
1310 std::vector<std::pair<NBEdge*, NBEdge*> > ret;
1314 std::pair<NBEdge*, NBEdge*>(
1320 NBNode* origin = (*i)->getFromNode();
1321 EdgeVector::const_iterator j =
1325 ret.push_back(std::pair<NBEdge*, NBEdge*>(*i, *j));
1340 if ((*i)->getToNode() == n) {
1355 back_inserter(edges));
1357 back_inserter(edges));
1358 for (EdgeVector::const_iterator j = edges.begin(); j != edges.end(); ++j) {
1369 for (EdgeVector::const_iterator k = edges2.begin(); k != edges2.end(); ++k) {
1370 if ((*k)->getFromNode()->isDistrict() || (*k)->getToNode()->isDistrict()) {
1387 unsigned int noInternalNoSplits = 0;
1389 const std::vector<NBEdge::Connection>& elv = (*i)->getConnections();
1390 for (std::vector<NBEdge::Connection>::const_iterator k = elv.begin(); k != elv.end(); ++k) {
1391 if ((*k).toEdge == 0) {
1394 noInternalNoSplits++;
1397 unsigned int lno = 0;
1398 unsigned int splitNo = 0;
1400 (*i)->buildInnerEdges(*
this, noInternalNoSplits, lno, splitNo);
1419 if (
MAX2(angle0, angle1) <= 160) {
void sub(SUMOReal dx, SUMOReal dy)
Substracts the given position from this one.
The link is a partial left direction.
const PositionVector & getLaneShape(unsigned int i) const
Returns the shape of the nth lane.
void replaceIncoming(NBEdge *which, NBEdge *by, unsigned int laneOff)
Replaces occurences of the first edge within the list of incoming by the second Connections are remap...
const Position & p2() const
const EdgeVector & getIncomingEdges() const
Returns this node's incoming edges.
void replaceOutgoing(const EdgeVector &which, NBEdge *const by)
Replaces outgoing edges from the vector (source) by the given edge.
Position getEmptyDir() const
Returns something like the most unused direction Should only be used to add source or sink nodes...
static SUMOReal getCWAngleDiff(SUMOReal angle1, SUMOReal angle2)
Returns the distance of second angle from first angle clockwise.
A structure which describes a connection between edges or lanes.
int toLane
The lane the connections yields in.
void setRoundabout()
update the type of this node as a roundabout
Position getCenter() const
Returns a position that is guaranteed to lie within the node shape.
ApproachingDivider(EdgeVector *approaching, NBEdge *currentOutgoing)
Constructor.
static SUMOReal getCCWAngleDiff(SUMOReal angle1, SUMOReal angle2)
Returns the distance of second angle from first angle counter-clockwise.
PositionVector shape
The lane's shape.
virtual void addNode(NBNode *node)
Adds a node to the traffic light logic.
bool isInStringVector(const std::string &optionName, const std::string &itemName)
Returns the named option is a list of string values containing the specified item.
void add(const Position &pos)
Adds the given position to this one.
PositionVector myPoly
the (outer) shape of the junction
NBEdge * getOppositeIncoming(NBEdge *e) const
void execute(const unsigned int src, const unsigned int dest)
SumoXMLNodeType myType
The type of the junction.
A container for traffic light definitions and built programs.
void reinit(const Position &position, SumoXMLNodeType type, bool updateEdgeGeometries=false)
Resets initial values.
static SUMOReal normRelAngle(SUMOReal angle1, SUMOReal angle2)
ensure that reverse relAngles (>=179.999) always count as turnarounds (-180)
bool isTLControlled() const
Returns whether this node is controlled by any tls.
Some static methods for string processing.
bool forbids(const NBEdge *const possProhibitorFrom, const NBEdge *const possProhibitorTo, const NBEdge *const possProhibitedFrom, const NBEdge *const possProhibitedTo, bool regardNonSignalisedLowerPriority) const
Returns the information whether "prohibited" flow must let "prohibitor" flow pass.
TrafficLightType getType() const
get the algorithm type (static etc..)
PositionVector computeInternalLaneShape(NBEdge *fromE, int fromL, NBEdge *toE, int toL, int numPoints=5) const
Compute the shape for an internal lane.
This class computes shapes of junctions.
This is an uncontrolled, minor link, has to stop.
void removeEdge(NBEdge *edge, bool removeFromConnections=true)
Removes edge from this node and optionally removes connections as well.
void addIncomingEdge(NBEdge *edge)
adds an incoming edge
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
The representation of a single edge during network building.
Class to sort edges by their angle in relation to the given edge.
bool replaceTo(NBEdge *which, NBEdge *by)
replaces the to-edge by the one given
The link is a 180 degree turn.
void rotateAtP1(SUMOReal rot)
bool mustBrake(const NBEdge *const from, const NBEdge *const to, int toLane) const
Returns the information whether the described flow must let any other flow pass.
bool hasOutgoing(const NBEdge *const e) const
Returns whether the given edge starts at this node.
A container for districts.
The base class for traffic light logic definitions.
bool addLane2LaneConnections(unsigned int fromLane, NBEdge *dest, unsigned int toLane, unsigned int no, Lane2LaneInfoType type, bool invalidatePrevious=false, bool mayDefinitelyPass=false)
Builds no connections starting at the given lanes.
bool isJoinedTLSControlled() const
Returns whether this node is controlled by a tls that spans over more than one node.
void extrapolateFirstBy(SUMOReal length)
bool isInnerEdge() const
Returns whether this edge was marked as being within an intersection.
This is an uncontrolled, right-before-left link.
static void nextCW(const EdgeVector &edges, EdgeVector::const_iterator &from)
void remapConnections(const EdgeVector &incoming)
Remaps the connection in a way that allows the removal of it.
SUMOReal distanceTo(const Position &p2) const
returns the euclidean distance in 3 dimension
bool checkIsRemovable() const
bool around(const Position &p, SUMOReal offset=0) const
Returns the information whether the position vector describes a polygon lying around the given point ...
bool isTurningDirectionAt(const NBNode *n, const NBEdge *const edge) const
Returns whether the given edge is the opposite direction to this edge.
bool almostSame(const Position &p2, SUMOReal maxDiv=POSITION_EPS) const
void removeTrafficLight(NBTrafficLightDefinition *tlDef)
Removes the given traffic light from this node.
The link is controlled by a tls which is off, not blinking, may pass.
NBConnectionProhibits myBlockedConnections
void writeLogic(std::string key, OutputDevice &into, const bool checkLaneFoes) const
bool hasIncoming(const NBEdge *const e) const
Returns whether the given edge ends at this node.
SUMOReal x() const
Returns the x-position.
This is an uncontrolled, all-way stop link.
void addOutgoingEdge(NBEdge *edge)
adds an outgoing edge
NBEdge * getFrom() const
returns the from-edge (start of the connection)
The link is a (hard) left direction.
#define WRITE_WARNING(msg)
The connection was computed and validated.
LinkDirection
The different directions a link between two lanes may take (or a stream between two edges)...
The link is a straight direction.
SUMOTime getOffset()
Returns the offset.
NBDistrict * myDistrict
The district the node is the centre of.
A class representing a single district.
const EdgeVector & getOutgoingEdges() const
Returns this node's outgoing edges.
An (internal) definition of a single lane of an edge.
const std::string & getID() const
Returns the id.
EdgeVector myAllEdges
Vector of incoming and outgoing edges.
void computeLanes2Lanes()
computes the connections of lanes to edges
Position getPositionAtDistance(SUMOReal offset) const
void invalidateIncomingConnections()
bool isConnectedTo(NBEdge *e)
Returns the information whethe a connection to the given edge has been added (or computed) ...
const Position & getPosition() const
Returns the position of this node.
const Position & p1() const
bool replaceFrom(NBEdge *which, NBEdge *by)
replaces the from-edge by the one given
Lanes to lanes - relationships are loaded; no recheck is necessary/wished.
NBEdge * getPossiblySplittedIncoming(const std::string &edgeid)
void computeNodeShape(bool leftHand, SUMOReal mismatchThreshold)
Compute the junction shape for this node.
bool isSimpleContinuation() const
void buildBitfieldLogic(bool leftHanded)
void remapRemoved(NBEdge *removed, const EdgeVector &incoming, const EdgeVector &outgoing)
Replaces occurences of the removed edge in incoming/outgoing edges of all definitions.
std::string tlID
The id of the traffic light that controls this connection.
This is an uncontrolled, minor link, has to brake.
A point in 2D or 3D with translation and scaling methods.
bool mustBrake(const NBEdge *const possProhibitorFrom, const NBEdge *const possProhibitorTo, const NBEdge *const possProhibitedFrom, const NBEdge *const possProhibitedTo) const
Returns the information whether "prohibited" flow must let "prohibitor" flow pass.
void add(SUMOReal xoff, SUMOReal yoff, SUMOReal zoff)
bool needsCont(NBEdge *fromE, NBEdge *toE, NBEdge *otherFromE, NBEdge *otherToE, const NBEdge::Connection &c) const
unsigned int getNumLanes() const
Returns the number of lanes.
bool geometryLike() const
whether this is structurally similar to a geometry node
SUMOReal offset
This lane's offset to the intersection begin.
void invalidateOutgoingConnections()
SUMOReal distance(const Position &p) const
LinkState
The right-of-way state of a link between two lanes used when constructing a NBTrafficLightLogic, in MSLink and GNEInternalLane.
void removeTrafficLights()
Removes all references to traffic lights that control this tls.
EdgeVector * getEdgesThatApproach(NBEdge *currentOutgoing)
std::set< NBTrafficLightDefinition * > myTrafficLights
Storage for edges, including some functionality operating on multiple edges.
void bezier(int npts, SUMOReal b[], int cpts, SUMOReal p[])
The link is a (hard) right direction.
PositionVector compute(bool leftHand)
Computes the shape of the assigned junction.
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
const PositionVector & getShape() const
The link is a partial right direction.
static void compute(BresenhamCallBack *callBack, const unsigned int val1, const unsigned int val2)
NBEdge * getConnectionTo(NBNode *n) const
const std::vector< NBNode * > & getNodes() const
Returns the list of controlled nodes.
SUMOReal atan2Angle() const
virtual void removeNode(NBNode *node)
Removes the given node from the list of controlled nodes.
EdgeVector myIncomingEdges
Vector of incoming edges.
bool isLeftMover(const NBEdge *const from, const NBEdge *const to) const
Computes whether the given connection is a left mover across the junction.
Base class for objects which have an id.
std::vector< NBConnection > NBConnectionVector
Definition of a connection vector.
std::vector< std::pair< NBEdge *, NBEdge * > > getEdgesToJoin() const
bool intersects(const Line &l) const
int getJunctionPriority(const NBNode *const node) const
Returns the junction priority (normalised for the node currently build)
NBEdge * getPossiblySplittedOutgoing(const std::string &edgeid)
unsigned int removeSelfLoops(NBDistrictCont &dc, NBEdgeCont &ec, NBTrafficLightLogicCont &tc)
Removes edges which are both incoming and outgoing into this node.
EdgeVector myOutgoingEdges
Vector of outgoing edges.
SUMOReal length() const
Returns the length.
void push_back(const PositionVector &p)
Appends all positions from the given vector.
std::string myID
The name of the object.
NBNode * getToNode() const
Returns the destination node of the edge.
void addTrafficLight(NBTrafficLightDefinition *tlDef)
Adds a traffic light to the list of traffic lights that control this node.
void extrapolateSecondBy(SUMOReal length)
bool isNearDistrict() const
std::vector< int > getConnectionLanes(NBEdge *currentOutgoing) const
Returns the list of lanes that may be used to reach the given edge.
Position myPosition
The position the node lies at.
std::map< NBConnection, NBConnectionVector > NBConnectionProhibits
Definition of a container for connection block dependencies Includes a list of all connections which ...
void replaceOutgoing(NBEdge *which, NBEdge *by, unsigned int laneOff)
Replaces occurences of the first edge within the list of outgoing by the second Connections are remap...
~ApproachingDivider()
Destructor.
LinkState getLinkState(const NBEdge *incoming, NBEdge *outgoing, int fromLane, bool mayDefinitelyPass, const std::string &tlID) const
SumoXMLNodeType
Numbers representing special SUMO-XML-attribute values for representing node- (junction-) types used ...
bool isLeftHanded() const
Returns whether the built edges are left-handed.
void replaceInConnectionProhibitions(NBEdge *which, NBEdge *by, unsigned int whichLaneOff, unsigned int byLaneOff)
The link is controlled by a tls which is off and blinks, has to brake.
std::vector< NBEdge * > EdgeVector
EdgeVector * myApproaching
The list of edges that approach the current edge.
SUMOReal y() const
Returns the y-position.
A storage for options typed value containers)
void sub(SUMOReal x, SUMOReal y)
void erase(NBDistrictCont &dc, NBEdge *edge)
Removes the given edge from the container (deleting it)
void replaceInConnections(NBEdge *which, NBEdge *by, unsigned int laneOff)
This is an uncontrolled, major link, may pass.
void mul(SUMOReal val)
Multiplies both positions with the given value.
std::deque< int > * spread(const std::vector< int > &approachingLanes, int dest) const
NBEdge * getTo() const
returns the to-edge (end of the connection)
The connection was computed.
Represents a single node (junction) during network building.
bool removeFully(const std::string id)
Removes a logic definition (and all programs) from the dictionary.
Lane & getLaneStruct(unsigned int lane)
bool foes(const NBEdge *const from1, const NBEdge *const to1, const NBEdge *const from2, const NBEdge *const to2) const
Returns the information whether the given flows cross.
Lanes to lanes - relationships are computed; no recheck is necessary/wished.
bool insert(NBTrafficLightDefinition *logic, bool forceInsert=false)
Adds a logic definition to the dictionary.
NBEdge * getTurnDestination() const
void addSortedLinkFoes(const NBConnection &mayDrive, const NBConnection &mustStop)
Static storage of an output device and its base (abstract) implementation.
Computes lane-2-lane connections.
bool writeLogic(OutputDevice &into, const bool checkLaneFoes) const
static SUMOReal relAngle(SUMOReal angle1, SUMOReal angle2)
void push_back_noDoublePos(const Position &p)
void computeLogic(const NBEdgeCont &ec, OptionsCont &oc)
computes the node's type, logic and traffic light
Position getPolygonCenter() const
Returns the arithmetic of all corner points.
void setConnection(unsigned int lane, NBEdge *destEdge, unsigned int destLane, Lane2LaneInfoType type, bool mayUseSameDestination=false, bool mayDefinitelyPass=false)
Adds a connection to a certain lane of a certain edge.
A traffic light logics which must be computed (only nodes/edges are given)
bool foes(const NBEdge *const from1, const NBEdge *const to1, const NBEdge *const from2, const NBEdge *const to2) const
Returns the information whether the given flows cross.
void invalidateTLS(NBTrafficLightLogicCont &tlCont)
causes the traffic light to be computed anew
void closePolygon()
ensures that the last position equals the first
Lanes to edges - relationships are computed/loaded.
NBNode(const std::string &id, const Position &position, SumoXMLNodeType type)
Constructor.
void append(const PositionVector &v)
Position intersectsAt(const Line &l) const
PositionVector getSubpart(SUMOReal beginOffset, SUMOReal endOffset) const
static void nextCCW(const EdgeVector &edges, EdgeVector::const_iterator &from)
void reshiftPosition(SUMOReal xoff, SUMOReal yoff)
Applies an offset to the node.
void remapRemoved(NBTrafficLightLogicCont &tc, NBEdge *removed, const EdgeVector &incoming, const EdgeVector &outgoing)
std::pair< unsigned int, unsigned int > getSizes() const
returns the number of the junction's lanes and the number of the junction's links in respect...
void replaceIncoming(const EdgeVector &which, NBEdge *const by)
Replaces incoming edges from the vector (sinks) by the given edge.
SUMOReal getAngleAtNode(const NBNode *const node) const
Returns the angle of the edge's geometry at the given node.
bool forbids(const NBEdge *const possProhibitorFrom, const NBEdge *const possProhibitorTo, const NBEdge *const possProhibitedFrom, const NBEdge *const possProhibitedTo, bool regardNonSignalisedLowerPriority) const
Returns the information whether "prohibited" flow must let "prohibitor" flow pass.
The link has no direction (is a dead end link)
LinkDirection getDirection(const NBEdge *const incoming, const NBEdge *const outgoing) const
Returns the representation of the described stream's direction.
NBNode * getFromNode() const
Returns the origin node of the edge.